Advertisement
Guest User

Event System bY Teddy

a guest
Aug 25th, 2014
1,012
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.33 KB | None | 0 0
  1. /* ||=================================================||
  2. || Event's ||
  3. || ============= ||
  4. || B.Y ||
  5. ||================================================ ||
  6. || Teddy
  7. ||=================================================||
  8. || DONT MODIFY THE CREDITS PLEASE !!!!! ||
  9. ||=================================================||
  10. */
  11.  
  12.  
  13. #include <a_samp>
  14. #include <zcmd>
  15.  
  16. #define FILTERSCRIPT true
  17. #define COLOR_GREY 0xD7D7D7FF
  18.  
  19.  
  20.  
  21. enum E_INFO
  22. {
  23. EventEnabled
  24. }
  25.  
  26. enum pInfo
  27. {
  28. pAdmin
  29. }
  30.  
  31. forward UnfreezePlayers();
  32.  
  33. new PlayerInfo[MAX_PLAYERS][pInfo];
  34. new EventInfo[E_INFO];
  35. new giveplayer[MAX_PLAYER_NAME];
  36. new sendername[MAX_PLAYER_NAME];
  37. new playa;
  38.  
  39. new Float:RandomSpawns[30][] = {
  40. {1412.2595,6.1298,1000.9219,180.9003}, //
  41. {1408.0437,6.1806,1000.9251,177.1402}, //
  42. {1403.1508,6.1258,1000.9059,174.6335}, //
  43. {1398.0273,5.9584,1000.9063,185.9137}, //
  44. {1381.0830,5.6821,1000.9166,183.4070}, //
  45. {1373.4424,6.2396,1000.9163,175.8869}, //
  46. {1368.2979,6.1590,1000.9200,177.4536}, //
  47. {1360.3193,6.3505,1000.9219,179.6470}, //
  48. {1359.6257,-2.4310,1000.9219,275.8412}, //
  49. {1360.0743,-7.8997,1000.9219,268.9478}, //
  50. {1360.1553,-14.3356,1000.9219,264.5611}, //
  51. {1360.0851,-21.2351,1000.9219,260.1510}, //
  52. {1360.0441,-27.1327,1000.9219,264.5378}, //
  53. {1360.0824,-33.6543,1000.9219,278.3245}, //
  54. {1360.0995,-38.4936,1000.9219,275.1912}, //
  55. {1359.9139,-45.6904,1000.9254,272.9978}, //
  56. {1365.9270,-48.2096,1000.9162,0.1053}, //
  57. {1371.3363,-47.7785,1000.9165,356.9719}, //
  58. {1376.5577,-47.6267,1000.9184,356.0320}, //
  59. {1382.5784,-47.3322,1000.9216,3.8653}, //
  60. {1389.0518,-47.3623,1000.9244,356.6586}, //
  61. {1395.5378,-47.5278,1000.9251,3.2387}, //
  62. {1401.5302,-47.5923,1000.9088,354.4653}, //
  63. {1409.2939,-47.4446,1000.9229,7.6255}, //
  64. {1417.9374,-47.3752,1000.9294,2.6121}, //
  65. {1418.2668,-42.5882,1000.9227,88.7796}, //
  66. {1418.5240,-37.9459,1000.9272,83.7662}, //
  67. {1418.0388,-31.0613,1000.9270,93.7930}, //
  68. {1417.7113,-23.9086,1000.9269,87.8162}, //
  69. {1418.2236,-14.0434,1000.9271,90.0095} //
  70.  
  71. };
  72.  
  73. #if FILTERSCRIPT == true
  74. public OnFilterScriptInit()
  75. {
  76. print("\n ___________________________________________________");
  77. print(" ");
  78. print(" EventSystem ");
  79. print(" --------------- ");
  80. print(" B.Y ");
  81. print(" Teddy ");
  82. print(" ___________________________________________________\n");
  83. EventInfo[EventEnabled]=0;
  84. return 1;
  85. }
  86.  
  87. public OnFilterScriptExit()
  88. {
  89. print("\n ___________________________________________________");
  90. print(" ");
  91. print(" EventSystem ");
  92. print(" --------------- ");
  93. print(" B.Y ");
  94. print(" Teddy ");
  95. print(" ___________________________________________________\n");
  96. return 1;
  97. }
  98. #endif
  99.  
  100. //==================[Deagle event]===========================//
  101. new string[256];
  102. new Name[24];
  103. CMD:startdevent(playerid, params[])
  104. {
  105. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  106. EventInfo[EventEnabled]=1;
  107. GetPlayerName(playerid, Name, sizeof(Name));
  108. format(string, 256, "{6EF83C}[Event]: Event Deagle activated by admin {FFFFFF} %s ! {6EF83C}(/joindevent) ", Name);
  109. return SendClientMessageToAll(COLOR_GREY, string);
  110. }
  111. CMD:closedevent(playerid, params[])
  112. {
  113. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  114. EventInfo[EventEnabled]=0;
  115. SetTimer(#UnfreezePlayers, (5 * 1000), false);
  116. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  117. format(string, 256, "{6EF83C}[Event]: Event Deagle dezactivated {FFFFFF} %s ! ", giveplayer, sendername, Name);
  118. return SendClientMessageToAll(COLOR_GREY, string);
  119. }
  120. CMD:joindevent(playerid, params[])
  121. {
  122. if(EventInfo[EventEnabled] == 0) return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[ERROR]: Is not a event active!!");
  123. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be out of car to use this command!");
  124. new Random = random(30);
  125. SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
  126. SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
  127. SetPlayerInterior(playerid, 1);
  128. TogglePlayerControllable(playerid, false);
  129. GivePlayerWeapon(playerid, 24, 999);
  130. SetPlayerArmour(playerid, 100);
  131. return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[Event]: Good luck at deagle !");
  132. }
  133. //==================[Molotov Cocktail event]===========================//
  134. CMD:startmcevent(playerid, params[])
  135. {
  136. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  137. EventInfo[EventEnabled]=1;
  138. GetPlayerName(playerid, Name, sizeof(Name));
  139. format(string, 256, "{6EF83C}[Event]: Event Molotov Cocktail activated by admin {FFFFFF} %s ! {6EF83C}(/joinmcevent) ", giveplayer, sendername, Name);
  140. return SendClientMessageToAll(COLOR_GREY, string);
  141. }
  142. CMD:closemcevent(playerid, params[])
  143. {
  144. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  145. EventInfo[EventEnabled]=0;
  146. SetTimer(#UnfreezePlayers, (5 * 1000), false);
  147. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  148. format(string, 256, "{6EF83C}[Event]: Event Molotov Cocktail dezactivated {FFFFFF} %s ! ", giveplayer, sendername, Name);
  149. return SendClientMessageToAll(COLOR_GREY, string);
  150. }
  151. CMD:joinmcevent(playerid, params[])
  152. {
  153. if(EventInfo[EventEnabled] == 0) return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[ERROR]: Is not a event active!!");
  154. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be out of car to use this command!");
  155. new Random = random(30);
  156. SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
  157. SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
  158. SetPlayerInterior(playerid, 1);
  159. TogglePlayerControllable(playerid, false);
  160. GivePlayerWeapon(playerid, 18, 999);
  161. SetPlayerArmour(playerid, 100);
  162. return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[Event]: Good Luck! Molotov !");
  163. }
  164. //==================[Grenade event]===========================//
  165. CMD:startgevent(playerid, params[])
  166. {
  167. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  168. EventInfo[EventEnabled]=1;
  169. GetPlayerName(playerid, Name, sizeof(Name));
  170. format(string, 256, "{6EF83C}[Event]: Grenade event activated by admin {FFFFFF} %s ! {6EF83C}(/joingevent) ", giveplayer, sendername, Name);
  171. return SendClientMessageToAll(COLOR_GREY, string);
  172. }
  173. CMD:closegevent(playerid, params[])
  174. {
  175. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  176. EventInfo[EventEnabled]=0;
  177. SetTimer(#UnfreezePlayers, (5 * 1000), false);
  178. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  179. format(string, 256, "{6EF83C}[Event]: Grenade The event has been dezactivated by{FFFFFF} %s ! ", giveplayer, sendername, Name);
  180. return SendClientMessageToAll(COLOR_GREY, string);
  181. }
  182. CMD:joingevent(playerid, params[])
  183. {
  184. if(EventInfo[EventEnabled] == 0) return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[ERROR]: Is not a event active!!");
  185. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be out of car to use this command!");
  186. new Random = random(30);
  187. SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
  188. SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
  189. SetPlayerInterior(playerid, 1);
  190. TogglePlayerControllable(playerid, false);
  191. GivePlayerWeapon(playerid, 16, 999);
  192. SetPlayerArmour(playerid, 100);
  193. return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[Event]: Good Luck! Grenade !");
  194. }
  195. //==================[Baseball Bat event]===========================//
  196. CMD:startbbevent(playerid, params[])
  197. {
  198. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  199. EventInfo[EventEnabled]=1;
  200. GetPlayerName(playerid, Name, sizeof(Name));
  201. format(string, 256, "{6EF83C}[Event]: Baseball Bat activated by admin {FFFFFF} %s ! {6EF83C}(/joinbbevent) ", giveplayer, sendername, Name);
  202. return SendClientMessageToAll(COLOR_GREY, string);
  203. }
  204. CMD:closebbevent(playerid, params[])
  205. {
  206. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  207. EventInfo[EventEnabled]=0;
  208. SetTimer(#UnfreezePlayers, (5 * 1000), false);
  209. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  210. format(string, 256, "{6EF83C}[Event]: Baseball Bat dezactivated {FFFFFF} %s ! ", giveplayer, sendername, Name);
  211. return SendClientMessageToAll(COLOR_GREY, string);
  212. }
  213. CMD:joinbbevent(playerid, params[])
  214. {
  215. if(EventInfo[EventEnabled] == 0) return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[ERROR]: Is not a event active!!");
  216. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be out of car to use this command!");
  217. new Random = random(30);
  218. SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
  219. SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
  220. SetPlayerInterior(playerid, 1);
  221. TogglePlayerControllable(playerid, false);
  222. GivePlayerWeapon(playerid, 5, 999);
  223. SetPlayerArmour(playerid, 100);
  224. return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[Event]: Good Luck! Baseball Bat !");
  225. }
  226. //==================[SMG event]===========================//
  227. CMD:startsmgevent(playerid, params[])
  228. {
  229. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  230. EventInfo[EventEnabled]=1;
  231. GetPlayerName(playerid, Name, sizeof(Name));
  232. format(string, 256, "{6EF83C}[Event]: SMG event activated by admin {FFFFFF} %s ! {6EF83C}(/joinsmgevent) ", giveplayer, sendername, Name);
  233. return SendClientMessageToAll(COLOR_GREY, string);
  234. }
  235. CMD:closesmgevent(playerid, params[])
  236. {
  237. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  238. EventInfo[EventEnabled]=0;
  239. SetTimer(#UnfreezePlayers, (5 * 1000), false);
  240. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  241. format(string, 256, "{6EF83C}[Event]: SMG The event has been dezactivated by{FFFFFF} %s ! ", giveplayer, sendername, Name);
  242. return SendClientMessageToAll(COLOR_GREY, string);
  243. }
  244. CMD:joinsmgevent(playerid, params[])
  245. {
  246. if(EventInfo[EventEnabled] == 0) return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[ERROR]: Is not a event active!!");
  247. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be out of car to use this command!");
  248. new Random = random(30);
  249. SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
  250. SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
  251. SetPlayerInterior(playerid, 1);
  252. TogglePlayerControllable(playerid, false);
  253. GivePlayerWeapon(playerid, 28, 999);
  254. SetPlayerArmour(playerid, 100);
  255. return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[Event]: Good Luck! SMG !");
  256. }
  257. //==================[Combat ShotGun event]===========================//
  258. CMD:startcsevent(playerid, params[])
  259. {
  260. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  261. EventInfo[EventEnabled]=1;
  262. GetPlayerName(playerid, Name, sizeof(Name));
  263. format(string, 256, "{6EF83C}[Event]:event activated by admin {FFFFFF} %s ! {6EF83C}(/joincsevent) ", giveplayer, sendername, Name);
  264. return SendClientMessageToAll(COLOR_GREY, string);
  265. }
  266. CMD:closecsevent(playerid, params[])
  267. {
  268. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  269. EventInfo[EventEnabled]=0;
  270. SetTimer(#UnfreezePlayers, (5 * 1000), false);
  271. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  272. format(string, 256, "{6EF83C}[Event]:The event has been dezactivated by{FFFFFF} %s ! ", giveplayer, sendername, Name);
  273. return SendClientMessageToAll(COLOR_GREY, string);
  274. }
  275. CMD:joincsevent(playerid, params[])
  276. {
  277. if(EventInfo[EventEnabled] == 0) return SendClientMessage(playerid, COLOR_GREY, "[ERROR]: Is not a event active!!");
  278. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be out of car to use this command!");
  279. new Random = random(30);
  280. SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
  281. SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
  282. SetPlayerInterior(playerid, 1);
  283. TogglePlayerControllable(playerid, false);
  284. GivePlayerWeapon(playerid, 27, 999);
  285. SetPlayerArmour(playerid, 100);
  286. return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[Event]: Good Luck!");
  287. }
  288. //==================[Liber event]===========================//
  289. CMD:startevent(playerid, params[])
  290. {
  291. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  292. EventInfo[EventEnabled]=1;
  293. GetPlayerName(playerid, Name, sizeof(Name));
  294. format(string, 256, "{6EF83C}[Event]: {FFFFFF} %s ! {6EF83C}(/joinevent) ", giveplayer, sendername, Name);
  295. return SendClientMessageToAll(COLOR_GREY, string);
  296. }
  297. CMD:closeevent(playerid, params[])
  298. {
  299. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "{F81414}You cant use this command!");
  300. EventInfo[EventEnabled]=0;
  301. SetTimer(#UnfreezePlayers, (5 * 1000), false);
  302. GetPlayerName(playa, giveplayer, sizeof(giveplayer));
  303. format(string, 256, "{6EF83C}[Event]: EVENT OFF by Admin {FFFFFF} %s ! ", giveplayer, sendername, Name);
  304. return SendClientMessageToAll(COLOR_GREY, string);
  305. }
  306. CMD:joinevent(playerid, params[])
  307. {
  308. if(EventInfo[EventEnabled] == 0) return SendClientMessage(playerid, COLOR_GREY, "[ERROR]:Is not a event active!");
  309. if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to be out of car to use this command!!");
  310. new Random = random(30);
  311. SetPlayerPos(playerid, RandomSpawns[Random][0], RandomSpawns[Random][1], RandomSpawns[Random][2]);
  312. SetPlayerFacingAngle(playerid, RandomSpawns[Random][3]);
  313. SetPlayerInterior(playerid, 1);
  314. TogglePlayerControllable(playerid, false);
  315. GivePlayerWeapon(playerid, 27, 999);
  316. SetPlayerArmour(playerid, 100);
  317. return SendClientMessage(playerid, COLOR_GREY, "{6EF83C}[Event]: Good Luck !");
  318. }
  319. CMD:eventhelp(playerid, params[])
  320. {
  321. if (PlayerInfo[playerid][pAdmin] >= 5) return SendClientMessage(playerid, COLOR_GREY, "You cant use this command!");
  322. SendClientMessage(playerid, COLOR_GREY,"{6EF83C}---------------------------------------------------------------------------");
  323. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Deagle Event]:{FFFFFF} /startdevent | /closedevent | /joindevent");
  324. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Molotov Event]: {FFFFFF}/startmcevent | /closemcevent | /joinmcevent");
  325. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Grenade Event]:{FFFFFF} /startgevent | /closegevent | /joingevent");
  326. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Baseball Event]:{FFFFFF} /startbbevent | /closebbevent | /joinbbevent");
  327. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[SMG Event]: {FFFFFF}/startsmgevent | /closesmgevent | /joinsmgevent");
  328. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[ShotGun Event]: {FFFFFF}/startcsevent | /closecsevent | /joincsevent");
  329. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Unarmed Event]: {FFFFFF}/startevent | /closeevent | /joinevent");
  330. return SendClientMessage(playerid, COLOR_GREY,"{6EF83C}--------------------------------------------------------------------");
  331. }
  332.  
  333. CMD:meventcredits(playerid, params[])
  334. {
  335. SendClientMessage(playerid, COLOR_GREY,"{6EF83C}---------------------------------------------------------------------------");
  336. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Scripter]:{FFFFFF} Teddy");
  337. SendClientMessage(playerid, COLOR_GREY,"{0049FF}[Help]: {FFFFFF} Junno ( my brother )");
  338. SendClientMessage(playerid, COLOR_GREY,"{FFFFFF}Thanks Junno for help!");
  339. SendClientMessage(playerid, COLOR_GREY,"{FFFFFF}I hope you will enjoy him!!");
  340. return SendClientMessage(playerid, COLOR_GREY,"{6EF83C}--------------------------------------------------------------------");
  341. }
  342.  
  343. public UnfreezePlayers()
  344. {
  345. for(new p; p != MAX_PLAYERS; ++p){
  346. if(IsPlayerConnected(p)){
  347. TogglePlayerControllable(p, true);
  348. SendClientMessage(p, COLOR_GREY,"{0049FF}[Info]: {FFFFFF}You have been unfreezed , good luck!");}}
  349. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement