Tematy otagowane jako: tworzy.
1. Tworzenie GUI. Reszta elementów się nie tworzy.
Mam problem z innymi elementami podpi?tymi pod okno GUI.
Wy?wietla si? tylko okno (window), a reszta element?w ju? nie.
if not gui then
gui = {}
showCursor ( true )
gui [ 1 ] = guiCreateWindow ( 437 * w , 239 * h , 492 * w , 290 * h , "Sprzeda? pojazdu 1/3" , false )
gui [ 2 ] = guiCreateGridList ( 454 * w , 310 * h , 455 * w , 137 * h , false , gui [ 1 ])
gui [ 3 ] = guiGridListAddColumn ( gui [ 2 ], "Nick gracza:" , 0.9 )
gui [ 4 ] = guiCreateButton ( 685 * w , 466 * h , 223 * w , 49 * h , "Zamknij okno" , false , gui [ 1 ])
gui [ 5 ] = guiCreateButton ( 454 * w , 466 * h , 223 * w , 49 * h , "Nast?pny krok" , false , gui [ 1 ])
addEventHandler ( "onClientGUIClick" , gui [ 4 ], onSprzedazClickZamknij , false )
addEventHandler ( "onClientGUIClick" , gui [ 5 ], onSprzedazClickGraczeDalej , false )
end
Wi?cej kodu nie potrzeba. Za pomoc stawiam piwo i respekt.
2. [INNE] Tworzenie firm, źle tworzy.
Cze??, mam ma?y problem z tworzeniem firm. Ale gdy firmy si? tworzy po kolei czyli: od UID 0 do UID2 jest dobrze, ale gdy firma numer 1 si? rozpadnie i zostanie tylko UID 0 i 2 to ju? wtedy jest problem i nie stworzy si? nowa.
kod:
Kod:
if(dialogid == KREATOR_FIRM)
{
if(response)
{
if(firmy[2][kupiona]==0)
{
SendClientMessage(playerid, ZIELONY, "UID 2");
ShowPlayerDialog(playerid,KREATOR_FIRM3,DIALOG_STYLE_INPUT,"Firmy","Wpisz nazwe firmy","Dalej","Wyjdz");
}
else if(firmy[1][kupiona]==0)
{
SendClientMessage(playerid, ZIELONY, "UID 1");
ShowPlayerDialog(playerid,KREATOR_FIRM2,DIALOG_STYLE_INPUT,"Firmy","Wpisz nazwe firmy","Dalej","Wyjdz");
}
else if(firmy[0][kupiona]==0)
{
SendClientMessage(playerid, ZIELONY, "UID 0");
ShowPlayerDialog(playerid,KREATOR_FIRM1,DIALOG_STYLE_INPUT,"Firmy","Wpisz nazwe firmy","Dalej","Wyjdz");
}
if(firmy[0][kupiona]==1 && firmy[1][kupiona]==1 && firmy[2][kupiona]==1)
{
SendClientMessage(playerid, ZIELONY, "Wszystkie firmy sa wykupione");
}
}
else
{
SendClientMessage(playerid, ZIELONY, "Anulowales zalozenie firmy");
}
}
Za pomoc
3. Marker się nie tworzy.
Witam, m?j problem polega na tym, ?e marker si? nie tworzy:
local towarMarkery ={
{- 2635.0795898438 , 609.25616455078 , 14.153125 },
{- 2712.2685546875 , - 306.02142333984 , 6.881497 },
{- 1568.2467041016 , 1223.2154541016 , 6.8875 }
}
local endMarkery ={
{- 2632.0795898438 , 609.25616455078 , 14.153125 },
{- 2709.2685546875 , - 306.02142333984 , 6.881497 },
{- 1565.2467041016 , 1223.2154541016 , 6.8875 }
}
local towarAuta = { [ 413 ]= true , [ 482 ]= true }
marker = createMarker ( unpack ( towarMarkery [ math . random ( 1 , #towarMarkery)]), "cylinder", 1.5, 0, 0, 255, 255)
addEventHandler ( "onMarkerHit" , marker ,
function()
if ( not towarAuta [ getElementModel ( source )]) then
triggerClientEvent ( "onMarkerWeszed" , getRootElement ())
end
end
)
4. Bind się nie tworzy.
Witam, mam problem, ot?? bindy tworz? si? po restarcie skryptu, a po wej?ciu gracza na serwer nie. Oto kod:
function bindKeys ()
for k , gracze in ipairs ( getElementsByType ( "player" )) do
if not ( isKeyBound ( gracze , "F3" , "down" , funkcja )) then
bindKey ( gracze , "F3" , "down" , funkcja )
end
end
end
function bindKeysPlayerJoin ()
bindKey ( source , "F3" , "down" , funkcja )
end
addEventHandler ( "onPlayerJoin" , getRootElement (), bindKeysPlayerJoin )
addEventHandler ( "onResourceStart" , getResourceRootElement (), bindKeys )