Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // Released by Good3nough Team
- // Created by [G3]Gunn3R
- // Scripted by [G3]Cr3F
- // Helped by [G3]Winn3R and [G3]RDxX
- //
- #include <a_samp>
- #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 Counting;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Countdown Filterscript by Good3nough Team");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- dcmd(count, 5, cmdtext);
- return 0;
- }
- dcmd_count(playerid, params[])
- {
- if (!strlen(params)) return SendClientMessage(playerid, 0xffffffaa, "USAGE: /count [amount]");
- if (!IsNumeric(params)) return SendClientMessage(playerid, 0xffffffaa, "The amouny param must be numerical.");
- if (strval(params) < 1 || strval(params) > 10) return SendClientMessage(playerid, 0xffffffaa, "The amount should be 0 < amount <= 10");
- if (Counting) return SendClientMessage(playerid, 0xffffffaa, "A Countdown is already running, wait until this has finished.");
- Counting = true;
- new ii = strval(params);
- do
- {
- SetTimerEx("CountDown", (strval(params) - ii) * 1000, false, "i", ii);
- ii --;
- }
- while (ii != -1);
- new Name[32];
- new string[256];
- GetPlayerName(playerid, Name, 24);
- format(string, sizeof(string), "* %s has started the Countdown.", Name);
- SendClientMessageToAll(0xffffffaa, string);
- return 1;
- }
- forward CountDown(num);
- public CountDown(num)
- {
- new str[6];
- if (num) {format(str, sizeof(str), "~w~%i", num); GameTextForAll(str, 1000, 4); }
- else {GameTextForAll("~g~Go", 3000, 4); Counting = false; }
- }
- IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++)
- if (string[i] > '9' || string[i] < '0') return 0;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement