function changeCarLightsColor ( thePlayer, command, red, green, blue, zoo )
local theVehicle = getPedOccupiedVehicle ( thePlayer )
if ( not theVehicle ) then
return outputChatBox( "You don't have vehicle!" )
end
red = tonumber ( red )
green = tonumber ( green )
blue = tonumber ( blue )
-- check if the colour values for red, green and blue are valid
if red and green and blue then
local color = setVehicleHeadLightColor ( theVehicle, red, green, blue )
if(not color) then
outputChatBox( "Failed to change vehicle lights color" )
else
outputChatBox ( "Vehicle lights color changed sucessfully" )
end
else
outputChatBox( "error shit" )
end
end
addCommandHandler ( "cl", changeCarLightsColor )
function onSpawn (zoo,thePlayer)
local theVehicle = getPedOccupiedVehicle ( thePlayer )
local accountData = getAccountData (zoo, "horse")
if (accountData) then
local G = getAccountData (zoo, "rabbit")
local R = getAccountData (zoo, "horse")
local B = getAccountData (zoo, "bear")
outputChatBox("getting data blablashit")
egg1 = G
egg2 = R
egg3 = B
setVehicleHeadLightColor ( theVehicle, egg1, egg2, egg3 )
end
end
addEventHandler ("onPlayerSpawn", getRootElement(), onSpawn)
function onDead ()
account = getPlayerAccount (source)
if (account) then
setAccountData (account, "horse", G)
setAccountData (account, "rabbit", R)
setAccountData (account, "bear", B)
outputChatBox("setting data blabla")
end
end
addEventHandler ("onPlayerWasted", getRootElement(), onDead)
Hello, its me again.. as u know im not very talented scripter and i need your help again >.<
theres command (cl) that changes your carheadlightcolor
i want to make it save like when u set ur carheadlightcolor red then it saves it when u die and when u spawn it restores it
atm im getting waring
Bad arugment @ 'getAccountData'
any fixes ?