capitanazop Posted June 7, 2008 Posted June 7, 2008 hi i have a problem whit my teleport cmd. i wanna teleport with my car but i can execute the cmd if i stay in a vehicle =S. this is the cmd. function drift ( hitPlayer, commandName, posX, posY, posZ, player ) setElementPosition ( hitPlayer,-759.8561,-240.8489,51.8462) end addCommandHandler ( "drift", drift ) if i dont have vehicle run perfectly they have no erros. why is the problem? bye and sorry for my english
DiSaMe Posted June 7, 2008 Posted June 7, 2008 Store player's vehicle into a variable and then set its position.
capitanazop Posted June 7, 2008 Author Posted June 7, 2008 Store player's vehicle into a variable and then set its position. you can post a example plz ?
Morelli Posted June 8, 2008 Posted June 8, 2008 Read Ace_Gambit's post on the top of page 3 of the below thread. viewtopic.php?f=91&t=22800&st=0&sk=t&sd=a&hilit=teleport&start=30
capitanazop Posted June 11, 2008 Author Posted June 11, 2008 sorry for double posting but i can fix this error and i tried with the ace_gabit function but get multiply errors X_X plz can somebody help me? bye and thanks for read
DiSaMe Posted June 11, 2008 Posted June 11, 2008 Try this: function drift ( hitPlayer, commandName) if isPlayerInVehicle (hitPlayer) then setElementPosition (getPlayerOccupiedVehicle (hitPlayer),-759.8561,-240.8489,51.8462) else setElementPosition ( hitPlayer,-759.8561,-240.8489,51.8462) end end addCommandHandler ( "drift", drift ) I didn't test it, but it looks like fine to me. As you can see, script checks if player is driving, if he is, then vehicle he is in is put into that place. Also, I removed posX, posY, posZ, player arguments from the function because they're unused
capitanazop Posted June 11, 2008 Author Posted June 11, 2008 Try this: function drift ( hitPlayer, commandName) if isPlayerInVehicle (hitPlayer) then setElementPosition (getPlayerOccupiedVehicle (hitPlayer),-759.8561,-240.8489,51.8462) else setElementPosition ( hitPlayer,-759.8561,-240.8489,51.8462) end end addCommandHandler ( "drift", drift ) I didn't test it, but it looks like fine to me. As you can see, script checks if player is driving, if he is, then vehicle he is in is put into that place. Also, I removed posX, posY, posZ, player arguments from the function because they're unused Thanks man Works! the problem is if you are in a bike you fall but y know how fix setting player un nokable off bike. relly man you save my life
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now