Reggae Posted March 23, 2014 Posted March 23, 2014 addCommandHandler("comprar",function(player) setTimer ( function() givePlayerMoney (player, 25000 ) end, 5000, 0 ) end addCommandHandler("vender",function(player) end I can not post the entire script. But I want to know what you want I can use to stop the SetTimer so the player type /vender. I want to stop the SetTimer WHAT can I use? excuse my bad english I'm Brazilian
WhoAmI Posted March 23, 2014 Posted March 23, 2014 Just put timer into variable and then destroyElement ( some_variable )
cheez3d Posted March 23, 2014 Posted March 23, 2014 Just put timer into variable and then destroyElement ( some_variable ) setTimer returns a timer pointer, not an element. killTimer()
Reggae Posted March 23, 2014 Author Posted March 23, 2014 and how I apply my script KillTimer? I want to put in KillTimer addCommandHandler function ("sell", function (player)
WhoAmI Posted March 23, 2014 Posted March 23, 2014 addCommandHandler("comprar",function(player) timer = setTimer ( function() givePlayerMoney (player, 25000 ) end, 5000, 0 ) end addCommandHandler("vender",function(player) killTimer ( timer ) end
Mr_Moose Posted March 24, 2014 Posted March 24, 2014 addCommandHandler("vender",function(player) if isTimer( timer ) then killTimer ( timer ) end end Always good to verify that something you are trying to delete actually exist
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