[MAKE] Countdown
#10

pawn Код:
#include <a_samp>
#include <dcmd>

#define FILTERSCRIPT
#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

new CountdownTimer = -1;
new CountDownMessage[128];
new Counttime;

dcmd_countdown(playerid, params[])
{
    if(CountdownTimer != -1) return SendClientMessage(playerid, COLOR_RED, "ERROR: Countdown already active!");
    new tmp[256], tmp2[256], idx; tmp=strtok(params, idx); tmp2=strtok(params, idx);
    if(!strlen(tmp) || !strlen(tmp2)) return SendClientMessage(playerid, COLOR_RED, "Usage: /countdown <TIME> <TEXT>");
    Counttime = strval(tmp);
    format(CountDownMessage, 128, "%s", params[strlen(tmp)+1]);
    CountdownTimer = SetTimer("Counter", 1000, true);
    return 1;
}

forward Counter();
public Counter()
{
    Counttime--;
    if(Counttime <= 0)
    {
        GameTextForAll(CountDownMessage, 1500, 3);
        KillTimer(CountdownTimer);
        CountdownTimer = -1;
    }
    else
    {
         new str[10];
         format(str, 10, "%d", Counttime);
         GameTextForAll(str, 2000, 3);
    }
    return 1;
}
ERROR
pawn Код:
C:\Users\Larsey123\Documents\SAMP Server\My server\filterscripts\Countdown.pwn(40) : warning 203: symbol is never used: "dcmd_countdown"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.
Reply


Messages In This Thread
[MAKE] Countdown - by Larsey123IsMe - 26.11.2010, 19:12
Re: [MAKE] Countdown - by WillyP - 26.11.2010, 19:13
Re: [MAKE] Countdown - by zSuYaNw - 26.11.2010, 19:15
Re: [MAKE] Countdown - by Larsey123IsMe - 26.11.2010, 19:17
Re: [MAKE] Countdown - by JamesC - 26.11.2010, 19:38
Re: [MAKE] Countdown - by Tai_Storm - 26.11.2010, 19:43
Re: [MAKE] Countdown - by WillyP - 26.11.2010, 19:44
Re: [MAKE] Countdown - by Hal - 26.11.2010, 19:45
Re: [MAKE] Countdown - by Jeffry - 26.11.2010, 19:46
Re: [MAKE] Countdown - by Larsey123IsMe - 27.11.2010, 17:31

Forum Jump:


Users browsing this thread: 1 Guest(s)