Death Posted March 1, 2015 Share Posted March 1, 2015 local pre_ataque[zona] = setTimer(function() if iniciando[zona] <= 100 then iniciando[zona] = members_in_turf[team][zona] + iniciando[zona] else Atacar(thePlayer,zona,group,gang) end end,500,0) function tester(thePlayer,zona) local gang = getPlayerTeam(thePlayer) local team = getTeamName(gang) local timerr[thePlayer] = setTimer(function() triggerClientEvent(thePlayer, "onPreAtaque", thePlayer, iniciando[zona], zona) end,500,0) end function Atacar(thePlayer,zona,group,gang) zoned = zona outputChatBox (zoned) killTimer(iniciando[zoned]) killTimer(timerr[thePlayer]) triggerClientEvent(thePlayer, "onIniciarAtaque", thePlayer, zoned) end Link to comment
Et-win Posted March 1, 2015 Share Posted March 1, 2015 Any errors? Which one doesn't work? Link to comment
Death Posted March 1, 2015 Author Share Posted March 1, 2015 Bad argument @ 'killTimer' [Expected lua-timer at argument 1] Bad argument @ 'killTimer' [Expected lua-timer at argument 1, got number '101'] two killtimer not work Link to comment
Enargy, Posted March 2, 2015 Share Posted March 2, 2015 Try removing 'thePlayer' from timerr[thePlayer] Link to comment
Moderators IIYAMA Posted March 2, 2015 Moderators Share Posted March 2, 2015 if isTimer(iniciando[zoned]) then killTimer(iniciando[zoned]) end iniciando[zoned]= nil -- clean up You can't kill a timer which doesn't exist any more. Link to comment
Death Posted March 2, 2015 Author Share Posted March 2, 2015 resolved. I was trying to kill a variable instead of the timer. hugs 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