Guest User

Untitled

a guest
Nov 23rd, 2010
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. //Count filterscript by -SteVe- (PLEASE LEAVE THE CREDITS!!!)
  2.  
  3. #define FILTERSCRIPT
  4.  
  5.  
  6. #include <a_samp>
  7.  
  8.  
  9. #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
  10. #define YELLOW 0xFFFF00FF
  11. #define ADMINRED 0xFB0000FF
  12.  
  13.  
  14. //Forwards
  15. forward timercountdown1();
  16. forward CountSpamOver();
  17.  
  18. //News (veriables)
  19. new CountSpam[MAX_PLAYERS];
  20. new counts;
  21. new counter1;
  22.  
  23. #if defined FILTERSCRIPT
  24.  
  25. public OnFilterScriptInit()
  26. {
  27. print("\n--------------------------------------");
  28. print(" Count Filterscript by -SteVe- ");
  29. print("--------------------------------------\n");
  30. return 1;
  31. }
  32.  
  33. public OnFilterScriptExit()
  34. {
  35. return 1;
  36. }
  37.  
  38. #else
  39.  
  40. main()
  41. {
  42. print("\n----------------------------------");
  43. print(" Blank Gamemode by your name here");
  44. print("----------------------------------\n");
  45. }
  46.  
  47. #endif
  48.  
  49. public OnGameModeInit()
  50. {
  51. // Don't use these lines if it's a filterscript
  52. SetGameModeText("Blank Script");
  53. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  54. return 1;
  55. }
  56.  
  57. public OnGameModeExit()
  58. {
  59. return 1;
  60. }
  61.  
  62. public OnPlayerRequestClass(playerid, classid)
  63. {
  64. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  65. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  66. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  67. return 1;
  68. }
  69.  
  70. public OnPlayerConnect(playerid)
  71. {
  72. CountSpam[playerid] = 0;
  73. return 1;
  74. }
  75.  
  76.  
  77. //count
  78. public timercountdown1()
  79. {
  80. counts--;
  81. if(counts == 3)
  82. {
  83. SendClientMessageToAll(YELLOW,"_-Three-_");
  84. }
  85. if(counts == 2)
  86. {
  87. SendClientMessageToAll(YELLOW,"_-Two-_");
  88. }
  89. if(counts == 1)
  90. {
  91. SendClientMessageToAll(YELLOW,"_-One-_");
  92. }
  93. if(counts == 0)
  94. {
  95. SendClientMessageToAll(YELLOW,"_-GoGoGo!!!-_");
  96. KillTimer(counter1);
  97. }
  98. return 1;
  99. }
  100.  
  101. public OnPlayerCommandText(playerid, cmdtext[])
  102. {
  103. dcmd(count,5,cmdtext);
  104. return 0;
  105. }
  106.  
  107.  
  108.  
  109. public CountSpamOver()
  110. {
  111. for(new i; i < MAX_PLAYERS; i ++)
  112. {
  113. CountSpam[i] = 0;
  114. }
  115. return 1;
  116. }
  117.  
  118.  
  119. //DCMD Commands
  120. dcmd_count(playerid,params[])
  121. {
  122. #pragma unused params
  123. if(CountSpam[playerid] == 0)
  124. {
  125. new str[128];
  126. new playername[MAX_PLAYER_NAME];
  127. GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  128. format(str, sizeof(str), "_-%s has started a Count Down-_", playername);
  129. SendClientMessageToAll(YELLOW, str);
  130. counts = 4;
  131. CountSpam[playerid] = 1;
  132. counter1 = SetTimer("timercountdown1",1000,true);
  133. SetTimer("CountSpamOver", 14000, 0);
  134. }
  135. else if(CountSpam[playerid] == 1)
  136. {
  137. SendClientMessage(playerid,ADMINRED,"Please wait before you can use Count again.");
  138. }
  139. return 1;
  140. }
Advertisement
Add Comment
Please, Sign In to add comment