/countdown
#1

ehm, can i get an countdown cmd for ma admin script (plz help in my "cant compile my admin script forum")? i rly need it, a announce countdown
Reply
#2

You can download myn countdown (but it's for everybody not just for admins)
if you really need in your admin spec than try ermm... look in g_admin there is an countdown cmd i think..
you can see there how to do it.
Reply
#3

a simple countdown or a countdown [seconds]?
Reply
#4

yes, an /coundown cmd there will show game text with countdown :P
Reply
#5

in header:
pawn Код:
new cd_timer;
new cd_sec;
OnGameCommandText:
pawn Код:
if(strcmp(cmd,"/count",true)==0)
{
  cd_sec = 5;
  cd_timer = SetTimer("countdown", 999, 1);
  return true;
}
In end of script:
pawn Код:
public countdown()
{
    if(cd_sec == 0)
    {
        GameTextForAll("~r~Go!",1000,3);
        KillTimer(cd_timer);
    }
    else
    {
        new string[8];
        format(string,sizeof(string),"~g~%d",cd_sec);
        GameTextForAll(string,1000,3);
    }
    cd_sec = cd_sec-1;
    return 1;
}
Reply
#6

Quote:
Originally Posted by Shadowww
in header:
pawn Код:
new cd_timer;
new cd_sec;
OnGameCommandText:
pawn Код:
if(strcmp(cmd,"/count",true)==0)
{
  cd_sec = 5;
  cd_timer = SetTimer("countdown", 999, 1);
  return true;
}
In end of script:
pawn Код:
public countdown()
{
    if(cd_sec == 0)
    {
        GameTextForAll("~r~Go!",1000,3);
        KillTimer(cd_timer);
    }
    else
    {
        new string[8];
        format(string,sizeof(string),"~g~%d",cd_sec);
        GameTextForAll(string,1000,3);
    }
    cd_sec = cd_sec-1;
    return 1;
}
omg ty it works :P but how do i cnahge the gamemode text per second? etc. 1 second= 1 and etc.
Reply
#7

format(string,sizeof(string),"~g~%d",cd_sec);
GameTextForAll(string,1000,3);

^^^ This is gametext which shows 5... 4... 3... 2... 1... go
You can change it to (e.g.):
format(string,sizeof(string),"~g~%d~w~seconds left!",cd_sec);
GameTextForAll(string,1000,3);
Reply
#8

Quote:
Originally Posted by Shadowww
format(string,sizeof(string),"~g~%d",cd_sec);
GameTextForAll(string,1000,3);

^^^ This is gametext which shows 5... 4... 3... 2... 1... go
You can change it to (e.g.):
format(string,sizeof(string),"~g~%d~w~seconds left!",cd_sec);
GameTextForAll(string,1000,3);
ehm, not cuz im TOTALLY noob, but how do i define the string :P
Reply
#9

Khem, what?
Reply
#10

Quote:
Originally Posted by Shadowww
Khem, what?
can u giv meh the full script in a code :P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)