GuyFromPast Posted October 2, 2010 Share Posted October 2, 2010 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 ? Link to comment
Castillo Posted October 2, 2010 Share Posted October 2, 2010 hmm you said what error you get but not what LINE is Link to comment
GuyFromPast Posted October 2, 2010 Author Share Posted October 2, 2010 hmm you said what error you get but not what LINE is sorry, 27 Link to comment
Castillo Posted October 2, 2010 Share Posted October 2, 2010 hmm you said what error you get but not what LINE is sorry, 27 what is "zoo"? you must know that getAccountData needs getPlayerAccount also. Link to comment
GuyFromPast Posted October 2, 2010 Author Share Posted October 2, 2010 zoo is current account Link to comment
Castillo Posted October 2, 2010 Share Posted October 2, 2010 zoo is current account thats impossible you are using onPlayerSpawn event right? then how you get an account from nowhere? Link to comment
GuyFromPast Posted October 2, 2010 Author Share Posted October 2, 2010 tried to add source or account there >.< no luck any suggestions what i should add there then ? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now