Sign in to follow this  

The function is activated twice

Recommended Posts


The function is activated twice, that is, when I go in my vehicle with a person sitting as a companion, when you get to the marker, you activate all the functions when you step on it, even though you do not see the marker or everything the function includes, Does anyone know how to solve it?


--Client Side - Example

addEventHandler("onClientGUIClick", guiRoot,    
				addEventHandler( "onClientMarkerHit", Marker, First )				
				Bla bla bla

function First ()
	if timer then killTimer(timer) timer = nil end 

	 veh = getPedOccupiedVehicle( localPlayer )
			if veh then
   setElementFrozen ( veh, true )
	Outputchatbox ("Example")  --This is printed twice when there is a passenger in the vehicle

	setTimer (PreFuncParada, 1500, 1, pia)

end end 


Share this post

Link to post



Thank you for your collaboration! I was able to solve it with: @Simple.

if source == localPlayer then 


Edited by Lormateve
  • Like 1

Share this post

Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.