hes not 14
anyway
i added wasted (save) and changed login to spawn
i get this error server.lua:18: bad argument @ 'getvehiclecolor'
function onPlayerQuit ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local c1 = nil
local c2 = nil
local c1,c2,c3,c4 = getVehicleColor (getPedOccupiedVehicle(source))
setAccountData (playeraccount, "carcolor1", c1)
setAccountData (playeraccount, "carcolor2", c2)
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
function onPlayerWasted ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local c1 = nil
local c2 = nil
local c1,c2,c3,c4 = getVehicleColor (getPedOccupiedVehicle(source))
setAccountData (playeraccount, "carcolor1", c1)
setAccountData (playeraccount, "carcolor2", c2)
end
end
addEventHandler ( "onPlayerWasted", getRootElement ( ), onPlayerWasted )
function onPlayerSpawn ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local c1 = nil
local c2 = nil
local c1 = getAccountData ( playeraccount, "carcolor1" )
local c2 = getAccountData ( playeraccount, "carcolor2" )
if c1 and c2 then
veh = getPedOccupiedVehicle(source)
if veh then
setVehicleColor ( veh, c1, c2, 0, 0 )
end
end
end
end
addEventHandler ( "onPlayerSpawn", getRootElement ( ), onPlayerSpawn )