help with rob system
#4

You could create a command that shows a textdraw, and sets a variable to 10:
pawn Код:
new robtime[MAX_PLAYERS];
new robtextdraw;
CMD:rob(playerid, params[])
{
    TextDrawShowForPlayer(playerid, robtextdraw);
    return robtime[playerid] = 10;
}
Then a timer, to decrease the variable by 1 each second, and updates the textdraw:
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;
}
Using zcmd and foreach in the example.
Reply


Messages In This Thread
help with rob system - by 1fret - 18.02.2015, 01:41
Re: help with rob system - by Ritzy2K - 18.02.2015, 01:58
Re: help with rob system - by 1fret - 18.02.2015, 02:01
Re: help with rob system - by CalvinC - 18.02.2015, 08:31

Forum Jump:


Users browsing this thread: 1 Guest(s)