Advertisement
RedWingz

Simple Countdown Filterscript

May 18th, 2012
933
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.88 KB | None | 0 0
  1. ////////////////////////////////////////////////////////////////////////////////
  2. ////////////////////////Simple Countdown System/////////////////////////////////
  3. //////////////////////////Created by RedWingz///////////////////////////////////
  4. ////////////////////////////////////////////////////////////////////////////////
  5. // ~ Note: This Filterscript only took me 10 Minutes + Thanks to SA-MP Wiki ~ //
  6. // ~ P.S. If You're going to use this for anything, Please keep the credits. //
  7. //Includes//
  8. #include <a_samp>
  9. #include <zcmd>
  10.  
  11. //Defines//
  12. #define RANGEOFSTARTER 50
  13.  
  14. //Forwards//
  15. forward Counting(playerid);
  16. forward Counting2(playerid);
  17. forward Counting1(playerid);
  18. forward CountingGO(playerid);
  19.  
  20. //Declared New//
  21. new Count;
  22.  
  23. public OnFilterScriptInit()
  24. {
  25.     Count = 0;
  26. }
  27.  
  28. //Commands//
  29. CMD:countdown(playerid,params[])
  30. {
  31.     new Float:x,Float:y,Float:z;
  32.     GetPlayerPos(playerid, x, y, z);
  33.     if(Count == 0)
  34.     {
  35.         SetTimer("Counting",1000,false);
  36.         }
  37.         else
  38.         {
  39.             SendClientMessage(playerid, 0xFF0000FF,"Someone else has already started a Countdown!");
  40.     }
  41.     if(IsPlayerInRangeOfPoint(playerid, RANGEOFSTARTER, x, y, z))
  42.     {
  43.         TogglePlayerControllable(playerid, 0);
  44.     }
  45.     return 1;
  46. }
  47. public Counting(playerid)
  48. {
  49.     Count = 1;
  50.     GameTextForAll("~r~3",1000,6);
  51.     PlayerPlaySound(playerid, 1056,0,0,0);
  52.     SetTimer("Counting2",1000,false);
  53.     return 1;
  54. }
  55. public Counting2(playerid)
  56. {
  57.     Count = 1;
  58.     GameTextForAll("~y~2",1000,6);
  59.     PlayerPlaySound(playerid, 1056,0,0,0);
  60.     SetTimer("Counting1",1000,false);
  61.     return 1;
  62. }
  63. public Counting1(playerid)
  64. {
  65.     Count = 1;
  66.     GameTextForAll("~b~1",1000,6);
  67.     PlayerPlaySound(playerid, 1056,0,0,0);
  68.     SetTimer("CountingGO",1000,false);
  69.     return 1;
  70. }
  71. public CountingGO(playerid)
  72. {
  73.     Count = 0;
  74.     PlayerPlaySound(playerid, 1057,0,0,0);
  75.     GameTextForAll("~g~GO!!!",1000,6);
  76.     TogglePlayerControllable(playerid, 1);
  77.     return 1;
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement