Jump to content

Destroy a vehicle Need Someone Pro!


Price.

Recommended Posts

Posted (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 by Guest

YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID

Posted

guys blip is fixed but i need proper code to get the vehicle destroyed when i log out or reconnect

YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID

Posted

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 .

YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID

Posted

i've tried this code but didnt work also

addEventHandler ( 'onPlayerQuit', root, function ( )

if ( isElement ( theVehicle )) then

destroyElement ( theVehicle )

end

end )

YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID

Posted

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 
  

YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID

Posted

If anyone would tell me the code to make a gui and to join criminal team auto would be find guys

YOU HAVE TO TRUST SOMEONE TO BE BETRAYED.I NEVER DID

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...