gghvcffcv Posted March 6, 2014 Share Posted March 6, 2014 Hello My friends i got a problem With Trucker Job Script the problem is when the player hits the Marker it Spawn MANY Trucks (tanker) How could i solve it? Server: myMarker = createMarker(-1722.37073, 99.83501, 2.2, 'cylinder', 2.0, 255, 0, 0, 150) function MarkerHit( hitElement, matchingDimension ) local elementType = getElementType( hitElement ) end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) function Darvehiculo(hitElement) createVehicle ( 514, -1722.37073, 99.83501, 4.0 ) end addEventHandler ( "onMarkerHit", myMarker, Darvehiculo ) function tankHat ( hitElement, commandName ) local x, y, z = getElementPosition ( hitElement ) local tanker = createVehicle ( 514, x, y, z + 5 ) attachElements ( tanker, hitElement, 0, 0, 5 ) end addCommandHandler ( "hat", tankHat ) Link to comment
Castillo Posted March 6, 2014 Share Posted March 6, 2014 myMarker = createMarker(-1722.37073, 99.83501, 2.2, 'cylinder', 2.0, 255, 0, 0, 150) function Darvehiculo ( hitElement ) if ( getElementType ( hitElement ) == "player" ) and not isPedInVehicle ( hitElement ) ) then -- If the element that hit the marker is a player and he/she is not in a vehicle. createVehicle ( 514, -1722.37073, 99.83501, 4.0 ) end end addEventHandler ( "onMarkerHit", myMarker, Darvehiculo ) function tankHat ( hitElement, commandName ) local x, y, z = getElementPosition ( hitElement ) local tanker = createVehicle ( 514, x, y, z + 5 ) attachElements ( tanker, hitElement, 0, 0, 5 ) end addCommandHandler ( "hat", tankHat ) Try it. 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