PDA

View Full Version : GameTextForPlayer format


Lidor124
25/09/2013, 01:13 PM
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

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

http://i42.tinypic.com/34zf3on.jpg


http://i44.tinypic.com/2h5ibur.jpg

Jefff
25/09/2013, 01:31 PM
Example

Top
new Minutes[MAX_PLAYERS char],MaxP;

OnGameModeInit
MaxP = GetMaxPlayers();
SetTimer("CountDown",60000,true);

Connect
Minutes{playerid} = 16;

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;
}