How to make timers in Client Side. NewTimer doesn't exist in Client Side.
How to delete a timer in both server side and client side.
Off-topic: Where did vitogta go?
I use this https://forum.vc-mp.org/?topic=2748.0
Suppose there is a timer
Timer.Create(this, abc, 1000, 0)
How to identify this timer? How to see that it exists or not? How to destroy this timer?
function Script::ScriptLoad()
{
local hash = Timer.Create(this, function(text, int) {
Console.Print(text + int);
}, 1000, 0, "Timer Text ", 12345);
Console.Print(hash);
if(Timer.Exists(hash)){
//...
}
Timer.Destroy(hash);
}
Quote from: vitogta on Jun 08, 2018, 09:20 PMfunction Script::ScriptLoad()
{
local hash = Timer.Create(this, function(text, int) {
Console.Print(text + int);
}, 1000, 0, "Timer Text ", 12345);
Console.Print(hash);
if(Timer.Exists(hash)){
//...
}
Timer.Destroy(hash);
}
Means I need to record the hash of player and then delete it using the hash.
Just store the timer inside a variable and delete it when you want to.
Bro the easiet way is just name the timer in onscriptload
Ex
T1=NewTimer..........
And then when u want to remove it just so
T1. Delete()
Quote from: [KM]Helathien on Jun 22, 2018, 08:44 AMBro the easiet way is just name the timer in onscriptload
Ex
T1=NewTimer..........
And then when u want to remove it just so
T1. Delete()
Already solved man! Dont bump these topics.