01.04.2015, 15:24
If you're using the textdraw globally, which it looks like, there's no need to use SetTimerEx.
Here's an example to set up your timer:
Where you display the textdraw, start the timer
"MyPublic" - The public the timer will call when it ends
4000 - The time it takes before the public is called
false - A boolean(true/false) if the timer should repeat or not, we don't want it to repeat, just be called once, so we use false
Now the public:
If you only have the textdraw for 1 person at a time, you should use [playerid] on your variable, as well as SetTimerEx.
If you're using it for a cmd etc:
/welcomeall
Loop through all players and show the textdraw
Then just set the public up like in the example.
Here's an example to set up your timer:
Where you display the textdraw, start the timer
pawn Код:
SetTimer("MyPublic", 4000, false);
4000 - The time it takes before the public is called
false - A boolean(true/false) if the timer should repeat or not, we don't want it to repeat, just be called once, so we use false
Now the public:
pawn Код:
forward MyPublic(); // When creating a public function, you always need to forward it
public MyPublic() // The public the timer will call, any code under the public will be executed when the timer ends
{
foreach(new i: Player) // Loop through all players, assuming you have the textdraw globally for all players
{
TextDrawHideForPlayer(i, Textdraw0); // Hide the textdraw for all players, "i"
}
}
If you're using it for a cmd etc:
/welcomeall
Loop through all players and show the textdraw
Then just set the public up like in the example.