murilo2929 Posted July 11, 2019 Share Posted July 11, 2019 function autoescola() triggerServerEvent("TeoriaCompleta", getLocalPlayer()) local x, y, z = testRoute[1][1], testRoute[1][2], testRoute[1][3] blip = createBlip(x, y, z, 0, 2, 0, 255, 0, 255) marker = createMarker(x, y, z, "checkpoint", 4, 0, 255, 0, 150) addEventHandler("onClientMarkerHit", marker, comecarautoescola) outputChatBox("#FF9933You are ready for the practical test. Take a DoL training machine and follow the route..", 255, 194, 14, true) end I would like that after appearing the message saying that it is ready for the practical test, the player was spawn automatically with a car in this position =(1090.815,-1769.211, 13.352) How i can do this? Link to comment
WorthlessCynomys Posted July 11, 2019 Share Posted July 11, 2019 Hy! createVehicle() setElementPosition() warpPedIntoVehicle() 1 Link to comment
HassoN Posted July 11, 2019 Share Posted July 11, 2019 Use: createVehicle -- create the vehicle warpPedIntoVehicle -- warp player into the vehicle. 1 Link to comment
murilo2929 Posted July 11, 2019 Author Share Posted July 11, 2019 1 hour ago, WorthlessCynomys said: Hy! createVehicle() setElementPosition() warpPedIntoVehicle() function autoescola() triggerServerEvent("TeoriaCompleta", getLocalPlayer()) local x, y, z = testRoute[1][1], testRoute[1][2], testRoute[1][3] blip = createBlip(x, y, z, 0, 2, 0, 255, 0, 255) marker = createMarker(x, y, z, "checkpoint", 4, 0, 255, 0, 150) addEventHandler("onClientMarkerHit", marker, comecarautoescola) outputChatBox("#FF9933You are ready for the practical test. Take a DoL training machine and follow the route..", 255, 194, 14, true) local test = createVehicle(410, 1090.815, -1769.211, 13.352) warpPedIntoVehicle ( getLocalPlayer, test ) end so I used this command and the car is being created but the player is not set in it, remembering that I am in different dimension and interior. Link to comment
WorthlessCynomys Posted July 11, 2019 Share Posted July 11, 2019 Just now, murilo2929 said: function autoescola() triggerServerEvent("TeoriaCompleta", getLocalPlayer()) local x, y, z = testRoute[1][1], testRoute[1][2], testRoute[1][3] blip = createBlip(x, y, z, 0, 2, 0, 255, 0, 255) marker = createMarker(x, y, z, "checkpoint", 4, 0, 255, 0, 150) addEventHandler("onClientMarkerHit", marker, comecarautoescola) outputChatBox("#FF9933You are ready for the practical test. Take a DoL training machine and follow the route..", 255, 194, 14, true) local test = createVehicle(410, 1090.815, -1769.211, 13.352) warpPedIntoVehicle ( getLocalPlayer, test ) end so I used this command and the car is being created but the player is not set in it, remembering that I am in different dimension and interior. Then you should set the interior and dimension for the player or the vehicle before you warp the player into the new vehicle. setElementInterior() setElementDimension() -- You can get the interior/dimension of an element with: getElementInterior() getElementDimension() Link to comment
murilo2929 Posted July 11, 2019 Author Share Posted July 11, 2019 2 minutes ago, WorthlessCynomys said: Then you should set the interior and dimension for the player or the vehicle before you warp the player into the new vehicle. setElementInterior() setElementDimension() -- You can get the interior/dimension of an element with: getElementInterior() getElementDimension() function autoescola() triggerServerEvent("TeoriaCompleta", getLocalPlayer()) local x, y, z = testRoute[1][1], testRoute[1][2], testRoute[1][3] blip = createBlip(x, y, z, 0, 2, 0, 255, 0, 255) marker = createMarker(x, y, z, "checkpoint", 4, 0, 255, 0, 150) addEventHandler("onClientMarkerHit", marker, comecarautoescola) outputChatBox("#FF9933You are ready for the practical test. Take a DoL training machine and follow the route..", 255, 194, 14, true) local test = createVehicle(410, 1090.815, -1769.211, 13.352) setElementDimension ( getLocalPlayer, 0 ) setElementInterior ( getLocalPlayer, 0 ) warpPedIntoVehicle ( getLocalPlayer, test ) end i make like that, and don't work, what is wrong? Link to comment
WorthlessCynomys Posted July 11, 2019 Share Posted July 11, 2019 Just now, murilo2929 said: function autoescola() triggerServerEvent("TeoriaCompleta", getLocalPlayer()) local x, y, z = testRoute[1][1], testRoute[1][2], testRoute[1][3] blip = createBlip(x, y, z, 0, 2, 0, 255, 0, 255) marker = createMarker(x, y, z, "checkpoint", 4, 0, 255, 0, 150) addEventHandler("onClientMarkerHit", marker, comecarautoescola) outputChatBox("#FF9933You are ready for the practical test. Take a DoL training machine and follow the route..", 255, 194, 14, true) local test = createVehicle(410, 1090.815, -1769.211, 13.352) setElementDimension ( getLocalPlayer, 0 ) setElementInterior ( getLocalPlayer, 0 ) warpPedIntoVehicle ( getLocalPlayer, test ) end i make like that, and don't work, what is wrong? The creation of the vehicle, the dimension and interior change and the warp has to happen on server-side! Link to comment
murilo2929 Posted July 11, 2019 Author Share Posted July 11, 2019 2 minutes ago, WorthlessCynomys said: The creation of the vehicle, the dimension and interior change and the warp has to happen on server-side! i'm doing in client-side, how i can do that in server-side? thanks for helping. Link to comment
WorthlessCynomys Posted July 11, 2019 Share Posted July 11, 2019 Just now, murilo2929 said: i'm doing in client-side, how i can do that in server-side? thanks for helping. You use the triggerServerEvent as above and catch the call on server-side, then you do the same as on client-side, only that you're on server-side now. Link to comment
murilo2929 Posted July 11, 2019 Author Share Posted July 11, 2019 20 minutes ago, WorthlessCynomys said: You use the triggerServerEvent as above and catch the call on server-side, then you do the same as on client-side, only that you're on server-side now. I put only in server-side and work, thanks alot 30 minutes ago, WorthlessCynomys said: You use the triggerServerEvent as above and catch the call on server-side, then you do the same as on client-side, only that you're on server-side now. One question, how i can make to when player hit marker the vehicle destroy? Link to comment
HassoN Posted July 11, 2019 Share Posted July 11, 2019 1 hour ago, murilo2929 said: I put only in server-side and work, thanks alot One question, how i can make to when player hit marker the vehicle destroy? Use addEventHandler -- "onPlayerMarkerHit" getPedOccupiedVehicle destroyElement Link to comment
murilo2929 Posted July 11, 2019 Author Share Posted July 11, 2019 3 minutes ago, HassoN said: Use addEventHandler -- "onPlayerMarkerHit" getPedOccupiedVehicle destroyElement i use getElementModel (theVehicle) destroyElement(theVehicle) and it worked, thanks anyway. Link to comment
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