carvalhosgamer Posted May 15, 2014 Share Posted May 15, 2014 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
justn Posted May 15, 2014 Share Posted May 15, 2014 Instead of destroying the element, I think you should use 'setElementVisibleTo' (Which is a server-sided function) and remove the event handler when the player hits the marker. Link to comment
carvalhosgamer Posted May 15, 2014 Author Share Posted May 15, 2014 wow, Great suggestion, I did not think about i'll Try This! Thank You! Link to comment
carvalhosgamer Posted May 16, 2014 Author Share Posted May 16, 2014 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
justn Posted May 16, 2014 Share Posted May 16, 2014 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
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