Count down with GameTextForPlayer
#1

I'm gonna put the timer to 15 minutes but i want each minutes pass it will GameTextForPlayer
How to make the GameTextForPlayer like in the picture.
Example: 10 minutes left to GivePlayerCash function so on GameTextForPlayer 10 minues, when 11 so 11 will be shown, its a counting down from 15 minutes to 0 minutes left for the bank robbery




Reply
#2

So now you create a timer for every second
pawn Код:
new RobbedBank[MAX_PLAYERS];

//OnGameModeInIt
    //OneSecond
    SetTimer("OneSecond",1000,1);

forward OneSecond()
public OneSecond()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
            //Add when someone robs something, RobbedBank[playerid] =100;  //100 seconds for an example
            if(RobbedBank[i] > 1)
            {
           //Timer
          format(string,sizeof(string),"%d ~g~remaining",RobbedBank[i]);
          GameTextForPlayer(i, string,2000,5);
              RobbedBank[i] --;
            }
            if(RobbedBank[i] == 1)
           {
               //Give the cash here.
                RobbedBank[i] =0;
           }
     }
}
Reply
#3

Doesn't work... i want in on minutes, it will count 15 minutes remaining - each one minute left it will GameTextForPlayer

Код:
GameTextForPlayer(playerid, "~y~%d minutes left" ,2000 ,1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)