Jump to content

createvehicle problem


KaMeR

Recommended Posts

why when vehicle is created cant destroy him and is locked??? :?

function scriptCreateVoo ( commandName ) 
  
      local localPlayer = getLocalPlayer ( ) 
      local x, y, z = getElementPosition ( localPlayer ) 
      createVehicle ( 412, x + 5, y, z + 1 ) 
end 
addCommandHandler ( "voo", scriptCreateVoo ) 

Link to comment
why when vehicle is created cant destroy him and is locked??? :?
function scriptCreateVoo ( commandName ) 
  
      local localPlayer = getLocalPlayer ( ) 
      local x, y, z = getElementPosition ( localPlayer ) 
      createVehicle ( 412, x + 5, y, z + 1 ) 
end 
addCommandHandler ( "voo", scriptCreateVoo ) 

As far as I can see you did not post the code you have to destroy a vehicle... what are you trying to destroy it?

Link to comment

Assuming this is a client-side script (server-side scripts do not support getLocalPlayer() ), then

the script contains no errors.

Seeing that the vehicle really did spawn, but cannot be used/destroyed... I think the problem might lie on the server's end.

Perhaps the vehicle is only created client-side? (not sure how createVehicle() behaves in a client-side script, I always use it server-side) That would explain why the server can't interact with it..

Another thing can be that another script destroys the vehicle directly when it spawned (but not visually removing it)

Either way, if this is a client-side script I see no errors in it.

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