Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////////////////////////////////////////////////////////////////////////////////
- ////////////////////////Simple Countdown System/////////////////////////////////
- //////////////////////////Created by RedWingz///////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////
- // ~ Note: This Filterscript only took me 10 Minutes + Thanks to SA-MP Wiki ~ //
- // ~ P.S. If You're going to use this for anything, Please keep the credits. //
- //Includes//
- #include <a_samp>
- #include <zcmd>
- //Defines//
- #define RANGEOFSTARTER 50
- //Forwards//
- forward Counting(playerid);
- forward Counting2(playerid);
- forward Counting1(playerid);
- forward CountingGO(playerid);
- //Declared New//
- new Count;
- public OnFilterScriptInit()
- {
- Count = 0;
- }
- //Commands//
- CMD:countdown(playerid,params[])
- {
- new Float:x,Float:y,Float:z;
- GetPlayerPos(playerid, x, y, z);
- if(Count == 0)
- {
- SetTimer("Counting",1000,false);
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000FF,"Someone else has already started a Countdown!");
- }
- if(IsPlayerInRangeOfPoint(playerid, RANGEOFSTARTER, x, y, z))
- {
- TogglePlayerControllable(playerid, 0);
- }
- return 1;
- }
- public Counting(playerid)
- {
- Count = 1;
- GameTextForAll("~r~3",1000,6);
- PlayerPlaySound(playerid, 1056,0,0,0);
- SetTimer("Counting2",1000,false);
- return 1;
- }
- public Counting2(playerid)
- {
- Count = 1;
- GameTextForAll("~y~2",1000,6);
- PlayerPlaySound(playerid, 1056,0,0,0);
- SetTimer("Counting1",1000,false);
- return 1;
- }
- public Counting1(playerid)
- {
- Count = 1;
- GameTextForAll("~b~1",1000,6);
- PlayerPlaySound(playerid, 1056,0,0,0);
- SetTimer("CountingGO",1000,false);
- return 1;
- }
- public CountingGO(playerid)
- {
- Count = 0;
- PlayerPlaySound(playerid, 1057,0,0,0);
- GameTextForAll("~g~GO!!!",1000,6);
- TogglePlayerControllable(playerid, 1);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement