I Need Help In Time Left Please - 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: I Need Help In Time Left Please (
/showthread.php?tid=657516)
I Need Help In Time Left Please -
RJTabish - 09.08.2018
Hello I Need Your Little Help In Timer Left Actually I Make Dm So I Want Add Time Left So Idk How Can I Add When People Joined Dm then Timer Will Start at the end of time dm off Any Help ? Time Must Visible on the screen like giving Picture
Re: I Need Help In Time Left Please -
GRiMMREAPER - 09.08.2018
This is the most simple way to create a countdown:
pawn Код:
#define COUNTDOWN 90 // Number of seconds
new g_CountdownText[6],
g_Countdown;
g_Countdown = COUNTDOWN;
format(g_CountdownText, sizeof g_CountdownText, "%02i:%02i", g_Countdown / 60, g_Countdown % 60);
// Whenever you need to decrease the time from g_Countdown, use: g_Countdown--;
You'd have to update the timer each second, obviously. You could do this with a timer.
Re: I Need Help In Time Left Please -
RJTabish - 10.08.2018
where can i add these lines onplayerconnect , ongamemodeinit , or onplayerspawn ? where sorry
Re: I Need Help In Time Left Please -
GRiMMREAPER - 10.08.2018
You should add the code wherever you want the countdown to come up.
Re: I Need Help In Time Left Please -
RJTabish - 10.08.2018
thanx
Re: I Need Help In Time Left Please -
RJTabish - 10.08.2018
sorry for saying that its not works
i add these lines onplayerspawn for just check nothing happenings
g_Countdown = COUNTDOWN;
format(g_CountdownText, sizeof g_CountdownText, "%02i:%02i", g_Countdown / 60, g_Countdown % 60);
other codes are on the top
Re: I Need Help In Time Left Please -
GRiMMREAPER - 10.08.2018
I just gave you the logic for how it works. You have to figure out how to apply the logic to your needs.