nikitafloy Posted June 16, 2014 Share Posted June 16, 2014 Not killed timer. Writes the error: bad arg-t destroyElement (setVehiclePlateText too) [Expected at arg 1] function rPlate( veh, sum ) plateSumRas = sum*60*60*1000 plateSum = getTickCount() + plateSumRas timerCheck = setTimer(function() rezoneTimer = plateSum-getTickCount() setVehiclePlateText( veh, tostring(rezoneTimer/60/60/1000) ) if rezoneTimer <= 0 then destroyElement( veh ) setTimer(function() if isTimer( timerCheck ) then killTimer( timerCheck ) end end, 5000, 1 ) end end, 1000, 0, plateSum ) end Link to comment
cheez3d Posted June 16, 2014 Share Posted June 16, 2014 Use local variables. Replace destroyElement(veh) with if isElement(veh) then destroyElement(veh); end; . Link to comment
nikitafloy Posted June 16, 2014 Author Share Posted June 16, 2014 Use local variables.Replace destroyElement(veh) with if isElement(veh) then destroyElement(veh); end; . The last element is not removed, because the timer stops on it. This is a special case. Deleted - not deleted. Thx! 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