Lloyd Logan Posted January 23, 2013 Share Posted January 23, 2013 Hey, I want it so that when the player enters the marker it warps the Created ped into the vehicle? client pickPed = createMarker(1790.33105, -1909.81689, 13.03162, "cylinder", 1.5, 255, 0, 0) function warpit() triggerServerEvent("doIt", source, "pickPed") end addEventHandler("onClientMarkerHit", root, warpit) server createMarker(1777.95203, -1892.48059, 12.38782, "cylinder", 0.9, 255, 0, 0) taxiPed = createPed(252, 1789.95386, -1910.94507, 13.03228) taxiVeh = createVehicle(420, 1777.95203, -1892.48059, 12.38782) function pickPed() warpPedIntoVehicle( taxiPed, taxiVeh, 2) end addEvent("doIt", true) addEventHandler("doIt", root, pickPed) If it it possible, could you make it so that the ped is warped in the current vehicle the player is in? Instead of the createVeh? Link to comment
Castillo Posted January 23, 2013 Share Posted January 23, 2013 -- client side: pickPed = createMarker(1790.33105, -1909.81689, 13.03162, "cylinder", 1.5, 255, 0, 0) function warpit ( hitElement ) if ( hitElement == localPlayer ) then triggerServerEvent ( "doIt", localPlayer ) end end addEventHandler ( "onClientMarkerHit", root, warpit ) -- server side: createMarker(1777.95203, -1892.48059, 12.38782, "cylinder", 0.9, 255, 0, 0) taxiPed = createPed(252, 1789.95386, -1910.94507, 13.03228) taxiVeh = createVehicle(420, 1777.95203, -1892.48059, 12.38782) function pickPed ( ) local vehicle = getPedOccupiedVehicle ( source ) if ( vehicle ) then warpPedIntoVehicle ( taxiPed, vehicle, 2 ) end end addEvent ( "doIt", true ) addEventHandler ( "doIt", root, pickPed ) Link to comment
Lloyd Logan Posted January 23, 2013 Author Share Posted January 23, 2013 Thanks Alot, Castillo!! Link to comment
Lloyd Logan Posted January 23, 2013 Author Share Posted January 23, 2013 You're welcome. Sorry, Castillo, when I hit any marker, the ped is warped into the Veh, how would i make it so that the ped is only warped when it hits that client side marker? Link to comment
Castillo Posted January 23, 2013 Share Posted January 23, 2013 Change: addEventHandler ( "onClientMarkerHit", root, warpit ) To: addEventHandler ( "onClientMarkerHit", pickPed, warpit ) Link to comment
Lloyd Logan Posted January 23, 2013 Author Share Posted January 23, 2013 Change: addEventHandler ( "onClientMarkerHit", root, warpit ) To: addEventHandler ( "onClientMarkerHit", pickPed, warpit ) Thank you!! Sorry about this but as a general question, how can I delete/erase a ped? Link to comment
Lloyd Logan Posted January 23, 2013 Author Share Posted January 23, 2013 destroyElement Thanks!! 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