Jump to content

[HELP] Marker System Destroy


Recommended Posts

Hello Guys, I'm trying to do a Bus Driver Job, but I Have a big problem, like this:

I Wannna make the local Player destroy own marker, but when I pass over of the marker, the marker of the other guy is gone too!

Check this example!

  
Cliente Side 
localPlayer = getLocalPlayer() 
  
function Job() 
 bus1 = createMarker(1234, -1845,15, "checkpoint", 4.0, 0, 0, 255, 255) 
 blip = createBlipAttachedTo( bus1, 41 ) 
addEventHandler("onClientMarkerHit", bus1, BusJob) 
end 
  
fuction BusJob(hitPlayer) 
 if hitPlayer == localPlayer then 
   if isElement(trampobus1) then     
      destroyElement(bus1)  
   end 
end 
end 
  

Sorry, my english is not too good, but i hope to explain my problem

Thank You Very Much!!!

Link to comment

I Did, Works very well, but if you can help me one more thing about (if/else) so, I need test if only bus vehicle touch the marker, not other car and without car, just bus vehicle 431, i've been tried like

  
bus1Ids = { [431]=true } 
bus= createVehicle( 431, 1270, -1816, 13.5, 0,0, 175) 
// 
if (bus1Ids [getElementModel ( source )] ) then 
  touch the marker 
end 
  

but, its not work, please help me

thanks!

Link to comment
bus = createVehicle( 431, 1270, -1816, 13.5, 0,0, 175) 
  
addEventHandler("onMarkerHit",marker, 
function(player) 
if isPedInVehicle(player) then 
local OccupiedVeh = getPedOccupiedVehicle(player) 
if ( OccupiedVeh ) then 
if getElementModel(OccupiedVeh) == 431 then 
-- YOUR CODE HERE 
end 
end 
end 
end) 

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...