solidsnake14 made this ones
function onPlayerQuit ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local r, g, b = getPlayerNametagColor ( source )
setAccountData ( playeraccount, "ColorRed", r )
setAccountData ( playeraccount, "ColorGreen", g )
setAccountData ( playeraccount, "ColorBlue", b )
end
end
function onPlayerLogin ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local tagColorRed = getAccountData ( playeraccount, "ColorRed" )
local tagColorGreen = getAccountData ( playeraccount, "ColorGreen" )
local tagColorBlue = getAccountData ( playeraccount, "ColorBlue" )
if tagColorRed and tagColorGreen and tagColorBlue then
setPlayerNametagColor ( source, tagColorRed, tagColorGreen, tagColorBlue )
end
end
end
function onPlayerSpawn ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local tagColorRed = getAccountData ( playeraccount, "ColorRed" )
local tagColorGreen = getAccountData ( playeraccount, "ColorGreen" )
local tagColorBlue = getAccountData ( playeraccount, "ColorBlue" )
if tagColorRed and tagColorGreen and tagColorBlue then
setPlayerNametagColor ( source, tagColorRed, tagColorGreen, tagColorBlue )
end
end
end
function onPlayerWasted ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local r, g, b = getPlayerNametagColor ( source )
setAccountData ( playeraccount, "ColorRed", r )
setAccountData ( playeraccount, "ColorGreen", g )
setAccountData ( playeraccount, "ColorBlue", b )
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
addEventHandler ( "onPlayerWasted", getRootElement ( ), onPlayerWasted )
addEventHandler ( "onPlayerSpawn", getRootElement ( ), onPlayerSpawn )
AND i was making kinda the same but then saving car colors 1-2
function onPlayerQuit ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local r, g, b = getVehicleColor ( source )
setAccountData ( playeraccount, "vehColorRed", r )
setAccountData ( playeraccount, "vehColorGreen", g )
setAccountData ( playeraccount, "vehColorBlue", b )
end
end
function onPlayerLogin ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local vehColorRed = getAccountData ( playeraccount, "ColorRed" )
local vehColorGreen = getAccountData ( playeraccount, "ColorGreen" )
local vehColorBlue = getAccountData ( playeraccount, "ColorBlue" )
if vehColorRed and vehColorGreen and vehColorBlue then
setVehicleColor ( source, vehColorRed, vehColorGreen, vehColorBlue )
end
end
end
function onPlayerSpawn ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local vehColorRed = getAccountData ( playeraccount, "ColorRed" )
local vehColorGreen = getAccountData ( playeraccount, "ColorGreen" )
local vehColorBlue = getAccountData ( playeraccount, "ColorBlue" )
if vehColorRed and vehColorGreen and vehColorBlue then
setVehicleColor ( source, vehColorRed, vehColorGreen, vehColorBlue )
end
end
end
function onPlayerWasted ( )
local playeraccount = getPlayerAccount ( source )
if ( playeraccount ) then
local r, g, b = getVehicleColor ( source )
setAccountData ( playeraccount, "vehColorRed", r )
setAccountData ( playeraccount, "vehColorGreen", g )
setAccountData ( playeraccount, "vehColorBlue", b )
end
end
addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit )
addEventHandler ( "onPlayerLogin", getRootElement ( ), onPlayerLogin )
addEventHandler ( "onPlayerWasted", getRootElement ( ), onPlayerWasted )
addEventHandler ( "onPlayerSpawn", getRootElement ( ), onPlayerSpawn )
but its not working it gives the error bad eventhandler (no lines or anything)
can anyone help, because tag color and veh color may not overwrite each other
if soeone dies i get this error
warning: 30-38: bad argument @ setvehiclecolor