TheMhmd Posted March 2, 2014 Share Posted March 2, 2014 i wand on player hit marker give car marker1 = createMarker (x,y,z ) addEventHandler(''onClientMarkerHit,root,function () ,marker1 local x, y, z = getElementPosition ( () ) createVehicle ( 432, x, y, z + 10 outputChatBox ( "You got Car'!", () ) and set player in car i know code KFC Link to comment
Karuzo Posted March 2, 2014 Share Posted March 2, 2014 Server-Side. Otherwise he couldn't get it in the created Vehicle(in Client-Side.) btw, why do you get the ElementPosition ? If he gets in the marker hes in the Marker right ? so the position is the on of the Marker. local marker1 = createMarker (x,y,z ) addEventHandler("onMarkerHit",marker1,function (hitElement) local x, y, z = getElementPosition (marker1) local car = createVehicle ( 432, x, y, z + 10 ) warpPedIntoVehicle(hitElement,car) outputChatBox ( "You got a Car'!",hitElement,0,255,0) end) Link to comment
cheez3d Posted March 2, 2014 Share Posted March 2, 2014 local marker = createMarker(someX,someY,someZ) addEventHandler("onMarkerHit",marker,function(element,dimension) if getElementType(element) == "player" and getElementDimension(element) == dimension and not isPedInVehicle(element) then local x,y,z = getElementPosition(marker) local vehicle = createVehicle(432,x,y,z) warpPedIntoVehicle(element,vehicle,0) outputChatBox("You received a car!",element) end end) Link to comment
Recommended Posts