Wysłany: 2017-03-24, 21:36
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Dobry wiecz?r wszystkim . Mam problem z elementdat? poniewa? nie wiem co w tym kodzie jest ?le . Wyskakuje b??d o dodaniu then za setElementData co po pierwsze nic nie daje a po 2 moim zdaniem jest zb?dne .
function nadaj ( plr )
local nazwa = getAccountName ( getPlayerAccount ( plr ))
if isObjectInACLGroup ( "user." .. nazwa , aclGetGroup ( "Policja" ))
setElementData ( plr , "poli" , true )
end
end
addEventHandler ( "onPlayerLogin" , root , nadaj )
Wysłany: 2017-03-24, 21:39
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
function nadaj ( plr )
local nazwa = getAccountName ( getPlayerAccount ( plr ))
if isObjectInACLGroup ( "user." .. nazwa , aclGetGroup ( "Policja" )) then
setElementData ( plr , "poli" , true )
end
end
addEventHandler ( "onPlayerLogin" , root , nadaj )
Wysłany: 2017-03-24, 22:26
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Nie b?d? tworzy? kolejnego w?tku ?eby nie za?mieca? , je?eli to zostanie rozwi?zane to prosz? o zamkni?cie .
Tym razem chodzi o getElementDate . Sprawdzam getElementDate i zrobi?em ze jak kto? j? ma to dodaje go do teamu po zalogowaniu , wyt?umaczcie mi czemu to nie dzia?a .
function team ( plr )
if getElementData ( plr , "poli" , true ) then
setPlayerTeam ( plr , poli )
local r , g , b = getTeamColor ( poli )
setPlayerNametagColor ( plr , r , g , b )
end
end
addEventHandler ( "onPlayerLogin" , root , team )
To jest robione pod tamt? elementdate nadawan?.
Podpis
Uczeń LUA . Mapper MTA.
Wysłany: 2017-03-24, 22:32
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
Event "onPlayerLogin dzia?a po zalogowaniu. Nak?adanie elementDaty r?wnie? da?e? przy zalogowaniu. Prawdopodobniej pierw sprawdza elementDat? a dopiero p??niej j? nadaje. Je?eli chcesz to sprawdzi? to zamie? na ten kod:
function team ( plr )
if getElementData ( plr , "poli" , true ) then
setPlayerTeam ( plr , poli )
local r , g , b = getTeamColor ( poli )
setPlayerNametagColor ( plr , r , g , b )
else
outputChatBox ( "Nie masz elementDaty" , plr )
end
end
addEventHandler ( "onPlayerLogin" , root , team )
lub po??cz obydwa skrypty w jeden. Tyle ?e nak?adanie daj wy?ej od sprawdzania
Podpis
"amited" napisał/a :
Wysłany: 2017-03-24, 22:36
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Brak komunikatu.
@EDIT
One s? pisane w jednym skrypcie.
Wysłany: 2017-03-24, 22:38
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
po??cz te dwie funkcji w jeden skrypt
Podpis
"amited" napisał/a :
Wysłany: 2017-03-24, 22:40
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Podpis
Uczeń LUA . Mapper MTA.
Wysłany: 2017-03-25, 15:49
maciek3286
LUA Developer
Wiek: 26 Na forum: 5201 dni Posty: 230
Nick w MP: maciek00
Piwa : 3207
Spr?buj tak:
function team ()
if getElementData ( source , "poli" ) == true then
setPlayerTeam ( source , poli )
local r , g , b = getTeamColor ( poli )
setPlayerNametagColor ( source , r , g , b )
else
outputChatBox ( "Nie masz elementDaty" , source )
end
end
addEventHandler ( "onPlayerLogin" , root , team )
Podpis
"Ludzie będą zawsze dla ciebie źli, jeżeli konieczność nie zmusi ich do tego, by byli dobrzy" ~~ Niccolò Machiavelli
Wysłany: 2017-03-25, 16:18
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
poka? CA?Y skrpyt jak teraz wygl?da.
Podpis
"amited" napisał/a :
Wysłany: 2017-03-25, 17:07
sasik12
Wiek: 26 Na forum: 3763 dni Posty: 182
Piwa : 7
Prosz? :
function nadaj ( plr )
local nazwa = getAccountName ( getPlayerAccount ( plr ))
if isObjectInACLGroup ( "user." .. nazwa , aclGetGroup ( "Policja" )) then
setElementData ( plr , "poli" , true )
end
end
addEventHandler ( "onPlayerLogin" , root , nadaj )
function nadaj2 ( plr )
local nazwa = getAccountName ( getPlayerAccount ( plr ))
if isObjectInACLGroup ( "user." .. nazwa , aclGetGroup ( "Inspekcja Transportu Drogowego" )) then
setElementData ( plr , "itd" , true )
end
end
addEventHandler ( "onPlayerLogin" , root , nadaj2 )
function nadaj3 ( plr )
local nazwa = getAccountName ( getPlayerAccount ( plr ))
if isObjectInACLGroup ( "user." .. nazwa , aclGetGroup ( "Taxi" )) then
setElementData ( plr , "taxi" , true )
end
end
addEventHandler ( "onPlayerLogin" , root , nadaj3 )
function nadaj4 ( plr )
local nazwa = getAccountName ( getPlayerAccount ( plr ))
if isObjectInACLGroup ( "user." .. nazwa , aclGetGroup ( "Pomo​c Drogowa" )) then
setElementData ( plr , "pd" , true )
end
end
addEventHandler ( "onPlayerLogin" , root , nadaj4 )
function nadaj5 ( plr )
local nazwa = getAccountName ( getPlayerAccount ( plr ))
if isObjectInACLGroup ( "user." .. nazwa , aclGetGroup ( "Petrol" )) then
setElementData ( plr , "petrol" , true )
end
end
addEventHandler ( "onPlayerLogin" , root , nadaj5 )
function nadaj6 ( plr )
local nazwa = getAccountName ( getPlayerAccount ( plr ))
if isObjectInACLGroup ( "user." .. nazwa , aclGetGroup ( "Powe​rTrans" )) then
setElementData ( plr , "power" , true )
end
end
addEventHandler ( "onPlayerLogin" , root , nadaj6 )
function team ( plr )
if getElementData ( plr , "poli" , true ) then
setPlayerTeam ( plr , poli )
local r , g , b = getTeamColor ( poli )
setPlayerNametagColor ( plr , r , g , b )
else
outputChatBox ( "Nie masz elementDaty" , plr )
end
end
addEventHandler ( "onPlayerLogin" , root , team )
createTeam ( "Kier​owcy" , 5 , 248 , 28 )
createTeam ( "Poli​cja" , 19 , 38 , 220 )
createTeam ( "Insp​ekcja Transportu Drogowego" , 13 , 11 & #8203;2,22)
createTeam ( "Taxi​" , 243 , 235 , 29 )
createTeam ( "Pomo​c Drogowa" , 186 , 17 ,& #8203;229)
createTeam ( "Petr​ol" , 229 , 91 , 17 )
createTeam ( "Powe​rTrans" , 17 , 229 , 2 & #8203;21)
Podpis
Uczeń LUA . Mapper MTA.
Tagi: setelementdata
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: