Advertisement
Guest User

Countdown by wumpyc

a guest
Oct 23rd, 2011
1,448
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.37 KB | None | 0 0
  1. #include "a_samp"
  2. #include "zcmd"
  3. new Count;
  4. #define RANGEOFSTARTER 20 // freezes all that are in range of player(20 meters) that
  5. // actived /countdown
  6. forward Counting(playerid);
  7. forward Counting2(playerid);
  8. forward Counting1(playerid);
  9. forward CountingGO(playerid);
  10. public OnFilterScriptInit()
  11. {
  12.     Count = 0;
  13. }
  14. CMD:countdown(playerid,params[])
  15. {
  16.     new Float:x,Float:y,Float:z;
  17.     GetPlayerPos(playerid, x, y, z);
  18.     if (Count == 0)
  19.     {
  20.     SetTimer("Counting",1000,false);
  21.     }else{
  22.     SendClientMessage(playerid, 0xFF0000FF,"Countdown already started!");
  23.     }
  24.     if IsPlayerInRangeOfPoint(playerid, RANGEOFSTARTER, x, y, z)*then
  25.     {
  26.     TogglePlayerControllable(playerid, 0);
  27.     }
  28.     return 1;
  29. }
  30. public Counting(playerid)
  31. {
  32.     Count = 1;
  33.     GameTextForAll("~y~3",1000,6);
  34.     PlayerPlaySound(playerid, 1056,0,0,0);
  35.     SetTimer("Counting2",1000,false);
  36.     return 1;
  37. }
  38. public Counting2(playerid)
  39. {
  40.     Count = 1;
  41.     GameTextForAll("~g~2",1000,6);
  42.     PlayerPlaySound(playerid, 1056,0,0,0);
  43.     SetTimer("Counting1",1000,false);
  44.     return 1;
  45. }
  46. public Counting1(playerid)
  47. {
  48.     Count = 1;
  49.     GameTextForAll("~b~1",1000,6);
  50.     PlayerPlaySound(playerid, 1056,0,0,0);
  51.     SetTimer("CountingGO",1000,false);
  52.     return 1;
  53. }
  54. public CountingGO(playerid)
  55. {
  56.     Count = 0;
  57.     PlayerPlaySound(playerid, 1057,0,0,0);
  58.     GameTextForAll("~r~GO!!!",1000,6);
  59.     TogglePlayerControllable(playerid, 1);
  60.     return 1;
  61. }
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement