I Need Help In Time Left Please
#1

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
Reply
#2

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.
Reply
#3

where can i add these lines onplayerconnect , ongamemodeinit , or onplayerspawn ? where sorry
Reply
#4

You should add the code wherever you want the countdown to come up.
Reply
#5

thanx
Reply
#6

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
Reply
#7

I just gave you the logic for how it works. You have to figure out how to apply the logic to your needs.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)