Countdown for Server
#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


Messages In This Thread
Countdown for Server - by Marios - 02.01.2011, 08:12
Re: Countdown for Server - by Ironboy - 02.01.2011, 08:14
Re: Countdown for Server - by HyperZ - 02.01.2011, 08:52
Re: Countdown for Server - by Marios - 02.01.2011, 09:19
Re: Countdown for Server - by gangstajoe - 02.01.2011, 09:22
Re: Countdown for Server - by Marios - 02.01.2011, 09:24
Re: Countdown for Server - by Mean - 02.01.2011, 11:37

Forum Jump:


Users browsing this thread: 4 Guest(s)