Guest User

Z-DM_EVENT

a guest
Mar 13th, 2017
747
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.77 KB | None | 0 0
  1. /*
  2. DM Event by ZukerCup And Specail Thanks to ZCMD & Sscanf
  3. Hope u enjoy it , contact me at http://forum.sa-mp.com/member.php?u=289876
  4. if u found any bug in the script
  5. */
  6. ////////////////////////////////////////////////
  7. #include <a_samp>
  8. #include <ZCMD>
  9. #include <sscanf2>
  10. #define COLOR_RED 0xFF0000FF
  11. #define COLOR_Grey 0xAFAFAFAA
  12. #define COLOR_Green 0x33AA33AA
  13. #define COLOR_Gold 0xB8860BAA
  14. enum info
  15. {
  16. dmwep
  17. }
  18. new ServerData[info];
  19. ////////////////////////////////////////////////////
  20. new IsInDm[MAX_PLAYERS], IsDmStarted = 0, IsADm = 0;
  21.  
  22. public OnFilterScriptInit()
  23. {
  24. print("\n*****************************************");
  25. print("DM-Event By ZukerCup Loaded...");
  26. print("*****************************************\n");
  27. return 1;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32. return 1;
  33. }
  34. public OnPlayerDeath(playerid, killerid, reason)
  35. {
  36. if(IsInDm[playerid] == 1)
  37. {
  38. SetPlayerInterior(playerid, 0);
  39. SetPlayerVirtualWorld(playerid, 0);
  40. ResetPlayerWeapons(playerid);
  41. IsInDm[playerid] = 0;
  42. }
  43. return 1;
  44. }
  45. public OnPlayerDisconnect(playerid, reason)
  46. {
  47. if(IsInDm[playerid] == 1)
  48. {
  49. SetPlayerInterior(playerid, 0);
  50. SetPlayerVirtualWorld(playerid, 0);
  51. ResetPlayerWeapons(playerid);
  52. IsInDm[playerid] = 0;
  53. }
  54. return 1;
  55. }
  56. public OnPlayerConnect(playerid)
  57. {
  58. SetPlayerInterior(playerid, 0);
  59. SetPlayerVirtualWorld(playerid, 0);
  60. ResetPlayerWeapons(playerid);
  61. IsInDm[playerid] = 0;
  62. return 1;
  63. }
  64. CMD:dmevent(playerid, params[])
  65. {
  66. new wepid;
  67. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Not Admin!");
  68. if(IsADm == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]There is Already a DM event OPENED");
  69. if(sscanf(params, "i", wepid))
  70. {
  71. SendClientMessage(playerid, COLOR_Grey, " /dmevent <weaponid>");
  72. }
  73. else
  74. {
  75. SendClientMessageToAll(COLOR_Gold, "An Administrator has Opened a DM event to join /joindm");
  76. SendClientMessage(playerid, COLOR_Gold, "u have Opened the Dm event to start it do /startdm and to close it /offdmevent");
  77. IsADm = 1;
  78. ServerData[dmwep] = wepid;
  79. }
  80. return 1;
  81. }
  82. CMD:offdmevent(playerid, params[])
  83. {
  84. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Not Admin!");
  85. if(IsADm == 0 ) return SendClientMessage(playerid, COLOR_RED, "[ERROR]There is No DM event OPENED");
  86. else
  87. {
  88. SendClientMessageToAll(COLOR_Gold, "An Administrator has Closed DM event");
  89. IsADm = 0;
  90. }
  91. return 1;
  92. }
  93. CMD:startdm(playerid, params[])
  94. {
  95. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Not Admin!");
  96. if(IsADm == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR]There is No DM event OPENED");
  97. if(IsDmStarted == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]The Event is already started");
  98.  
  99. else
  100. {
  101.  
  102. SendClientMessageToAll(COLOR_Gold, "An Administrator has Started The DM event (No one can join anymore)");
  103. IsDmStarted = 1;
  104. for(new i = 0; i < MAX_PLAYERS; i++)
  105. {
  106. if(IsInDm[playerid] == 1)
  107. {
  108. TogglePlayerControllable(i,1);
  109. GameTextForPlayer(i, "EVENT STARTED!", 5000, 5);
  110. }
  111. }
  112. }
  113. return 1;
  114. }
  115. CMD:joindm(playerid, params[])
  116. {
  117. if(IsInDm[playerid] == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Already in The DM event");
  118. if(IsADm == 0) return SendClientMessage(playerid, COLOR_RED, "[ERROR]There is No DM event OPENED");
  119. if(IsDmStarted == 1) return SendClientMessage(playerid, COLOR_RED, "[ERROR]The Event is started you cant join");
  120.  
  121.  
  122. new randSpawn = random(8);
  123. switch(randSpawn)
  124. {
  125. case 0:
  126. {
  127. SetPlayerPos(playerid, -1129.8909, 1057.5424, 1346.4141);
  128. }
  129. case 1:
  130. {
  131. SetPlayerPos(playerid, -974.1805, 1077.0630, 1344.9895);
  132. }
  133. case 2:
  134. {
  135. SetPlayerPos(playerid, -997.8885, 1096.0400, 1342.6517);
  136. }
  137. case 3:
  138. {
  139. SetPlayerPos(playerid, -1036.1115, 1024.3964, 1343.3551);
  140. }
  141. case 4:
  142. {
  143. SetPlayerPos(playerid, -1075.6144, 1032.7413, 1342.7317);
  144. }
  145. case 5:
  146. {
  147. SetPlayerPos(playerid, -1085.2362, 1053.7657, 1343.3536);
  148. }
  149. case 6:
  150. {
  151. SetPlayerPos(playerid, -1101.0815, 1084.6434, 1341.8438);
  152. }
  153. case 7:
  154. {
  155. SetPlayerPos(playerid, -1093.1536, 1058.8173, 1341.3516);
  156. }
  157. }
  158.  
  159. // No team during DM
  160. SetPlayerTeam(playerid, NO_TEAM);
  161.  
  162. SetPlayerInterior(playerid, 10);
  163. SetPlayerVirtualWorld(playerid, 520);
  164. IsInDm[playerid] = 1;
  165. SetPlayerHealth(playerid, 100);
  166. SetPlayerArmour(playerid, 0);
  167. TogglePlayerControllable(playerid, 0);
  168. ResetPlayerWeapons(playerid);
  169. GivePlayerWeapon(playerid, ServerData[dmwep], 5000);
  170. GameTextForPlayer(playerid, "THE EVENT WILL START SHORTLY!~n~~r~You are temporarily frozen", 10000, 5);
  171. return 1;
  172. }
  173. // this to give the winner money hope u enjoy it....
  174. CMD:givecash(playerid, params[])
  175. {
  176. new otherid, cash;
  177. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "[ERROR]You Are Not Admin!");
  178. if(sscanf(params, "uii", otherid, cash))
  179. {
  180. SendClientMessage(playerid, COLOR_Grey, " <playerid> <money>");
  181. }
  182. else
  183. {
  184. GivePlayerMoney(otherid, cash);
  185. new message[128], name[150];
  186. GetPlayerName(otherid, name, sizeof(name));
  187. GivePlayerMoney(otherid, cash);
  188. format(message, sizeof(message), "An administrator has given you money cost {FFDC2E}(%i$)", cash);
  189. SendClientMessage(otherid, COLOR_Green, message);
  190. format(message, sizeof(message), "You Have given %s money cost {FFDC2E}(%i$)", name, cash);
  191. SendClientMessage(otherid, COLOR_Green, message);
  192. }
  193. return 1;
  194. }
  195. /*
  196. THE END OF THE SCRIPT HOPE U ENJOYED IT THIS SCRIPT HAS BEEN MADE BY ZUKERCUP AND SEPCAIL Thanks To SSCANF Credits And ZCMD Credits
  197. AND IF YOU FOUND ANY BUG IN THE SCRIPT PLEASE TELL ME IN MY FORUM.SAMP ACCOUNT LINK http://forum.sa-mp.com/member.php?u=289876 THANKS.
  198. */
Advertisement
Add Comment
Please, Sign In to add comment