Advertisement
Guest User

Untitled

a guest
Jul 6th, 2015
943
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.32 KB | None | 0 0
  1. ///////////////////////////////////////
  2. ///////////Events System//////////////
  3. ////////Made By Ahmed_Nezoo////////
  4. ////////////////////////////////////
  5. #define FILTERSCRIPT
  6.  
  7. #include <a_samp>
  8. #include <zcmd>
  9. #include <sscanf2>
  10.  
  11. #if defined FILTERSCRIPT
  12. #endif
  13. ////////////////
  14. #define COLOR_RED 0xFF0000AA
  15. #define COLOR_GREEN 0x00FF00FF
  16. ////////////////
  17. new bool:Event;
  18. new bool:Eopend;
  19. new bool:InEvent[MAX_PLAYERS];
  20. new bool:mute[MAX_PLAYERS];
  21. ///////////////
  22.  
  23. new VehicleList[212][] =
  24. {
  25. {"Landstalker"},
  26. {"Bravura"},
  27. {"Buffalo"},
  28. {"Linerunner"},
  29. {"Perrenial"},
  30. {"Sentinel"},
  31. {"Dumper"},
  32. {"Firetruck"},
  33. {"Trashmaster"},
  34. {"Stretch"},
  35. {"Manana"},
  36. {"Infernus"},
  37. {"Voodoo"},
  38. {"Pony"},
  39. {"Mule"},
  40. {"Cheetah"},
  41. {"Ambulance"},
  42. {"Leviathan"},
  43. {"Moonbeam"},
  44. {"Esperanto"},
  45. {"Taxi"},
  46. {"Washington"},
  47. {"Bobcat"},
  48. {"Mr Whoopee"},
  49. {"BF Injection"},
  50. {"Hunter"},
  51. {"Premier"},
  52. {"Enforcer"},
  53. {"Securicar"},
  54. {"Banshee"},
  55. {"Predator"},
  56. {"Bus"},
  57. {"Rhino"},
  58. {"Barracks"},
  59. {"Hotknife"},
  60. {"Trailer 1"},
  61. {"Previon"},
  62. {"Coach"},
  63. {"Cabbie"},
  64. {"Stallion"},
  65. {"Rumpo"},
  66. {"RC Bandit"},
  67. {"Romero"},
  68. {"Packer"},
  69. {"Monster"},
  70. {"Admiral"},
  71. {"Squalo"},
  72. {"Seasparrow"},
  73. {"Pizzaboy"},
  74. {"Tram"},
  75. {"Trailer 2"},
  76. {"Turismo"},
  77. {"Speeder"},
  78. {"Reefer"},
  79. {"Tropic"},
  80. {"Flatbed"},
  81. {"Yankee"},
  82. {"Caddy"},
  83. {"Solair"},
  84. {"Berkley's RC Van"},
  85. {"Skimmer"},
  86. {"PCJ-600"},
  87. {"Faggio"},
  88. {"Freeway"},
  89. {"RC Baron"},
  90. {"RC Raider"},
  91. {"Glendale"},
  92. {"Oceanic"},
  93. {"Sanchez"},
  94. {"Sparrow"},
  95. {"Patriot"},
  96. {"Quad"},
  97. {"Coastguard"},
  98. {"Dinghy"},
  99. {"Hermes"},
  100. {"Sabre"},
  101. {"Rustler"},
  102. {"ZR-350"},
  103. {"Walton"},
  104. {"Regina"},
  105. {"Comet"},
  106. {"BMX"},
  107. {"Burrito"},
  108. {"Camper"},
  109. {"Marquis"},
  110. {"Baggage"},
  111. {"Dozer"},
  112. {"Maverick"},
  113. {"News Chopper"},
  114. {"Rancher"},
  115. {"FBI Rancher"},
  116. {"Virgo"},
  117. {"Greenwood"},
  118. {"Jetmax"},
  119. {"Hotring"},
  120. {"Sandking"},
  121. {"Blista Compact"},
  122. {"Police Maverick"},
  123. {"Boxville"},
  124. {"Benson"},
  125. {"Mesa"},
  126. {"RC Goblin"},
  127. {"Hotring Racer A"},
  128. {"Hotring Racer B"},
  129. {"Bloodring Banger"},
  130. {"Rancher"},
  131. {"Super GT"},
  132. {"Elegant"},
  133. {"Journey"},
  134. {"Bike"},
  135. {"Mountain Bike"},
  136. {"Beagle"},
  137. {"Cropdust"},
  138. {"Stunt"},
  139. {"Tanker"},
  140. {"Roadtrain"},
  141. {"Nebula"},
  142. {"Majestic"},
  143. {"Buccaneer"},
  144. {"Shamal"},
  145. {"Hydra"},
  146. {"FCR-900"},
  147. {"NRG-500"},
  148. {"HPV1000"},
  149. {"Cement Truck"},
  150. {"Tow Truck"},
  151. {"Fortune"},
  152. {"Cadrona"},
  153. {"FBI Truck"},
  154. {"Willard"},
  155. {"Forklift"},
  156. {"Tractor"},
  157. {"Combine"},
  158. {"Feltzer"},
  159. {"Remington"},
  160. {"Slamvan"},
  161. {"Blade"},
  162. {"Freight"},
  163. {"Streak"},
  164. {"Vortex"},
  165. {"Vincent"},
  166. {"Bullet"},
  167. {"Clover"},
  168. {"Sadler"},
  169. {"Firetruck LA"},
  170. {"Hustler"},
  171. {"Intruder"},
  172. {"Primo"},
  173. {"Cargobob"},
  174. {"Tampa"},
  175. {"Sunrise"},
  176. {"Merit"},
  177. {"Utility"},
  178. {"Nevada"},
  179. {"Yosemite"},
  180. {"Windsor"},
  181. {"Monster A"},
  182. {"Monster B"},
  183. {"Uranus"},
  184. {"Jester"},
  185. {"Sultan"},
  186. {"Stratum"},
  187. {"Elegy"},
  188. {"Raindance"},
  189. {"RC Tiger"},
  190. {"Flash"},
  191. {"Tahoma"},
  192. {"Savanna"},
  193. {"Bandito"},
  194. {"Freight Flat"},
  195. {"Streak Carriage"},
  196. {"Kart"},
  197. {"Mower"},
  198. {"Duneride"},
  199. {"Sweeper"},
  200. {"Broadway"},
  201. {"Tornado"},
  202. {"AT-400"},
  203. {"DFT-30"},
  204. {"Huntley"},
  205. {"Stafford"},
  206. {"BF-400"},
  207. {"Newsvan"},
  208. {"Tug"},
  209. {"Trailer 3"},
  210. {"Emperor"},
  211. {"Wayfarer"},
  212. {"Euros"},
  213. {"Hotdog"},
  214. {"Club"},
  215. {"Freight Carriage"},
  216. {"Trailer 3"},
  217. {"Andromada"},
  218. {"Dodo"},
  219. {"RC Cam"},
  220. {"Launch"},
  221. {"Police Car (LSPD)"},
  222. {"Police Car (SFPD)"},
  223. {"Police Car (LVPD)"},
  224. {"Police Ranger"},
  225. {"Picador"},
  226. {"S.W.A.T. Van"},
  227. {"Alpha"},
  228. {"Phoenix"},
  229. {"Glendale"},
  230. {"Sadler"},
  231. {"Luggage Trailer A"},
  232. {"Luggage Trailer B"},
  233. {"Stair Trailer"},
  234. {"Boxville"},
  235. {"Farm Plow"},
  236. {"Utility Trailer"}
  237. };
  238. /////////
  239.  
  240.  
  241. public OnFilterScriptInit()
  242. {
  243. print("\n--------------------------------------");
  244. print(" Event System By Ahmed_Nezoo");
  245. print("--------------------------------------\n");
  246. return 1;
  247. }
  248.  
  249. public OnFilterScriptExit()
  250. {
  251. return 1;
  252. }
  253.  
  254. public OnPlayerText(playerid, text[])
  255. {
  256. if(mute[playerid] == true)
  257. {
  258. SendClientMessage(playerid, COLOR_RED, "You are still muted! You can't chat with others");
  259. return 0;
  260. }
  261. return 1;
  262. }
  263. stock GetVehicleModelIDFromName(name[])
  264. {
  265. for(new i = 0; i < 211; i++)
  266. {
  267. if(strfind(VehicleList[i], name, true) != -1) return i + 400;
  268. }
  269. return -1;
  270. }
  271.  
  272. CMD:crevent(playerid, params[])
  273. {
  274. if(Event == true) return SendClientMessage(playerid, COLOR_RED, "There is an event right now");
  275. Eopend = false;
  276. SetPlayerVirtualWorld(playerid, 1);
  277. SendClientMessage(playerid, COLOR_GREEN, "An event created! use /eopen to enable players to join");
  278. Event = true;
  279. InEvent[playerid] = true;
  280. return 1;
  281. }
  282.  
  283. CMD:finish(playerid, params[])
  284. {
  285. if(Event == false) return SendClientMessage(playerid, COLOR_RED, "There isn't any running event!");
  286. Event = false;
  287. SendClientMessage(playerid, COLOR_GREEN, "Event finsihed!");
  288. for(new i = 0; i < MAX_PLAYERS; i++)
  289. {
  290. if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  291. {
  292. SetPlayerHealth(i, 0);
  293. SetPlayerVirtualWorld(i, 0);
  294. InEvent[i] = false;
  295. }
  296. }
  297. for(new x = 1; x <= MAX_VEHICLES;x++)
  298. {
  299. if(GetVehicleVirtualWorld(x) == GetPlayerVirtualWorld(playerid))
  300. {
  301. DestroyVehicle(x);
  302. }
  303. }
  304. Eopend = false;
  305. return 1;
  306. }
  307.  
  308. CMD:join(playerid, params[])
  309. {
  310.  
  311. if(Event == false) return SendClientMessage(playerid, COLOR_RED, "There isn't any hosted event right now !");
  312. if(InEvent[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You are already in an event !");
  313. if(Eopend == false) return SendClientMessage(playerid, COLOR_RED, "The event is closed!");
  314. SetPlayerVirtualWorld(playerid, 1);
  315. SendClientMessage(playerid, COLOR_GREEN, "You have joined an event!");
  316. InEvent[playerid] = true;
  317. return 1;
  318. }
  319.  
  320. CMD:leave(playerid, params[])
  321. {
  322. if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in event to leave it!");
  323. SetPlayerHealth(playerid, 0);
  324. SetPlayerVirtualWorld(playerid, 0);
  325. InEvent[playerid] = false;
  326. return 1;
  327. }
  328.  
  329. CMD:eweapon(playerid, params[])
  330. {
  331. new gunid;
  332. new ammo;
  333. if(sscanf(params, "ii", gunid, ammo)) return SendClientMessage(playerid, COLOR_RED, "Give all player in the event gun: /egun [Gun ID] (Ammo)");
  334. if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in an event");
  335. for(new i = 0; i < MAX_PLAYERS;i++)
  336. {
  337. if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  338. {
  339. GivePlayerWeapon(i, gunid, ammo);
  340. }
  341. }
  342. return 1;
  343. }
  344. CMD:earmour(playerid, params[])
  345. {
  346. if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in an event");
  347. for(new i = 0; i < MAX_PLAYERS; i++)
  348. {
  349. if(GetPlayerVirtualWorld(i) == playerid)
  350. {
  351. SetPlayerArmour(i, 100.0);
  352. }
  353. }
  354. return 1;
  355. }
  356.  
  357.  
  358. CMD:ehealth(playerid, params[])
  359. {
  360. if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in an event");
  361. for(new i = 0; i < MAX_PLAYERS; i++)
  362. {
  363. if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  364. {
  365. SetPlayerHealth(i, 100.0);
  366. }
  367. }
  368. return 1;
  369. }
  370.  
  371.  
  372. CMD:rv(playerid, params[])
  373. {
  374. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't in any vehicle");
  375. new veh = GetPlayerVehicleID(playerid);
  376. DestroyVehicle(veh);
  377. return 1;
  378. }
  379.  
  380. CMD:eopen(playerid, params[])
  381. {
  382. if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You didn't join any event to open it !");
  383. if(Eopend == true) return SendClientMessage(playerid, COLOR_RED, "You already opened the event");
  384. Eopend = true;
  385. SendClientMessage(playerid, COLOR_GREEN, "Event Opened !");
  386. return 1;
  387. }
  388.  
  389.  
  390. CMD:eclose(playerid, params[])
  391. {
  392. if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You didn't join any event to close it !");
  393. if(Eopend == false) return SendClientMessage(playerid, COLOR_RED, "The event is already closed!");
  394. Eopend = false;
  395. SendClientMessage(playerid, COLOR_GREEN, "Event Closed!");
  396. return 1;
  397. }
  398.  
  399. forward unmute(playerid);
  400. public unmute(playerid)
  401. {
  402. mute[playerid] = false;
  403. SendClientMessage(playerid, COLOR_RED, "Unmuted !");
  404. return 1;
  405. }
  406.  
  407. CMD:emute(playerid, params[])
  408. {
  409. new targetid;
  410. new time;
  411. if(sscanf(params,"ui", targetid, time)) return SendClientMessage(playerid, -1, "Usage: /emute [ID] (Time)");
  412. if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in a event");
  413. if(InEvent[targetid] == false) return SendClientMessage(playerid, COLOR_RED, "This player is not in the event");
  414. if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
  415. new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
  416. GetPlayerName(playerid, name, sizeof(name));
  417. if(mute[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "%s has already muted");
  418. mute[targetid] = true;
  419. format(string, sizeof(string), "%s muted from talking in the event for %i.", name, time);
  420. SendClientMessageToAll(COLOR_RED, string);
  421. SetTimerEx("unmute", time*60000, false, "i", targetid);
  422. return 1;
  423. }
  424.  
  425. CMD:ec(playerid, params[])
  426. {
  427. new msg[128];
  428. if(sscanf(params, "s[128]", msg)) return SendClientMessage(playerid, COLOR_RED, "Talk in the event: /ec [Message]");
  429. if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in an event!");
  430. if(mute[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You muted from talking in the event");
  431. new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
  432. GetPlayerName(playerid, name, sizeof(name));
  433. for(new i = 0; i < MAX_PLAYERS; i++)
  434. {
  435. if(InEvent[i] == true)
  436. {
  437. format(string,sizeof(string),"%s: %s",name,msg);
  438. SendClientMessage(i, 0xE0427F80, string);
  439. }
  440. }
  441. return 1;
  442. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement