Count down with GameTextForPlayer - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Count down with GameTextForPlayer (
/showthread.php?tid=465306)
Count down with GameTextForPlayer -
Lidor124 - 21.09.2013
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
Re: Count down with GameTextForPlayer -
Vanter - 21.09.2013
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;
}
}
}
Re: Count down with GameTextForPlayer -
Lidor124 - 22.09.2013
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);