Wysłany: 2015-12-17, 19:44
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
function zalogowany ( thePlayer )
if getElementType ( thePlayer ) ~= "player" then return false end
triggerClientEvent ( thePlayer , "OLzalogowany" , root )
end
addEventHandler ( "onPlayerLogin" , root , zalogowany )
2 linijka expend element at arg. thePlayer
Wysłany: 2015-12-17, 20:18
Wittx
8===D
Wiek: 26 Na forum: 4794 dni Posty: 121
Nick w MP: wittula
Piwa : 1905
Pierwszym argumentem w funkcji podpi?tej pod zdarzenie jest poprzednie konto gracza, nie element player.
addEventHandler ( 'onPlayerLogin' , root , function()
triggerClientEvent ( source , "OLzalogowany" , source );
end );
Elementem player na kt?rym wykonywane jest zdarzenie jest source .
Cytat: The source of this event is the player element that just logged in.
Wysłany: 2015-12-17, 20:19
Terr9909
Skrypter LUA
Wiek: 26 Na forum: 4235 dni Posty: 346
Nick w MP: Split
Piwa : 1043
Sk?d thePlayer?
?ap ziomu?:
addEventHandler ( "onPlayerLogin" , root , function()
if getElementType ( source ) ~= "player" then return end
triggerClientEvent ( source , "OLzalogowany" , root )
end
end )
@@ up
by?e? pierwszy
Wysłany: 2015-12-17, 20:23
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
Dziala lecz gui nie pokazuje
c side
addEvent ( "OLzalogowanyOL" , true )
addEventHandler ( "OLzalogowanyOL" , resourceRoot ,
function( player )
okno = guiCreateWindow ( 0.30 , 0.31 , 0.40 , 0.31 , "Wyb?r spawnu" , true )
guiWindowSetSizable ( okno , false )
ls = guiCreateButton ( 0.01 , 0.08 , 0.18 , 0.13 , "Los Santos" , true , okno )
guiSetProperty ( ls , "NormalTextColour" , "FFAAAAAA" )
lv = guiCreateButton ( 0.01 , 0.24 , 0.18 , 0.13 , "Las Venturas" , true , okno )
guiSetProperty ( lv , "NormalTextColour" , "FFAAAAAA" )
sf = guiCreateButton ( 0.01 , 0.40 , 0.18 , 0.13 , "San Fierro" , true , okno )
guiSetProperty ( sf , "NormalTextColour" , "FFAAAAAA" )
fc = guiCreateButton ( 0.01 , 0.56 , 0.18 , 0.13 , "Fort Carson" , true , okno )
guiSetProperty ( fc , "NormalTextColour" , "FFAAAAAA" )
infols = guiCreateLabel ( 0.19 , 0.08 , 0.80 , 0.13 , "Przechowywalnia\nPrace Dorywcze\nTuning Shop" , true , okno )
guiLabelSetHorizontalAlign ( infols , "center" , false )
guiLabelSetVerticalAlign ( infols , "center" )
infolv = guiCreateLabel ( 0.19 , 0.24 , 0.80 , 0.13 , "Salon Samochodowy\nPrace Dorywcze\nStra? Po?arna" , true , okno )
guiLabelSetHorizontalAlign ( infolv , "center" , false )
guiLabelSetVerticalAlign ( infolv , "center" )
infosf = guiCreateLabel ( 0.19 , 0.40 , 0.80 , 0.13 , "Urz?d Miasta\nPrace Dorywcze\nSzpital" , true , okno )
guiLabelSetHorizontalAlign ( infosf , "center" , false )
guiLabelSetVerticalAlign ( infosf , "center" )
infofc = guiCreateLabel ( 0.19 , 0.56 , 0.80 , 0.13 , "Policja\nPrace Dorywcze\nGie?da\nMechanik" , true , okno )
guiLabelSetHorizontalAlign ( infofc , "center" , false )
showCursor ( false , true )
end
)
s
addEventHandler ( 'onPlayerLogin' , root , function()
triggerClientEvent ( source , "OLzalogowany" , source )
end )
Wysłany: 2015-12-17, 20:34
Wittx
8===D
Wiek: 26 Na forum: 4794 dni Posty: 121
Nick w MP: wittula
Piwa : 1905
Zdarzenie klienta do kt?rego si? odwo?ujesz po stronie serwera nie istnieje. Nazwy si? nie zgadzaj?.
Wysłany: 2015-12-17, 20:38
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
sory, tam jest OLzalogowanyOL, ale i tak nie dziala
Wysłany: 2015-12-17, 20:41
Wittx
8===D
Wiek: 26 Na forum: 4794 dni Posty: 121
Nick w MP: wittula
Piwa : 1905
Kod: addEventHandler("OLzalogowanyOL", resourceRoot,
Dlaczego resourceRoot?
Wysłany: 2015-12-17, 20:42
BlackTen
LUA Dev.
Wiek: 28 Na forum: 4330 dni Posty: 698
Piwa : 2080
ok dziala mialo byc root
Tagi: theplayer
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: