SA-MP Forums Archive
Show timer status - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Show timer status (/showthread.php?tid=98174)



Show timer status - Memoryz - 19.09.2009

Okay, so I basically have a timer that ends the round, it has 20 minutes, then it ends.

But, what I want it to do is make a textdraw, or something that shows how much time is left until the game ends.

My timer is:
Код:
SetTimer("RconCommand",1220000,1);
So, how would I be able to make something at the bottom of the players screen, that shows how much time is left before it changes the gamemode?


Re: Show timer status - Memoryz - 19.09.2009

OH come on, anyone?


Re: Show timer status - brett7 - 19.09.2009

Quote:
Originally Posted by Memoryz
OH come on, anyone?
try searching!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!v


Re: Show timer status - ded - 19.09.2009

Quote:
Originally Posted by Memoryz
OH come on, anyone?
You forgot to read the forum rules? Let me refresh your memory:

Quote:
Originally Posted by Rules
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 12 hours old.



Re: Show timer status - Jakku - 19.09.2009

Double posting doesn't help you. Just as a tip


Re: Show timer status - MadeMan - 19.09.2009

And if we go back to the topic, I think you can't get time left from a timer. You should use a variable, where you keep track on the time left and use it on your textdraw.

pawn Код:
new TimeLeft;

SetTimer("TimeLeftTimer", 1000, 1);

public TimeLeftTimer()
{
    TimeLeft++;
    TextDrawSetString(...);
    if(TimeLeft == 1220)
    {
        //This is where time runs out
    }
}



Re: Show timer status - Badger(new) - 19.09.2009

You can also just simply use a GameText. Much easier. Copy what MadeMan said, but replace TextDrawSetString with:

pawn Код:
new string[128];
format(string,128,"~w~Time Left:~n~~r~%d",TimeLeft);
GameTextForAll(string,1000,6);
Also, although they may of not done well at searching for other topics like this, and double posted to bump their topic. Spamming this topic with pointless posts about the rules is retarded. » Pawnst★r « and MadeMan were the only two people who's posts weren't mindless rubbish.