18.02.2015, 08:31
You could create a command that shows a textdraw, and sets a variable to 10:
Then a timer, to decrease the variable by 1 each second, and updates the textdraw:
Using zcmd and foreach in the example.
pawn Код:
new robtime[MAX_PLAYERS];
new robtextdraw;
CMD:rob(playerid, params[])
{
TextDrawShowForPlayer(playerid, robtextdraw);
return robtime[playerid] = 10;
}
pawn Код:
forward robcheck();
public robcheck()
{
foreach(Player, i)
{
if(robtime[i] > 0)
{
robtime[i] --;
new string[128];
format(string, 128, "Time left: %i seconds.", robtime[i]);
TextDrawSetString(robtextdraw, string);
}
}
return 1;
}