Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2014
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.48 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 MAX_EVENTS = 1;
  18. new Events = 0;
  19.  
  20. new bobject;
  21. new barrier = 0;
  22. new MAX_BARRIER = 1;
  23. ///////////////
  24.  
  25. new VehicleList[212][] =
  26. {
  27. {"Landstalker"},
  28. {"Bravura"},
  29. {"Buffalo"},
  30. {"Linerunner"},
  31. {"Perrenial"},
  32. {"Sentinel"},
  33. {"Dumper"},
  34. {"Firetruck"},
  35. {"Trashmaster"},
  36. {"Stretch"},
  37. {"Manana"},
  38. {"Infernus"},
  39. {"Voodoo"},
  40. {"Pony"},
  41. {"Mule"},
  42. {"Cheetah"},
  43. {"Ambulance"},
  44. {"Leviathan"},
  45. {"Moonbeam"},
  46. {"Esperanto"},
  47. {"Taxi"},
  48. {"Washington"},
  49. {"Bobcat"},
  50. {"Mr Whoopee"},
  51. {"BF Injection"},
  52. {"Hunter"},
  53. {"Premier"},
  54. {"Enforcer"},
  55. {"Securicar"},
  56. {"Banshee"},
  57. {"Predator"},
  58. {"Bus"},
  59. {"Rhino"},
  60. {"Barracks"},
  61. {"Hotknife"},
  62. {"Trailer 1"},
  63. {"Previon"},
  64. {"Coach"},
  65. {"Cabbie"},
  66. {"Stallion"},
  67. {"Rumpo"},
  68. {"RC Bandit"},
  69. {"Romero"},
  70. {"Packer"},
  71. {"Monster"},
  72. {"Admiral"},
  73. {"Squalo"},
  74. {"Seasparrow"},
  75. {"Pizzaboy"},
  76. {"Tram"},
  77. {"Trailer 2"},
  78. {"Turismo"},
  79. {"Speeder"},
  80. {"Reefer"},
  81. {"Tropic"},
  82. {"Flatbed"},
  83. {"Yankee"},
  84. {"Caddy"},
  85. {"Solair"},
  86. {"Berkley's RC Van"},
  87. {"Skimmer"},
  88. {"PCJ-600"},
  89. {"Faggio"},
  90. {"Freeway"},
  91. {"RC Baron"},
  92. {"RC Raider"},
  93. {"Glendale"},
  94. {"Oceanic"},
  95. {"Sanchez"},
  96. {"Sparrow"},
  97. {"Patriot"},
  98. {"Quad"},
  99. {"Coastguard"},
  100. {"Dinghy"},
  101. {"Hermes"},
  102. {"Sabre"},
  103. {"Rustler"},
  104. {"ZR-350"},
  105. {"Walton"},
  106. {"Regina"},
  107. {"Comet"},
  108. {"BMX"},
  109. {"Burrito"},
  110. {"Camper"},
  111. {"Marquis"},
  112. {"Baggage"},
  113. {"Dozer"},
  114. {"Maverick"},
  115. {"News Chopper"},
  116. {"Rancher"},
  117. {"FBI Rancher"},
  118. {"Virgo"},
  119. {"Greenwood"},
  120. {"Jetmax"},
  121. {"Hotring"},
  122. {"Sandking"},
  123. {"Blista Compact"},
  124. {"Police Maverick"},
  125. {"Boxville"},
  126. {"Benson"},
  127. {"Mesa"},
  128. {"RC Goblin"},
  129. {"Hotring Racer A"},
  130. {"Hotring Racer B"},
  131. {"Bloodring Banger"},
  132. {"Rancher"},
  133. {"Super GT"},
  134. {"Elegant"},
  135. {"Journey"},
  136. {"Bike"},
  137. {"Mountain Bike"},
  138. {"Beagle"},
  139. {"Cropdust"},
  140. {"Stunt"},
  141. {"Tanker"},
  142. {"Roadtrain"},
  143. {"Nebula"},
  144. {"Majestic"},
  145. {"Buccaneer"},
  146. {"Shamal"},
  147. {"Hydra"},
  148. {"FCR-900"},
  149. {"NRG-500"},
  150. {"HPV1000"},
  151. {"Cement Truck"},
  152. {"Tow Truck"},
  153. {"Fortune"},
  154. {"Cadrona"},
  155. {"FBI Truck"},
  156. {"Willard"},
  157. {"Forklift"},
  158. {"Tractor"},
  159. {"Combine"},
  160. {"Feltzer"},
  161. {"Remington"},
  162. {"Slamvan"},
  163. {"Blade"},
  164. {"Freight"},
  165. {"Streak"},
  166. {"Vortex"},
  167. {"Vincent"},
  168. {"Bullet"},
  169. {"Clover"},
  170. {"Sadler"},
  171. {"Firetruck LA"},
  172. {"Hustler"},
  173. {"Intruder"},
  174. {"Primo"},
  175. {"Cargobob"},
  176. {"Tampa"},
  177. {"Sunrise"},
  178. {"Merit"},
  179. {"Utility"},
  180. {"Nevada"},
  181. {"Yosemite"},
  182. {"Windsor"},
  183. {"Monster A"},
  184. {"Monster B"},
  185. {"Uranus"},
  186. {"Jester"},
  187. {"Sultan"},
  188. {"Stratum"},
  189. {"Elegy"},
  190. {"Raindance"},
  191. {"RC Tiger"},
  192. {"Flash"},
  193. {"Tahoma"},
  194. {"Savanna"},
  195. {"Bandito"},
  196. {"Freight Flat"},
  197. {"Streak Carriage"},
  198. {"Kart"},
  199. {"Mower"},
  200. {"Duneride"},
  201. {"Sweeper"},
  202. {"Broadway"},
  203. {"Tornado"},
  204. {"AT-400"},
  205. {"DFT-30"},
  206. {"Huntley"},
  207. {"Stafford"},
  208. {"BF-400"},
  209. {"Newsvan"},
  210. {"Tug"},
  211. {"Trailer 3"},
  212. {"Emperor"},
  213. {"Wayfarer"},
  214. {"Euros"},
  215. {"Hotdog"},
  216. {"Club"},
  217. {"Freight Carriage"},
  218. {"Trailer 3"},
  219. {"Andromada"},
  220. {"Dodo"},
  221. {"RC Cam"},
  222. {"Launch"},
  223. {"Police Car (LSPD)"},
  224. {"Police Car (SFPD)"},
  225. {"Police Car (LVPD)"},
  226. {"Police Ranger"},
  227. {"Picador"},
  228. {"S.W.A.T. Van"},
  229. {"Alpha"},
  230. {"Phoenix"},
  231. {"Glendale"},
  232. {"Sadler"},
  233. {"Luggage Trailer A"},
  234. {"Luggage Trailer B"},
  235. {"Stair Trailer"},
  236. {"Boxville"},
  237. {"Farm Plow"},
  238. {"Utility Trailer"}
  239. };
  240. /////////
  241.  
  242.  
  243. public OnFilterScriptInit()
  244. {
  245. print("\n--------------------------------------");
  246. print(" Event System By Ahmed_Nezoo");
  247. print("--------------------------------------\n");
  248. return 1;
  249. }
  250.  
  251. public OnFilterScriptExit()
  252. {
  253. return 1;
  254. }
  255.  
  256. stock GetVehicleModelIDFromName(name[])
  257. {
  258. for(new i = 0; i < 211; i++)
  259. {
  260. if(strfind(VehicleList[i], name, true) != -1) return i + 400;
  261. }
  262. return -1;
  263. }
  264.  
  265. //Event System
  266. CMD:crevent(playerid, params[])
  267. {
  268. if(MAX_EVENTS > Events)
  269. {
  270. Events++;
  271. SetPlayerVirtualWorld(playerid, 1);
  272. SendClientMessage(playerid, COLOR_GREEN, "An event created !");
  273. }
  274. else
  275. {
  276. SendClientMessage(playerid, COLOR_RED, "Sorry there is an event right now !");
  277. SetPlayerVirtualWorld(playerid, 0);
  278. }
  279. return 1;
  280. }
  281.  
  282. CMD:finish(playerid, params[])
  283. {
  284. if(Events > 0)
  285. {
  286. Events -= 1;
  287. SendClientMessage(playerid, COLOR_GREEN, "Event finsihed !");
  288. SetPlayerVirtualWorld(playerid, 0);
  289. }
  290. else
  291. {
  292. SendClientMessage(playerid, COLOR_RED, "There isn't any running event !");
  293. }
  294. return 1;
  295. }
  296.  
  297. CMD:join(playerid, params[])
  298. {
  299. new world = GetPlayerVirtualWorld(playerid);
  300. if(Events == 0)
  301. {
  302. SendClientMessage(playerid, COLOR_RED, "There isn't any hosted event right now !");
  303. }
  304. else if(world == 1)
  305. {
  306. SendClientMessage(playerid, COLOR_RED, "You are already in an event !");
  307. }
  308. else
  309. {
  310. SetPlayerVirtualWorld(playerid, 1);
  311. SendClientMessage(playerid, COLOR_GREEN, "You have joined an event !");
  312. }
  313. return 1;
  314. }
  315.  
  316. CMD:leave(playerid, params[])
  317. {
  318. new world = GetPlayerVirtualWorld(playerid);
  319.  
  320. if(world != 0)
  321. {
  322. SetPlayerHealth(playerid, 0);
  323. SetPlayerVirtualWorld(playerid, 0);
  324.  
  325. }
  326. else
  327. {
  328. SendClientMessage(playerid, COLOR_RED, "You didn't join any event !");
  329. }
  330. return 1;
  331. }
  332.  
  333.  
  334. CMD:ev(playerid, params[])
  335. {
  336. new world = GetPlayerVirtualWorld(playerid);
  337. if(world != 0)
  338. {
  339. new color1, color2, id[128], string[144];
  340. if(sscanf(params, "s[64]dd", id, color1, color2)) return SendClientMessage(playerid, ~1, "{FF0000}|!| {FF9500}Usage: {FFFFFF}/spawncar (Name) (color1) (color2)");
  341. new car = GetVehicleModelIDFromName(id);
  342. if(car < 400 || car > 611) return SendClientMessage(playerid, ~1, "Vehicle ID can't be below {FF0000}400 {FFFFFF}or above {FF0000}611");
  343.  
  344. new Float:X, Float:Y, Float:Z, Float:A;
  345. GetPlayerPos(playerid, X, Y, Z);
  346. GetPlayerFacingAngle(playerid, A);
  347. X += (5 * floatsin(-A, degrees));
  348. Y += (5 * floatcos(-A, degrees));
  349. new cars = CreateVehicle(car, X, Y, Z, 0.0, color1, color2, -1);
  350. new pint = GetPlayerInterior(playerid);
  351. LinkVehicleToInterior(cars, pint);
  352. new pworld = GetPlayerVirtualWorld(playerid);
  353. SetVehicleVirtualWorld(cars, pworld);
  354. format(string, sizeof string, "Vehicle {FF9500}%s(%d) {FFFFFF}spawned.", VehicleList[GetVehicleModel(cars)-400], cars);
  355. SendClientMessage(playerid, ~1, string);
  356. printf(string);
  357.  
  358. }
  359. else
  360. {
  361. SendClientMessage(playerid, COLOR_RED, "You can't use this command right now !");
  362. }
  363.  
  364. return 1;
  365. }
  366.  
  367. CMD:rev(playerid, params[])
  368. {
  369. new world = GetPlayerVirtualWorld(playerid);
  370. if(world != 0)
  371. {
  372. new vehicleid;
  373. vehicleid= GetPlayerVehicleID(playerid);
  374. DestroyVehicle(vehicleid);
  375. }
  376. else
  377. {
  378. SendClientMessage(playerid, COLOR_RED, "You can't use this command right now !");
  379. }
  380. return 1;
  381. }
  382.  
  383.  
  384.  
  385.  
  386.  
  387. CMD:barrier(playerid, params[])
  388. {
  389. new world = GetPlayerVirtualWorld(playerid);
  390.  
  391. if(MAX_BARRIER >= barrier && world != 0)
  392. {
  393. new Float:x, Float:y, Float:z;
  394. new Float:a;
  395. GetPlayerPos(playerid, x, y, z);
  396. GetPlayerFacingAngle(playerid, a);
  397. bobject = CreateObject(978, x+5,y,z,0,0,a);
  398. SendClientMessage(playerid, -1, "You have spawned a barrier. Don't forget to remove it before starting the event !");
  399. barrier++;
  400. return 1;
  401. }
  402. else
  403. {
  404. SendClientMessage(playerid, COLOR_RED, "You can't use this command right now !");
  405. }
  406. return 1;
  407. }
  408.  
  409.  
  410. CMD:rbarrier(playerid,params[])
  411. {
  412. if(barrier == 1)
  413. {
  414. DestroyObject(bobject);
  415. SendClientMessage(playerid, -1, "You have removed the barrier");
  416. }
  417. else
  418. {
  419. SendClientMessage(playerid, COLOR_RED, "You didn't spawn a barrier !");
  420. }
  421. return 1;
  422. }
  423.  
  424. CMD:eweapon(playerid, params[])
  425. {
  426. for(new i = 0; i < MAX_PLAYERS; i++)
  427. if(GetPlayerVirtualWorld(i)!= 0)
  428. {
  429.  
  430. new gun;
  431. new ammo;
  432. if(sscanf(params,"ii", gun, ammo)) return SendClientMessage(playerid, -1,"USAGE: /eweapon [gunid] [ammo]");
  433. if(gun > 47 || gun < 1) return SendClientMessage(playerid, -1,"GUN ID'S: 1-47");
  434. if(ammo > 15000 || ammo < 1) return SendClientMessage(playerid, -1,"Ammo 1-15000");
  435. GivePlayerWeapon(i, gun, ammo);
  436. }
  437. else
  438. {
  439. new id, string[144];
  440. id = strval(params);
  441. new Float:pos[3];
  442. GetPlayerPos(id, pos[0], pos[1], pos[2]);
  443. SetPlayerPos(id, pos[0], pos[1], pos[2] + 10.0);
  444. PlayerPlaySound(id, 1190, pos[0], pos[1], pos[2]);
  445. }
  446.  
  447. return 1;
  448.  
  449.  
  450. }
  451. CMD:earmour(playerid, params[])
  452. {
  453. for(new i = 0; i < MAX_PLAYERS; i++)
  454. if(GetPlayerVirtualWorld(i)!= 0)
  455. {
  456. SetPlayerArmour(playerid, 100.0);
  457. }
  458.  
  459. else
  460. {
  461. //////
  462. }
  463.  
  464. return 1;
  465.  
  466.  
  467. }
  468.  
  469.  
  470. CMD:ehealth(playerid, params[])
  471. {
  472. for(new i = 0; i < MAX_PLAYERS; i++)
  473. if(GetPlayerVirtualWorld(i)!= 0)
  474. {
  475. SetPlayerHealth(playerid, 100.0);
  476. }
  477.  
  478. else
  479. {
  480. //////
  481. }
  482.  
  483. return 1;
  484.  
  485.  
  486. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement