Jump to content

HELP PRIVATE CAR ON COMMAND


DeathMta

Recommended Posts

function AutoDeath ( player ) 
if getElementType ( thePlayer ) == "player" then 
local cuenta = getPlayerAccount( player ) 
local x, y, z = getElementPosition(player) 
local accountName = ( cuenta and getAccountName ( cuenta ) or "" ) 
            if not( accountName == "123") then 
      vehiculo = createVehicle(422, x + 5, y, z) 
      Interior = createColSphere(x + 5, y, z, 4) 
      attachElements(Interior, vehiculo, 0, 0, 0) 
      setElementData(Interior, "parent", vehiculo) 
      setElementData(vehiculo, "parent", Interior) 
      setElementData(Interior, "vehicle", true) 
      setElementData(Interior, "MAX_Slots", 20) 
      setElementData(Interior, "Tire_inVehicle", 4) 
      setElementData(Interior, "Engine_inVehicle", 1) 
      setElementData(Interior, "Parts_inVehicle", 1) 
      setElementData(Interior, "fuel", 80)   
         
        outputChatBox("[Death]:Te Has Equipado",player,84, 84, 84,true) 
    else 
 outputChatBox("No Eres Death Para Usar Este Comando",player,84,84,84,true) 
end 
end 
end 
addCommandHandler("death1",AutoDeath) 

Link to comment

The function's first argument is clearly 'player', yet you're using thePlayer.

if getElementType ( player ) == "player" then 

Then the logic issue, this is a command handler, vehicles can't execute commands, or any other non-player element type for that matter. So, you don't need to check for the type because it will always be a player.

Link to comment

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...