Countdown for specific player while some condition is ture - 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: Countdown for specific player while some condition is ture (
/showthread.php?tid=613308)
Countdown for specific player while some condition is ture -
Maheerali - 26.07.2016
I making a robbery game.
Showcountdown until a condition is ture. If condition go false hide countdown and reset it.
Re: Countdown for specific player while some condition is ture -
Nero_3D - 26.07.2016
Just take your countdown timer and add that condition ? shouldn't be to difficult
Something like that I guess should work
PHP код:
if(condition is not true) countdown = START_VALUE;
Show us what you did so far
Re: Countdown for specific player while some condition is ture -
Maheerali - 26.07.2016
Quote:
Originally Posted by Nero_3D
Just take your countdown timer and add that condition ? shouldn't be to difficult
Something like that I guess should work
PHP код:
if(condition is not true) countdown = START_VALUE;
Show us what you did so far
|
if (Capturing[playerid] == true)
{
//Show counter with textdraw
}
if (Capturing[playerid] == false)
{
//hide textdraw && counter = STARTVALUE
}
please help
Re: Countdown for specific player while some condition is ture -
Nero_3D - 26.07.2016
Where do you have that code is that in a timer?
PHP код:
if(Capturing[playerid] == true)
{
// Show counter with textdraw
// counter--;
// update textdraw
// if(counter == 0) // do something
}
else
{
// hide textdraw
// counter = STARTVALUE
}
If this isn't in a timer how does Capturing[playerid] gets updated ?
I am not sure how to help you, you already got most parts of the code
Re: Countdown for specific player while some condition is ture -
Maheerali - 26.07.2016
Quote:
Originally Posted by Nero_3D
Where do you have that code is that in a timer?
PHP код:
if(Capturing[playerid] == true)
{
// Show counter with textdraw
// counter--;
// update textdraw
// if(counter == 0) // do something
}
else
{
// hide textdraw
// counter = STARTVALUE
}
If this isn't in a timer how does Capturing[playerid] gets updated ?
I am not sure how to help you, you already got most parts of the code
|
Bro just tell me a example how to set a Float to textdraw.
Re: Countdown for specific player while some condition is ture -
Nero_3D - 26.07.2016
A float to a textdraw?
PHP код:
new string[32];
format(string, sizeof string, "%f", 5.5);
TextDrawSetString(textdraw, string);