JohnLehn 1 Posted January 21 Share Posted January 21 Hello! I have the code bellow, how can i make it to teleport in vehicle? function sf (source, thePlayer) local adminname = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..adminname, aclGetGroup ( "Admin" ) ) then setElementPosition(thePlayer, -1997.923828125, 171.4658203125, 27.6875) else outputChatBox("No acces!", thePlayer, 255, 0, 0) end end addCommandHandler("gotosf", sf) Link to post
Scripting Moderators NeXuS™ 393 Posted January 21 Scripting Moderators Share Posted January 21 You have to check if the player is in a vehicle, you can use getPedOccupiedVehicle for this. If he is in a vehicle, you set the vehicle's position instead of the player, which is returned by the function mentioned above. Also, your function will throw errors, as "thePlayer" value defined in your function is actually the command name that was executed, in this case "gotosf", check addCommandHandler for more info on this topic. Link to post
Tekken 146 Posted January 21 Share Posted January 21 I think he wants warpPedIntoVehicle, this will teleport a player into a vehicle. Link to post
Hydra 36 Posted January 21 Share Posted January 21 function sf(thePlayer, command) local adminname = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..adminname, aclGetGroup ( "Admin" ) ) then setElementPosition(thePlayer, -1997.923828125, 171.4658203125, 27.6875) warpPedIntoVehicle(thePlayer, theVehicle, 0) else outputChatBox("No acces!", thePlayer, 255, 0, 0) end end addCommandHandler("gotosf", sf) This is how it should look if you want to teleport the player in a vehicle Link to post
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