All pastes #1343920 Raw Edit

CountDown

public text v1 · immutable
#1343920 ·published 2009-02-21 21:17 UTC
rendered paste body
#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
	print("\n----------------------------------------");
	print(" Thomas_Conroy's Countdown FilterScript");
	print("----------------------------------------\n");
	return 1;
}
#else
#endif
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_PINK 0xFF00FFAA
forward countdown();
new Float:X, Float:Y, Float:Z, CountStage = 0, pName[MAX_PLAYER_NAME], string[25 + MAX_PLAYER_NAME], timer;
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp(cmdtext,"/count",true) == 0)
		{
		if(CountStage ==0)
			{
			GetPlayerName(playerid, pName, sizeof(pName));
			format(string, sizeof(string), "*** %s started count.", pName);
			SendClientMessageToAll(COLOR_LIGHTBLUE, string);
			GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 3 ~g~-",1000,3);
			timer = SetTimer("countdown",1000,1);
			CountStage = 3;
			}
		else SendClientMessage(playerid, COLOR_PINK, "The CountDown is busy!");
		return 1;
		}
	return 0;
}

public countdown()
{
	switch(CountStage)
		{
		case 1:
		    {
		    	GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~]~g~-~g~START~g~-~y~]~g~-",1000,3);
				for(new i; i < MAX_PLAYERS; i++)
					{
					GetPlayerPos(i,X,Y,Z);
					PlayerPlaySound(i,1057,X,Y,Z);
					}
				KillTimer(timer);
				CountStage = 0;
			}
        case 2: GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 1 ~g~-",1000,3), CountStage = 1;
		case 3: GameTextForAll("~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~-~y~ 2 ~g~-",1000,3), CountStage = 2;
		}
}

//##########################
//## © Thomas_Conroy 2009 ##
//##########################