Price. Posted September 16, 2013 Posted September 16, 2013 (edited) Guys i need a little help when i reconnect gives me this error 56:Bad Argument @ 'getElementData' [Expected element at argument 1 ,got nill] 58:Bad Argument @ 'destroyerElement' [Expected element at argument 1 ,got nill] the function: function playerQuit() local playerAcc = getPlayerAccount(source) if ( playerAcc ) then getElementData(theVehicle,"destroyed") getElementData(thePlayer,"destroyed") destroyElement(theVehicle) destroyElement(vehicleToStealBlip) end end addEventHandler("onPlayerQuit", getRootElement(), playerQuit) addEventHandler("onPlayerLogout", getRootElement(), playerQuit) i want him, when he joins the blip is destroyed and the vehicle is destroyed too but only blip gets destroyed EDIT: i've removed getElementData(theVehicle,"destroyed") getElementData(thePlayer,"destroyed") Now tells me 56:Bad argument @ 'destroyerElement' [Expected element at argument 1, got nill] Edited September 18, 2013 by Guest
Price. Posted September 17, 2013 Author Posted September 17, 2013 guys blip is fixed but i need proper code to get the vehicle destroyed when i log out or reconnect
Price. Posted September 17, 2013 Author Posted September 17, 2013 idk but i just need the code to get the vehicle destroyed when i quit no errors atm but i need code to make vehicle destroyed when i log out .
Price. Posted September 17, 2013 Author Posted September 17, 2013 omg it ain't that hard i need help in destroying a vehicle when i log out !!!!
isa_Khamdan Posted September 17, 2013 Posted September 17, 2013 omg it ain't that hard i need help in destroying a vehicle when i log out !!!! Use onPlayerLogout or Quit , getPedOccupiedVehicle and DestroyElement It's easy and simple
Price. Posted September 17, 2013 Author Posted September 17, 2013 i've tried this code but didnt work also addEventHandler ( 'onPlayerQuit', root, function ( ) if ( isElement ( theVehicle )) then destroyElement ( theVehicle ) end end )
Price. Posted September 17, 2013 Author Posted September 17, 2013 here is the vehicle defination: local theVehicle = getPedOccupiedVehicle ( thePlayer ) if (theVehicle) then local vehicleData = getElementData(theVehicle,"destroyed") local playerData = getElementData(thePlayer,"destroyed") if (vehicleData == 1) and (playerData == 1) then destroyElement(theVehicle) destroyElement(vehicleToStealBlip) givePlayerMoney(thePlayer, math.random(1000,1500)) setElementData(thePlayer, "destroyed", 0) end
Price. Posted September 18, 2013 Author Posted September 18, 2013 If anyone would tell me the code to make a gui and to join criminal team auto would be find guys
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