How would I go about making this timer?
#1

I'm trying to make a timer, so at the end of.. let's stay, 5 minutes a new map appears, and the game starts. I'd like some text that counts down from 300 seconds. How would I go, to make this possible?
Reply
#2

You can use this Countdown Timer and edit it a bit according to your usage. You can code your function!
pawn Код:
forward CountDown(playerid, seconds);
public CountDown(playerid, seconds)
{
    new string[50];
    if(seconds > 0)
    {
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        PlayerPlaySound(playerid, 1056, X, Y, Z);
        format(string, sizeof(string), "~R~%d", seconds);
        GameTextForPlayer(playerid, string, 1000, 3);
        seconds = seconds -1;
        SetTimerEx("CountDown", 1000, 0, "ii", playerid, seconds);
        return 1;
    }
    if(seconds == 0)
    {
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, X, Y, Z);
        PlayerPlaySound(playerid, 1057, X, Y, Z);
        TogglePlayerControllable(playerid, 1);
        return 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)