[HELP] Count Down
#1

When i type "/countdown 20 Hi!" then the count down sart like this...
76
75
74
ect..

Why it dont count down from the number i entered?

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

#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

forward Counter();

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

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(countdown, 9, cmdtext);
    return 0;
}

dcmd_countdown(playerid, params[])
{
    new time, cdmessage;
    if(CountdownTimer != -1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Countdown already started!");
    if(sscanf(params, "ds", time, cdmessage)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /countdown (text) (message)");
    Counttime = time;
    format(CountDownMessage, 128, "%s", cdmessage);
    CountdownTimer = SetTimer("Counter", 1000, true);
    return 1;
}
   
public Counter()
{
    Counttime--;
    if(Counttime <= 0)
    {
        GameTextForAll(CountDownMessage, 1500, 3);
        KillTimer(CountdownTimer);
        CountdownTimer = -1;
    }
    else
    {
         new string[256];
         format(string, 10, "%d", Counttime);
         GameTextForAll(string, 2000, 3);
    }
    return 1;
}
Reply


Messages In This Thread
[HELP] Count Down - by Larsey123IsMe - 23.01.2011, 19:56
Re: [HELP] Count Down - by Retardedwolf - 23.01.2011, 20:01
Re: [HELP] Count Down - by Larsey123IsMe - 23.01.2011, 20:14
Re: [HELP] Count Down - by Not available - 23.01.2011, 20:24
Re: [HELP] Count Down - by Larsey123IsMe - 23.01.2011, 20:26
Re: [HELP] Count Down - by Not available - 23.01.2011, 20:29
Re: [HELP] Count Down - by Marricio - 23.01.2011, 20:51
Re: [HELP] Count Down - by Not available - 23.01.2011, 21:00
Re: [HELP] Count Down - by Larsey123IsMe - 23.01.2011, 21:02
Re: [HELP] Count Down - by Marricio - 23.01.2011, 21:07

Forum Jump:


Users browsing this thread: 1 Guest(s)