Jump to content

function argument


Monty

Recommended Posts

Posted

what's wrong?

    function spawnVehP(id) 
    theTeam = getPlayerTeam( source ) 
    theTeamName = getTeamName( theTeam ) 
    if ( theTeamName == "police" ) or ( theTeamName == "FBI" ) then 
        local x, y, z = getElementPosition(source) 
        if isElement(vehicles[source]) then destroyElement(vehicles[source]) end 
        vehicles[source] = createVehicle(id, x + 1, y, z) 
        warpPedIntoVehicle(source, vehicles[source]) 
        else 
        outoutChatBox("Only police agents and FBI can get free vehicles from here!", source, 255, 0, 0) 
        end 
    end 
    addEvent("CreVehiceP",true) 
    addEventHandler("CreVehiceP", root, spawnVehP) 
      

Guest Guest4401
Posted

1. /debugscript 3

2. Spelling mistake:

outoutChatBox

3. Make sure that vehicles is a table.

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