count system while on robbery -
blackdragon1 - 09.02.2013
I want when i rob bank so they show me on my screen 30 sec count like > 30 , 29 , 28 , 27 until at the 1 and then robbery complete btw my sugest is how to add count game text on screen?
like this >
http://i44.tinypic.com/4jssb8.png
Re: count system while on robbery -
Frede - 09.02.2013
GameTextForPlayer?
with a timer
Re: count system while on robbery -
blackdragon1 - 09.02.2013
yes look at image
Re: count system while on robbery -
Neil. - 09.02.2013
Use the 'search' button next time, it's there for a reason..
How to make a simple countdown
Re: count system while on robbery -
blackdragon1 - 09.02.2013
i need on robbery system no cmd and i can search on ******. i will found cowtown system. but i want to know how to add on robbery.
Re: count system while on robbery -
Neil. - 09.02.2013
Then use the tutorial
above
And I assume you're using checkpoints while robbing so, add a timer
pawn Код:
CountDownTimer = SetTimer("CountDown", 1000, false);
When the player is on the checkpoint
And adjust the Countdown Variable to 30 seconds like you said.
Re: count system while on robbery -
blackdragon1 - 09.02.2013
ok so if i add this ^^ so they show to player 30, 29 , 28 until at the 0 btw i will set time to 30sec after but it's just example they show to player count?
Re: count system while on robbery -
Neil. - 09.02.2013
Quote:
Originally Posted by blackdragon1
ok so if i add this ^^ so they show to player 30, 29 , 28 until at the 0 btw i will set time to 30sec after but it's just example they show to player count?
|
Not just that. Read the whole tutorial and you have to adjust a few things to your preference.
AW: Re: count system while on robbery -
Nero_3D - 09.02.2013
Quote:
Originally Posted by Ken97
|
The disadvantage of the function in the tutorial is that it can only be used once at the moment, also if their are two robberys at the same time the code gets bugged
You should use something like that
pawn Код:
forward CountDownRobbery(playerid, time);
public CountDownRobbery(playerid, time) {
if(time < 1) {
GameTextForPlayer(playerid, "~r~Robbery complete", 2500, 1);
} else {
new
str[128]
;
format(str, sizeof str, "%d seconds remaining~n~~r~Do not move until the~n~Robbery is completed", time);
GameTextForPlayer(playerid, str, 1000, 1);
SetTimerEx("CountDownRobbery", 1000, false, "ii", playerid, --time);
}
}
And you simply use it like that
pawn Код:
CountDownRobbery(playerid, 30);
Re: count system while on robbery -
blackdragon1 - 09.02.2013
thanks but it's going like this > 30 , 25 , 20 , 15 , 10 , 5 , robbery complete but i want like this 30 , 29 , 28 , 27 until at the 0. it depends on timer?