Help with textdraw and countdown..
#1

Hi, I am trying to make a countdown of 30 seconds, when 0 is reached, that area is yours.

What I need is how to make that countdown, I tryed with GetTickCount but nothing, it just says "65545121" (Example).

Here is part of the script.

pawn Код:
EnteredArea10[i] = 1; // He has entered
SendClientMessage(i,COLOR_CON_GREEN, "Quedate aca 30 segundos para capturar esta area!");
T10[i] = SetTimer("TakeOver",30000,0);
SendClientMessageToAll(COLOR_CON_GREEN, "La ciudad antigua estб siendo capturada!");
TextDrawShowForPlayer(i, trpc);
T10[i] = GetTickCount();
new strtrpc[64];
format(strtrpc, 64, "Tiempo restante para capturar: %d segundos", T10[i]);
TextDrawSetString(trpc, strtrpc);
Thanks!
Reply
#2

Bump! please answer!
Reply
#3

You could set the TakeOver timer time to 1000ms and increase a variable by 1 in there. If it is over 30, you can trigger the normal stuff, and else use the variable for the countdown
Reply
#4

Huh.. so.. I put the timer to 1000ms, then, in the callback, I put a variable, and then? Im lost >.<
Reply
#5

The variable needs to be global (created at the beginning of your script, not in the function) Then in the function you increase it by 1 (variable ++) and check if it is > 30 (if(variable > 30)). If it is, do your TakeOver code. If not, set the TextDrawString to 30 - the variable (so that it is a countdown)
Reply
#6

Quote:
Originally Posted by Zox
Посмотреть сообщение
roflmao dont double post -.-
Thanks noob, read rules first.

Quote:
Originally Posted by Mauzen
Посмотреть сообщение
The variable needs to be global (created at the beginning of your script, not in the function) Then in the function you increase it by 1 (variable ++) and check if it is > 30 (if(variable > 30)). If it is, do your TakeOver code. If not, set the TextDrawString to 30 - the variable (so that it is a countdown)
And, THANK YOU! It worked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)