Countdown for Server
#1

Can Someone give me a script code for a screen countdown? (3,2,1,go). I want one but no for Admins use, i want to be able to do it everyone in my server with a command! thnx!
Reply
#2

pawn Код:
CMD:count(playerid,params[]) {
    new ccseconds;
    if (sscanf(params, "i", ccseconds)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /count [seconds]");
    if(PlayerInfo[playerid][Jailed] == 1) {
        SendClientMessage(playerid, COLOR_BRIGHTRED, "You are in jail and cannot use this command");
        return 1;
    }
    if (isnull(params)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration in seconds.");
    if (!IsNumeric(params)) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration in seconds.");
    if (ccseconds < 1) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration between 1 and 20 seconds");
    if (ccseconds > 20) return SendClientMessage(playerid, COLOR_BRIGHTRED, "You must enter a duration between 1 and 20 seconds");
    if (cseconds) return SendClientMessage(playerid, COLOR_BRIGHTRED, "A countdown is already running.");
    CountingTimer = SetTimer("ctimer", 1000, true);
    format(cstring,40,"You started a countdown of %d seconds.",ccseconds);
    SendClientMessage(playerid,COLOR_LIGHTBLUE, cstring);
    cseconds = ccseconds+1;
    cCount[playerid] = 1;
    return 1;
}
Reply
#3

pawn Код:
new Count = 3;
pawn Код:
if(strcmp(cmdtext,"/count",true) == 0)
{
    if(Count < 3) return SendClientMessage(playerid,red,"Countdown is already in progress");
    SetTimer("CountDown",1000,0);
    return 1;
}
pawn Код:
public CountDown()
{
    format(string,sizeof(string),"%d",Count);
    if(Count == 0)
    {
        GameTextForAll("Go go go!",1500,3);
        Count = 3;
    }
    else
    {
        GameTextForAll(string,1500,3);
        Count--;
        SetTimer("CountDown",1000,0);
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by Clive
Посмотреть сообщение
pawn Код:
new Count = 3;
pawn Код:
if(strcmp(cmdtext,"/count",true) == 0)
{
    if(Count < 3) return SendClientMessage(playerid,red,"Countdown is already in progress");
    SetTimer("CountDown",1000,0);
    return 1;
}
pawn Код:
public CountDown()
{
    format(string,sizeof(string),"%d",Count);
    if(Count == 0)
    {
        GameTextForAll("Go go go!",1500,3);
        Count = 3;
    }
    else
    {
        GameTextForAll(string,1500,3);
        Count--;
        SetTimer("CountDown",1000,0);
    }
    return 1;
}
I get the following errors!
warning 235: public function lacks forward declaration (symbol "CountDown")
: error 017: undefined symbol "string"
: error 017: undefined symbol "string"
: error 029: invalid expression, assumed zero
Reply
#5

Quote:
Originally Posted by Marios
Посмотреть сообщение
I get the following errors!
warning 235: public function lacks forward declaration (symbol "CountDown")
: error 017: undefined symbol "string"
: error 017: undefined symbol "string"
: error 029: invalid expression, assumed zero
change
pawn Код:
new Count = 3;
to
pawn Код:
new Count = 3;
new string[256];
forward CountDown();
That should solve it.
Reply
#6

Quote:
Originally Posted by gangstajoe
Посмотреть сообщение
change
pawn Код:
new Count = 3;
to
pawn Код:
new Count = 3;
new string[256];
forward CountDown();
That should solve it.
thanks so much
Reply
#7

Quote:
Originally Posted by gangstajoe
Посмотреть сообщение
change
pawn Код:
new Count = 3;
to
pawn Код:
new Count = 3;
new string[256];
forward CountDown();
That should solve it.
LoL why to use 256 cells ?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)