Guest User

Untitled

a guest
Aug 28th, 2016
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.29 KB | None | 0 0
  1. /*
  2. †††††††††††††††† [GunGame System V 2.1] ††††††††††††††††
  3. Good Luck With It !
  4. ***********************************
  5. *** Created By [R]amin_ **
  6. ***********************************
  7. I Hope This Gun Game FilterScript Will be usefull for you
  8. †††††††††††††††† [GunGame System V 2.1] ††††††††††††††††
  9. */
  10. /*
  11. You Can Use These If You Want
  12. PlayerPlaySound(playerid,1068,0.0,0.0,0.0); duel start
  13. PlayerPlaySound(playerid,1069,0.0,0.0,0.0); duel stop
  14. PlayerPlaySound(playerid,1097,0.0,0.0,0.0); winner start
  15. PlayerPlaySound(playerid,1098,0.0,0.0,0.0); winner stop
  16. PlayerPlaySound(playerid,1083,0.0,0.0,0.0); Select Dialog
  17. */
  18.  
  19. #include <a_samp>
  20. #include <sscanf2>
  21. #include <Zcmd>
  22.  
  23. #define FILTERSCRIPT
  24.  
  25. #define COLOR_RED 0xAA3333AA
  26. #define COLOR_LIGHTRED 0xFF6347AA
  27. #define COLOR_LIGHTBLUE 0x33CCFFAA
  28. #define COLOR_YELLOW 0xFFFF00AA
  29. #define COLOR_WHITE 0xFFFFFFAA
  30.  
  31. #define COL_WHITE "{FFFFFF}"
  32. #define COL_RED "{F81414}"
  33. #define COL_YELLOW "{F3FF02}"
  34. #define COL_LRED "{FFA1A1}"
  35.  
  36. #define Dialog_GunGame 2001
  37. #define Dialog_GGBase 2002
  38. #define Dialog_GGArmor 2003
  39. #define Dialog_GGPrize 2004
  40. #define Dialog_GGPLimit 2005
  41.  
  42. forward GunGamePrepare();
  43. forward GunGameStart();
  44. forward GunGameEnd();
  45.  
  46. new PlayerGGKills[MAX_PLAYERS];
  47. new GGWinnerID = 999;
  48. new GGWinnerKills;
  49. new GGPlayers;
  50. new GGWinnerPrize;
  51. new bool:GGArmored;
  52. new bool:GGStarted;
  53. new bool:IsInGG[MAX_PLAYERS];
  54. new bool:IsGGHuge;
  55. new bool:IsAnyGG;
  56. new bool:IsGGNormal;
  57. new bool:IsGGSmall;
  58. new bool:IsSpecingGG[MAX_PLAYERS];
  59. new GGPlayerLimit;
  60. new PlayerGGWeapon[MAX_PLAYERS];
  61. new GGAdminid = 999;
  62. new GGPreTimer;
  63.  
  64. new GGSkins[] =
  65. {
  66. 137,
  67. 181,
  68. 212
  69. };
  70.  
  71. new Float:GGHugeSp[][] =
  72. {
  73. {-1365.6370,931.1339,1036.3071,352.7964},
  74. {-1311.4410,946.0482,1036.4771,32.5589},
  75. {-1275.4701,995.0630,1037.2329,85.5754},
  76. {-1303.2987,1040.6611,1038.0431,143.2554},
  77. {-1303.2987,1040.6611,1038.0431,143.2554},
  78. {-1279.7277,1007.9163,1037.4525,91.4661},
  79. {-1347.5392,1056.2308,1038.3749,165.4683},
  80. {-1406.7548,1059.8137,1038.5405,188.4176},
  81. {-1406.7548,1059.8137,1038.5405,188.4176},
  82. {-1363.5107,1059.4454,1038.4613,168.4137},
  83. {-1443.3496,1057.9875,1038.5675,195.9038},
  84. {-1482.1045,1047.2584,1038.4646,214.5578},
  85. {-1515.5001,1009.6786,1037.8917,262.5427},
  86. {-1511.8203,971.4282,1037.2567,297.6416},
  87. {-1482.3848,948.8790,1036.7982,331.0224},
  88. {-1462.9504,934.6046,1036.5898,342.3129},
  89. {-1443.3665,933.4116,1036.4974,353.3582},
  90. {-1424.1276,932.0661,1036.4058,357.4079},
  91. {-1389.7131,935.9854,1036.4299,8.6986},
  92. {-1440.0103,996.4330,1024.1982,87.2415},
  93. {-1393.7437,997.6558,1024.1277,179.9061},
  94. {-1346.6505,998.0483,1024.0538,269.9061}
  95. };
  96.  
  97. new Float:GGNormalSp[][] =
  98. {
  99. {-1486.5941,1567.7218,1052.5313,319.5384},
  100. {-1494.0847,1563.3784,1052.5313,358.0213},
  101. {-1487.4187,1634.1917,1052.5313,273.0966},
  102. {-1452.7310,1628.3412,1054.4141,273.1483},
  103. {-1418.4728,1615.4061,1052.5313,279.7754},
  104. {-1395.5817,1653.1403,1052.5313,184.5419},
  105. {-1359.2196,1638.7040,1053.1034,258.4213},
  106. {-1374.7731,1623.2323,1052.5313,93.0255},
  107. {-1352.6407,1580.1671,1052.5313,168.5005},
  108. {-1377.2875,1561.7327,1052.5313,2.3683},
  109. {-1431.1586,1580.7185,1052.5313,243.6946},
  110. {-1431.0129,1580.8337,1055.7191,357.0211}
  111. };
  112.  
  113. new Float:GGSmallSp[][] =
  114. {
  115. {-1401.6968,107.1886,1032.2734,184.1404},
  116. {-1384.2694,127.4698,1030.7107,134.1920},
  117. {-1387.5258,84.2175,1031.0518,27.6681},
  118. {-1425.6036,82.0811,1031.1155,301.2708},
  119. {-1419.6563,127.9759,1030.7197,221.3775}
  120. };
  121.  
  122. #if defined FILTERSCRIPT
  123.  
  124. public OnFilterScriptInit()
  125. {
  126. print("\n--------------------------------------");
  127. print(" This FilterScript Has Been Made By [R]amin_");
  128. print(" Conntect me on :");
  129. print(" [email protected]");
  130. print(" [email protected]");
  131. print("--------------------------------------\n");
  132.  
  133. GGStarted = false;
  134. IsAnyGG = false;
  135. GGArmored = false;
  136. IsGGHuge = false;
  137. IsGGSmall = false;
  138. IsGGNormal = false;
  139.  
  140. return 1;
  141. }
  142.  
  143. public OnFilterScriptExit()
  144. {
  145. return 1;
  146. }
  147.  
  148. #endif
  149.  
  150. public OnPlayerConnect(playerid)
  151. {
  152. IsInGG[playerid] = false;
  153. PlayerGGKills[playerid] = 0;
  154. PlayerGGWeapon[playerid] = 999;
  155. IsSpecingGG[playerid] = false;
  156.  
  157. return 1;
  158. }
  159.  
  160. public OnPlayerDisconnect(playerid, reason)
  161. {
  162. if(IsInGG[playerid] == true)
  163. {
  164. GGPlayers--;
  165. }
  166. return 1;
  167. }
  168.  
  169. public OnPlayerSpawn(playerid)
  170. {
  171. if(IsInGG[playerid] == true)
  172. {
  173. new RandomSkin = random(sizeof(GGSkins));
  174. if(IsGGHuge == true)
  175. {
  176. new RandomSpawn = random(sizeof(GGHugeSp));
  177. SetPlayerInterior(playerid,15);
  178. SetPlayerSkin(playerid,GGSkins[RandomSkin]);
  179. SetPlayerPos(playerid,GGHugeSp[RandomSpawn][0],GGHugeSp[RandomSpawn][1],GGHugeSp[RandomSpawn][2]);
  180. SetPlayerFacingAngle(playerid,GGHugeSp[RandomSpawn][3]);
  181. SetPlayerHealth(playerid,100.0);
  182. ResetPlayerWeapons(playerid);
  183. GivePlayerWeapon(playerid,PlayerGGWeapon[playerid],99999);
  184. if(GGArmored == true)
  185. {
  186. SetPlayerArmour(playerid,50.0);
  187. }
  188.  
  189. }
  190. if(IsGGNormal == true)
  191. {
  192. new RandomSpawn = random(sizeof(GGNormalSp));
  193. SetPlayerInterior(playerid,14);
  194. SetPlayerSkin(playerid,GGSkins[RandomSkin]);
  195. SetPlayerPos(playerid,GGNormalSp[RandomSpawn][0],GGNormalSp[RandomSpawn][1],GGNormalSp[RandomSpawn][2]);
  196. SetPlayerFacingAngle(playerid,GGNormalSp[RandomSpawn][3]);
  197. SetPlayerHealth(playerid,100.0);
  198. ResetPlayerWeapons(playerid);
  199. GivePlayerWeapon(playerid,PlayerGGWeapon[playerid],99999);
  200. if(GGArmored == true)
  201. {
  202. SetPlayerArmour(playerid,50.0);
  203. }
  204. }
  205. if(IsGGSmall == true)
  206. {
  207. new RandomSpawn = random(sizeof(GGSmallSp));
  208. SetPlayerInterior(playerid,1);
  209. SetPlayerSkin(playerid,GGSkins[RandomSkin]);
  210. SetPlayerPos(playerid,GGSmallSp[RandomSpawn][0],GGSmallSp[RandomSpawn][1],GGSmallSp[RandomSpawn][2]);
  211. SetPlayerFacingAngle(playerid,GGSmallSp[RandomSpawn][3]);
  212. SetPlayerHealth(playerid,100.0);
  213. ResetPlayerWeapons(playerid);
  214. GivePlayerWeapon(playerid,PlayerGGWeapon[playerid],99999);
  215. if(GGArmored == true)
  216. {
  217. SetPlayerArmour(playerid,50.0);
  218. }
  219. }
  220. }
  221. return 1;
  222. }
  223.  
  224. public OnPlayerDeath(playerid, killerid, reason)
  225. {
  226. if(IsInGG[killerid] == true)
  227. {
  228. new string[128],pName[MAX_PLAYER_NAME];
  229. GetPlayerName(killerid,pName,sizeof(pName));
  230. PlayerGGKills[killerid]++;
  231. if(PlayerGGKills[killerid] == 5)
  232. {
  233. ResetPlayerWeapons(killerid);
  234. PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  235. PlayerGGWeapon[killerid] = 25;
  236. GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  237. SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 2, Your Gun Is Shotgun Now");
  238. }
  239. if(PlayerGGKills[killerid] == 10)
  240. {
  241. ResetPlayerWeapons(killerid);
  242. PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  243. PlayerGGWeapon[killerid] = 28;
  244. GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  245. SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 3, Your Gun Is Uzi Now");
  246. }
  247. if(PlayerGGKills[killerid] == 15)
  248. {
  249. ResetPlayerWeapons(killerid);
  250. PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  251. PlayerGGWeapon[killerid] = 31;
  252. GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  253. SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 4, Your Gun Is M4 Now");
  254. }
  255. if(PlayerGGKills[killerid] == 20)
  256. {
  257. ResetPlayerWeapons(killerid);
  258. PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  259. PlayerGGWeapon[killerid] = 34;
  260. GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  261. SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 5, Your Gun Is Sniper Now");
  262. }
  263. if(PlayerGGKills[killerid] == 25)
  264. {
  265. ResetPlayerWeapons(killerid);
  266. PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  267. PlayerGGWeapon[killerid] = 16;
  268. GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  269. SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 6, Your Gun Is Grenade Now");
  270. }
  271. if(PlayerGGKills[killerid] == 26)
  272. {
  273. ResetPlayerWeapons(killerid);
  274. PlayerPlaySound(playerid,1138,0.0,0.0,0.0);
  275. PlayerGGWeapon[killerid] = 9;
  276. GivePlayerWeapon(killerid,PlayerGGWeapon[killerid],9999);
  277. SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 7, Your Gun Is ChainSaw Now");
  278. }
  279. if(PlayerGGKills[killerid] == 27)
  280. {
  281. for(new i=0;i<MAX_PLAYERS;i++)
  282. {
  283. if(IsInGG[i] == true)
  284. {
  285. PlayerPlaySound(i,1097,0.0,0.0,0.0);
  286. }
  287. }
  288. ResetPlayerWeapons(killerid);
  289. GGWinnerID = killerid;
  290. SendClientMessage(killerid,COLOR_YELLOW,"You Are Level 8, Your The Winner Of This GunGame");
  291. SetTimer("GunGameEnd",200,false);
  292. }
  293. if(PlayerGGKills[killerid] > GGWinnerKills)
  294. {
  295. GGWinnerKills = PlayerGGKills[killerid];
  296. GGWinnerID = killerid;
  297. format(string,sizeof(string),"The Player "COL_RED"%s(%d) "COL_WHITE"Is In Lead With "COL_RED"%d "COL_WHITE" Kills",pName,killerid,PlayerGGKills[killerid]);
  298. for(new i=0;i<MAX_PLAYERS;i++)
  299. {
  300. if(IsInGG[i])
  301. {
  302. SendClientMessage(i,COLOR_WHITE,string);
  303. }
  304. }
  305. }
  306. }
  307. return 1;
  308. }
  309.  
  310. public OnPlayerCommandText(playerid, cmdtext[])
  311. {
  312. return 1;
  313. }
  314.  
  315. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  316. {
  317. return 1;
  318. }
  319.  
  320. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  321. {
  322. if(dialogid == Dialog_GunGame)
  323. {
  324. if(response)
  325. {
  326. PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  327. ShowPlayerDialog(playerid,Dialog_GGBase,2,"Select Gun Game Base:","Small Base\nNormal Base\nHuge Base","Select","Quit");
  328. }
  329. }
  330. if(dialogid == Dialog_GGBase)
  331. {
  332. switch(listitem)
  333. {
  334. case 0:
  335. {
  336. IsGGSmall = true;
  337. IsGGNormal = false;
  338. IsGGHuge = false;
  339. PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  340. ShowPlayerDialog(playerid,Dialog_GGArmor,2,"Choose A Setting of Armor","Gun Game With Armor\nGun Game Without Armor","Select","Back");
  341. }
  342. case 1:
  343. {
  344. IsGGSmall = false;
  345. IsGGNormal = true;
  346. IsGGHuge = false;
  347. PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  348. ShowPlayerDialog(playerid,Dialog_GGArmor,2,"Choose A Setting of Armor","Gun Game With Armor\nGun Game Without Armor","Select","Back");
  349. }
  350. case 2:
  351. {
  352. IsGGSmall = false;
  353. IsGGNormal = false;
  354. IsGGHuge = true;
  355. PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  356. ShowPlayerDialog(playerid,Dialog_GGArmor,2,"Choose A Setting of Armor","Gun Game With Armor\nGun Game Without Armor","Select","Back");
  357. }
  358. }
  359. }
  360. if(dialogid == Dialog_GGArmor)
  361. {
  362. switch(listitem)
  363. {
  364. case 0:
  365. {
  366. GGArmored = true;
  367. PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  368. ShowPlayerDialog(playerid,Dialog_GGPrize,1,"Gun Game Prize","Please Enter A Amount That You Want To Set Az Prize ($1000.Min $15000.Max)::","Select","Back");
  369.  
  370. }
  371. case 1:
  372. {
  373. GGArmored = false;
  374. PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  375. ShowPlayerDialog(playerid,Dialog_GGPrize,1,"Gun Game Prize","Please Enter A Amount That You Want To Set Az Prize ($1000.Min $15000.Max):","Select","Back");
  376. }
  377. }
  378. }
  379. if(dialogid == Dialog_GGPrize)
  380. {
  381. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,Dialog_GGPrize,1,"Gun Game Prize","Please Enter A Amount That You Want To Set Az Prize ($1000.Min $15000.Max):","Select","Back");
  382. if(strval(inputtext) > 15000 || strval(inputtext) < 1000) return ShowPlayerDialog(playerid,Dialog_GGPrize,1,"Gun Game Prize","Please Enter A Amount That You Want To Set Az Prize "COL_RED"($1000.Min $15000.Max):","Select","Back");
  383. PlayerPlaySound(playerid,1083,0.0,0.0,0.0);
  384. GGWinnerPrize = strval(inputtext);
  385. ShowPlayerDialog(playerid,Dialog_GGPLimit,1,"Gun Game Player's:","Please Insert A Number For Player's Limit (5.Min 100.Max)::","Select","Quit");
  386. }
  387. if(dialogid == Dialog_GGPLimit)
  388. {
  389. if(!strlen(inputtext)) return ShowPlayerDialog(playerid,Dialog_GGPLimit,1,"Gun Game Player's:","Please Insert A Number For Player's Limit (5.Min 100.Max):","Select","Quit");
  390. if(strval(inputtext) < 5 || strval(inputtext) > 100) return ShowPlayerDialog(playerid,Dialog_GGPLimit,1,"Gun Game Player's:","Please Insert A Number For Player's Limit "COL_RED"(5.Min 100.Max):","Select","Quit");
  391. GGPlayerLimit = strval(inputtext);
  392. SendClientMessage(playerid,COLOR_WHITE,"You Have Started A GunGame Match");
  393. SendClientMessage(playerid,COLOR_WHITE,"You Have 5 Second's To Cancel This gungame "COL_RED"<< /cancelgungame >>");
  394. GGPreTimer = SetTimer("GunGamePrepare",5000,false);
  395. }
  396. return 0;
  397. }
  398.  
  399. public GunGamePrepare()
  400. {
  401. new string[255],pName[MAX_PLAYER_NAME];
  402. GetPlayerName(GGAdminid,pName,sizeof(pName));
  403. GGStarted = false;
  404. IsAnyGG = true;
  405. GGWinnerID = 999;
  406. GGWinnerKills = 0;
  407. format(string,sizeof(string),"A GunGame Match Has Been Started By Admin %s(%d) With Prize of : $%d And Limit of %d player's << /joingungame >>",pName,GGAdminid,GGWinnerPrize,GGPlayerLimit);
  408. SendClientMessageToAll(COLOR_YELLOW,string);
  409. SendClientMessageToAll(COLOR_YELLOW,"You Have 1 Minute's To join This Match! Be Hurry");
  410. SetTimer("GunGameStart",60000,false);
  411.  
  412. return 1;
  413. }
  414.  
  415. public GunGameStart()
  416. {
  417. new RandomSkin = random(sizeof(GGSkins));
  418. new string[128];
  419. format(string,sizeof(string),"Gun Game Has Started With Prize Of "COL_YELLOW"$%d "COL_WHITE"& With "COL_YELLOW"%d/%d "COL_WHITE"Player's",GGWinnerPrize,GGPlayers,GGPlayerLimit);
  420. SendClientMessageToAll(COLOR_WHITE,string);
  421. SendClientMessageToAll(COLOR_YELLOW,"Now, You Can Watch this Match With /specgungame");
  422. GGStarted = true;
  423. for(new i=0;i<MAX_PLAYERS;i++)
  424. {
  425. if(IsInGG[i] == true)
  426. {
  427. if(IsGGSmall == true)
  428. {
  429. new RandomSpawn = random(sizeof(GGSmallSp));
  430. if(GGArmored == true)
  431. {
  432. TogglePlayerControllable(i,1);
  433. SetPlayerInterior(i,1);
  434. SetPlayerSkin(i,GGSkins[RandomSkin]);
  435. SetPlayerPos(i,GGSmallSp[RandomSpawn][0],GGSmallSp[RandomSpawn][1],GGSmallSp[RandomSpawn][2]);
  436. SetPlayerFacingAngle(i,GGSmallSp[RandomSpawn][3]);
  437. SetPlayerHealth(i,100.0);
  438. SetPlayerArmour(i,50.0);
  439. SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  440. PlayerPlaySound(i,1069,0.0,0.0,0.0);
  441. }
  442. else
  443. {
  444. TogglePlayerControllable(i,1);
  445. SetPlayerInterior(i,1);
  446. SetPlayerSkin(i,GGSkins[RandomSkin]);
  447. SetPlayerPos(i,GGSmallSp[RandomSpawn][0],GGSmallSp[RandomSpawn][1],GGSmallSp[RandomSpawn][2]);
  448. SetPlayerFacingAngle(i,GGSmallSp[RandomSpawn][3]);
  449. SetPlayerHealth(i,100.0);
  450. SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  451. PlayerPlaySound(i,1069,0.0,0.0,0.0);
  452. }
  453. }
  454. if(IsGGNormal == true)
  455. {
  456. new RandomSpawn = random(sizeof(GGNormalSp));
  457. if(GGArmored == true)
  458. {
  459. TogglePlayerControllable(i,1);
  460. SetPlayerInterior(i,14);
  461. SetPlayerSkin(i,GGSkins[RandomSkin]);
  462. SetPlayerPos(i,GGNormalSp[RandomSpawn][0],GGNormalSp[RandomSpawn][1],GGNormalSp[RandomSpawn][2]);
  463. SetPlayerFacingAngle(i,GGNormalSp[RandomSpawn][3]);
  464. SetPlayerHealth(i,100.0);
  465. SetPlayerArmour(i,50.0);
  466. SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  467. PlayerPlaySound(i,1069,0.0,0.0,0.0);
  468. }
  469. else
  470. {
  471. TogglePlayerControllable(i,1);
  472. SetPlayerInterior(i,14);
  473. SetPlayerSkin(i,GGSkins[RandomSkin]);
  474. SetPlayerPos(i,GGNormalSp[RandomSpawn][0],GGNormalSp[RandomSpawn][1],GGNormalSp[RandomSpawn][2]);
  475. SetPlayerFacingAngle(i,GGNormalSp[RandomSpawn][3]);
  476. SetPlayerHealth(i,100.0);
  477. SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  478. PlayerPlaySound(i,1069,0.0,0.0,0.0);
  479. }
  480. }
  481. if(IsGGHuge == true)
  482. {
  483. new RandomSpawn = random(sizeof(GGHugeSp));
  484. if(GGArmored == true)
  485. {
  486. TogglePlayerControllable(i,1);
  487. SetPlayerInterior(i,15);
  488. SetPlayerSkin(i,GGSkins[RandomSkin]);
  489. SetPlayerPos(i,GGHugeSp[RandomSpawn][0],GGHugeSp[RandomSpawn][1],GGHugeSp[RandomSpawn][2]);
  490. SetPlayerFacingAngle(i,GGHugeSp[RandomSpawn][3]);
  491. SetPlayerHealth(i,100.0);
  492. SetPlayerArmour(i,50.0);
  493. SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  494. PlayerPlaySound(i,1069,0.0,0.0,0.0);
  495. }
  496. else
  497. {
  498. TogglePlayerControllable(i,1);
  499. SetPlayerInterior(i,15);
  500. SetPlayerSkin(i,GGSkins[RandomSkin]);
  501. SetPlayerPos(i,GGHugeSp[RandomSpawn][0],GGHugeSp[RandomSpawn][1],GGHugeSp[RandomSpawn][2]);
  502. SetPlayerFacingAngle(i,GGHugeSp[RandomSpawn][3]);
  503. SetPlayerHealth(i,100.0);
  504. SendClientMessage(i,COLOR_RED,"Gun Game Started ! Kill To Level Up And Get Better Gun's");
  505. PlayerPlaySound(i,1069,0.0,0.0,0.0);
  506. }
  507. }
  508. }
  509. }
  510. return 1;
  511. }
  512.  
  513. public GunGameEnd()
  514. {
  515. GGStarted = false;
  516. IsAnyGG = false;
  517. GGArmored = false;
  518. IsGGHuge = false;
  519. IsGGSmall = false;
  520. IsGGNormal = false;
  521. GGAdminid = 999;
  522. for(new i=0;i<MAX_PLAYERS;i++)
  523. {
  524. if(IsInGG[i] == true)
  525. {
  526. PlayerPlaySound(i,1098,0.0,0.0,0.0);
  527. new pName[MAX_PLAYER_NAME],string[128];
  528. GetPlayerName(GGWinnerID,pName,sizeof(pName));
  529. format(string,sizeof(string),"The Player "COL_RED"%s(%d) Won "COL_WHITE"The GunGame With Prize of : %d",pName,GGWinnerID,GGWinnerPrize);
  530. SetPlayerInterior(i,0);
  531. IsInGG[i] = false;
  532. PlayerGGWeapon[i] = 0;
  533. GivePlayerMoney(GGWinnerID,GGWinnerPrize);
  534. SendClientMessageToAll(COLOR_WHITE,string);
  535. GGPlayers = 0;
  536. PlayerGGKills[i] = 0;
  537. ResetPlayerWeapons(i);
  538. SpawnPlayer(i);
  539. SetPlayerPos(i,GetPVarFloat(i,"OldPosX"),GetPVarFloat(i,"OldPosY"),GetPVarFloat(i,"OldPosZ"));
  540. DeletePVar(i,"OldPosX");
  541. DeletePVar(i,"OldPosY");
  542. DeletePVar(i,"OldPosZ");
  543. }
  544. if(IsSpecingGG[i] == true)
  545. {
  546. SetPlayerInterior(i,0);
  547. SendClientMessage(i,COLOR_YELLOW,"GunGame Has Finished");
  548. SpawnPlayer(i);
  549. SetCameraBehindPlayer(i);
  550. SetPlayerPos(i,GetPVarFloat(i,"oldPosX"),GetPVarFloat(i,"oldPosY"),GetPVarFloat(i,"oldPosZ"));
  551. DeletePVar(i,"oldPosX");
  552. DeletePVar(i,"oldPosY");
  553. DeletePVar(i,"oldPosZ");
  554. IsSpecingGG[i] = false;
  555. }
  556. }
  557. return 1;
  558. }
  559.  
  560. CMD:gungame(playerid, params[])
  561. {
  562. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Are Not An Admin !");
  563. if(GGStarted == true) return SendClientMessage(playerid,COLOR_LIGHTRED,"There Is A GunGame Started");
  564. GGAdminid = playerid;
  565. ShowPlayerDialog(playerid,Dialog_GunGame,0,""COL_WHITE"Gun Game Setting's",""COL_WHITE"This Is Perfect System To Make Gungame\nAre Your Sure You Want Make A Gun Game ?","Yes","No");
  566. return 1;
  567. }
  568. CMD:joingungame(playerid, params[])
  569. {
  570. if(GGStarted == true) return SendClientMessage(playerid,COLOR_YELLOW,"GunGame Has Been Started You Can Not Join !");
  571. if(IsInGG[playerid] == true) return SendClientMessage(playerid,COLOR_YELLOW,"You Already Joined This Match");
  572. if(IsAnyGG == false) return SendClientMessage(playerid,COLOR_YELLOW,"There Is No GunGame Started");
  573. if(GGPlayers == GGPlayerLimit) return SendClientMessage(playerid,COLOR_YELLOW,"There is No Empty Room In GunGame");
  574. new Float:OldX,Float:OldY,Float:OldZ;
  575. GetPlayerPos(playerid,OldX,OldY,OldZ);
  576. SetPVarFloat(playerid,"OldPosX",OldX);
  577. SetPVarFloat(playerid,"OldPosY",OldY);
  578. SetPVarFloat(playerid,"OldPosZ",OldZ);
  579. SendClientMessage(playerid,COLOR_LIGHTBLUE,"You Have Joined This Gungame Match!!!");
  580. SendClientMessage(playerid,COLOR_LIGHTBLUE,"Wait For 50 Second's To Let Other Player's Join");
  581. ResetPlayerWeapons(playerid);
  582. GivePlayerWeapon(playerid,24,9999);
  583. TogglePlayerControllable(playerid,0);
  584. GGPlayers++;
  585. IsInGG[playerid] = true;
  586. PlayerGGWeapon[playerid] = 24;
  587. PlayerGGKills[playerid] = 0;
  588. PlayerPlaySound(playerid,1068,0.0,0.0,0.0);
  589. return 1;
  590. }
  591. CMD:specgungame(playerid,params[])
  592. {
  593. if(IsAnyGG == false) return SendClientMessage(playerid,COLOR_RED,"There Is No Gun Game");
  594. if(GGStarted == false) return SendClientMessage(playerid,COLOR_RED,"Gun Game Not Started Yet");
  595. if(IsInGG[playerid] == true) return SendClientMessage(playerid,COLOR_RED,"You Can Not Spec While you Are In GunGame");
  596. if(IsSpecingGG[playerid] == false)
  597. {
  598. new pName[MAX_PLAYER_NAME],string[128],Float:oldX,Float:oldY,Float:oldZ;
  599. if(IsGGSmall == true)
  600. {
  601. SetPlayerInterior(playerid,1);
  602. GetPlayerName(playerid,pName,sizeof(pName));
  603. GetPlayerPos(playerid,oldX,oldY,oldZ);
  604. SetPVarFloat(playerid,"oldPosX",oldX);
  605. SetPVarFloat(playerid,"oldPosY",oldY);
  606. SetPVarFloat(playerid,"oldPosZ",oldZ);
  607. SetPlayerCameraPos(playerid,-1401.5728,107.2614,1090.8381);
  608. SetPlayerCameraLookAt(playerid,-1401.6565,107.2420,1032.2734,CAMERA_CUT);
  609. IsSpecingGG[playerid] = true;
  610. SendClientMessage(playerid,COLOR_YELLOW,"You Are Now Watching GunGame use /specgungame Again To Stop Watching");
  611. for(new i=0;i<MAX_PLAYERS;i++)
  612. {
  613. if(IsInGG[i] == true)
  614. {
  615. format(string,sizeof(string),"Player "COL_RED"%s(%d) "COL_WHITE"Is Watching GunGame",pName,playerid);
  616. SendClientMessage(i,COLOR_WHITE,string);
  617. }
  618. }
  619. }
  620.  
  621. if(IsGGNormal == true)
  622. {
  623. SetPlayerInterior(playerid,14);
  624. GetPlayerName(playerid,pName,sizeof(pName));
  625. GetPlayerPos(playerid,oldX,oldY,oldZ);
  626. SetPVarFloat(playerid,"oldPosX",oldX);
  627. SetPVarFloat(playerid,"oldPosY",oldY);
  628. SetPVarFloat(playerid,"oldPosZ",oldZ);
  629. SetPlayerCameraPos(playerid,-1349.1023,1555.9911,1082.7157);
  630. SetPlayerCameraLookAt(playerid,-1446.3850,1620.6434,1054.4141,CAMERA_CUT);
  631. IsSpecingGG[playerid] = true;
  632. SendClientMessage(playerid,COLOR_YELLOW,"You Are Now Watching GunGame use /specgungame Again To Stop Watching");
  633. for(new i=0;i<MAX_PLAYERS;i++)
  634. {
  635. if(IsInGG[i] == true)
  636. {
  637. format(string,sizeof(string),"Player "COL_RED"%s(%d) "COL_WHITE"Is Watching GunGame",pName,playerid);
  638. SendClientMessage(i,COLOR_WHITE,string);
  639. }
  640. }
  641. }
  642. if(IsGGHuge == true)
  643. {
  644. SetPlayerInterior(playerid,15);
  645. GetPlayerName(playerid,pName,sizeof(pName));
  646. GetPlayerPos(playerid,oldX,oldY,oldZ);
  647. SetPVarFloat(playerid,"oldPosX",oldX);
  648. SetPVarFloat(playerid,"oldPosY",oldY);
  649. SetPVarFloat(playerid,"oldPosZ",oldZ);
  650. SetPlayerCameraPos(playerid,-1345.1965,927.7277,1059.6145);
  651. SetPlayerCameraLookAt(playerid,-1387.4464,994.6185,1024.0735,CAMERA_CUT);
  652. IsSpecingGG[playerid] = true;
  653. SendClientMessage(playerid,COLOR_YELLOW,"You Are Now Watching GunGame use /specgungame Again To Stop Watching");
  654. for(new i=0;i<MAX_PLAYERS;i++)
  655. {
  656. if(IsInGG[i] == true)
  657. {
  658. format(string,sizeof(string),"Player "COL_RED"%s(%d) "COL_WHITE"Is Watching GunGame",pName,playerid);
  659. SendClientMessage(i,COLOR_WHITE,string);
  660. }
  661. }
  662. }
  663. }
  664. else
  665. {
  666. SendClientMessage(playerid,COLOR_YELLOW,"You Have Stopped Specing GunGame");
  667. SetPlayerInterior(playerid,0);
  668. SpawnPlayer(playerid);
  669. SetCameraBehindPlayer(playerid);
  670. SetPlayerPos(playerid,GetPVarFloat(playerid,"oldPosX"),GetPVarFloat(playerid,"oldPosY"),GetPVarFloat(playerid,"oldPosZ"));
  671. DeletePVar(playerid,"oldPosX");
  672. DeletePVar(playerid,"oldPosY");
  673. DeletePVar(playerid,"oldPosZ");
  674. IsSpecingGG[playerid] = false;
  675.  
  676. }
  677. return 1;
  678. }
  679. CMD:stopgungame(playerid,params[])
  680. {
  681. if(IsAnyGG == false) return SendClientMessage(playerid,COLOR_RED,"There Is No Gun Game");
  682. if(GGStarted == false) return SendClientMessage(playerid,COLOR_RED,"GunGame Is Not Started Yet");
  683. if(GGAdminid != playerid) return SendClientMessage(playerid,COLOR_RED,"You Are Not Admin of This Gungame !");
  684. SendClientMessageToAll(COLOR_YELLOW,"Gun Game Has Been Stopped By An Admin!");
  685. SetTimer("GunGameEnd",900,false);
  686. return 1;
  687. }
  688. CMD:cancelgungame(playerid,params[])
  689. {
  690. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"You Are Not Admin");
  691. if(GGStarted == true) return SendClientMessage(playerid,COLOR_RED,"This Gun Game Has Been Started");
  692. if(GGAdminid != playerid) return SendClientMessage(playerid,COLOR_RED,"You Are Not Admin Of This GunGame");
  693. SendClientMessage(playerid,COLOR_YELLOW,"You Have Canceled GunGame");
  694. KillTimer(GGPreTimer);
  695. return 1;
  696. }
  697. CMD:gungamers(playerid,params[])
  698. {
  699. new pName[MAX_PLAYER_NAME],string[128];
  700. for(new i=0;i<MAX_PLAYERS;i++)
  701. {
  702. if(IsInGG[i] == true)
  703. {
  704. GetPlayerName(i,pName,sizeof(pName));
  705. format(string,sizeof(string),""COL_YELLOW"- "COL_WHITE"%s(%d) With %d Kill's",pName,i,PlayerGGKills[i]);
  706. SendClientMessage(playerid,COLOR_WHITE,string);
  707. }
  708. }
  709. return 1;
  710. }
Advertisement
Add Comment
Please, Sign In to add comment