GameTextForPlayer format
#1

I have timer of 15 minutes for bank robbery, now i want every minute passed it will show GametextForPlayer.
if 15 minutes left so will show up "15 minutes left", then minute passed "14 minutes left" etc. till "0 minutes left"
exactly like in the screenshots.

thanks

Code:
GameTextForPlayer(playerid, "~y~%d minutes left" ,2000 ,1);



Reply
#2

Example

Top
pawn Code:
new Minutes[MAX_PLAYERS char],MaxP;
OnGameModeInit
pawn Code:
MaxP = GetMaxPlayers();
SetTimer("CountDown",60000,true);
Connect
pawn Code:
Minutes{playerid} = 16;
pawn Code:
forward CountDown();
public CountDown()
{
    new str[20];

    for(new playerid=0; playerid != MaxP; playerid++)
    {
        if(IsPlayerConnected(playerid))
        {
            if(--Minutes{playerid} > -1)
            {
                format(str,sizeof(str),"~y~%d minutes left",Minutes{playerid});
                GameTextForPlayer(playerid, str, 2000 ,1);
            }else
                Minutes{playerid} = 16; // start again
        }
    }
    return;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)