Jump to content

What is wrong here?


Dzakub

Recommended Posts

Hi.

I wrote a script changing the vehicle if player is in other vehicle or creating vehicle if player is on foot. But the code does not run. I think i messed up something in If statement. Here is the code:

addCommandHandler ( "sv",
function ( thePlayer, command, newModel )
local theVehicle = getPedOccupiedVehicle ( thePlayer )
       newModel = tonumber ( newModel )                          
if theVehicle and newModel then                          
setElementModel ( theVehicle, newModel )
else if not theVehicle then
local px, py, pz getElementPosition(thePlayer)
local newVehicle = createVehicle(newModel, px, py, pz)
warpPedIntoVehicle ( thePlayer, newVehicle ) 
end
end
)

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