Jump to content

please help me out "hit marker by ped not player"


iiv03

Recommended Posts

hello I would like to know how should I check if ped while inside a car and touched marker and then something happens?

I used these functions in the client side because at beginning i put it if the player touched the marker and then do movement Vehicle Ped, and now I would like to know how to check if the ped hit marker something happens?

createPed
createVehicle
warpPedIntoVehicle
setPedAnalogControlState

client side:

teleport_part = createMarker(-757.400390625, 109.099609375, 41.400001525879,"corona",4,0,0,0,0)

function parts()
pedveh1 = createPed(0,0,0,0,0)
warpPedIntoVehicle(pedveh1,botvehicle1)
setPedAnalogControlState(pedveh1, "accelerate", 1)

pedveh2 = createPed(0,0,0,0,0)
warpPedIntoVehicle(pedveh2,botvehicle2)
setPedAnalogControlState(pedveh2, "accelerate", 1)

pedveh3 = createPed(0,0,0,0,0)
warpPedIntoVehicle(pedveh3,botvehicle3)
setPedAnalogControlState(pedveh3, "accelerate", 1)

pedveh4 = createPed(0,0,0,0,0)
warpPedIntoVehicle(pedveh4,botvehicle4)
setPedAnalogControlState(pedveh4, "accelerate", 1)
end
addEventHandler ( "onClientMarkerHit", teleport_part, parts)

do i need to use event "onMarkerHit"? + function "getPedOccupiedVehicle"? in server side how do I know vehicles in getPedOccupiedVehicle because I put them on a client side path. do I need to use the triggerClientEvent, how i do way?

Edited by xFabel
add my line
Link to comment
2 hours ago, Furzy said:



if getElementType ( yourPed ) == "ped" then
  

Use this to check if the element is a ped.

i know but have u see my question down?

 

tried it on onClientMarkerHit nothing happen does it mean only works with onMarkerHit?

Edited by xFabel
Link to comment
3 minutes ago, xFabel said:

i know but have u see my question down?

 

tried it on onClientMarkerHit nothing happen does it mean only works with onMarkerHit?

Yeah, if u read the wiki you'll see that onClientMarkerHit is for players not element at all

Link to comment
Just now, Furzy said:

Yeah, if u read the wiki you'll see that onClientMarkerHit is for players not element at all

I switched everything on the server side, but is there function to let ped move a car ? such as setPedAnalogControlState :((

Link to comment
4 minutes ago, xFabel said:

I switched everything on the server side, but is there function to let ped move a car ? such as setPedAnalogControlState :((

You can use triggers or create an ElementData in server side to check if peds hit marker and then start the client side function.

  • Like 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...