Advertisement
Guest User

/war

a guest
Aug 12th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.46 KB | None | 0 0
  1. if(strcmp(cmd, "/war", true) == 0)
  2. {
  3. if(IsAMafia(playerid))
  4. {
  5. new rhour, rminute, rsecond, zone[MAX_ZONE_NAME];
  6. GetPlayer2DRadarZone(playerid, zone, sizeof(zone));
  7.  
  8. gettime(rhour, rminute, rsecond);
  9. if(rhour < 6) return SendClientMessage(playerid, COLOR_WHITE, "{00D7D7}War: {FFFFFF}Nu poti declansa un razboi in toiul noptii!");
  10.  
  11. new side[MAX_PLAYERS], ncount=0;
  12. if(PlayerInfo[playerid][pLeader] != 0) side[playerid] = PlayerInfo[playerid][pLeader]; else if(PlayerInfo[playerid][pMember] != 0) side[playerid] = PlayerInfo[playerid][pMember];
  13. for(new n=1; n<sizeof(GangInfo); n++)
  14. {
  15. if(GangInfo[n][gFaction] == side[playerid]) ncount++;
  16. }
  17. if(PlayerInfo[playerid][pRank] >= 5) {} else return SendClientMessage(playerid, COLOR_WHITE, "{00D7D7}War: {FFFFFF}Nu ai rangul necesar!");
  18. if(ncount >= 16) return SendClientMessage(playerid, COLOR_WHITE, "{00D7D7}War: {FFFFFF}Deja detii 16 teritorii!");
  19. if(GetPlayerInterior(playerid) != 0) return 1;
  20. if(War != 0) return SendClientMessage(playerid, COLOR_WHITE, "{00D7D7}War: {FFFFFF}Este deja un razboi in desfasurare!");
  21. new ward;
  22. if(Warallowed == 0) return SendClientMessage(playerid, COLOR_WHITE, "{00D7D7}War: {FFFFFF}Un admin a inchis sistemul de razboaie temporar!");
  23. GetPlayerName(playerid, sendername, sizeof(sendername));
  24. if(IsPlayerInArea(playerid, 114.21, 506.54, -1364.93, -912.91)) ward = 1;
  25. else if(IsPlayerInArea(playerid, 506.54, 899.25, -1364.93, -912.91)) ward = 2;
  26. else if(IsPlayerInArea(playerid, 899.25, 1313.58, -1313.70, -912.91)) ward = 3;
  27. else if(IsPlayerInArea(playerid, 1313.58, 1727.49, -1364.93, -912.91)) ward = 4;
  28. else if(IsPlayerInArea(playerid, 1727.49, 2108.13, -1364.93, -912.91)) ward = 5;
  29. else if(IsPlayerInArea(playerid, 2108.13, 2499.38, -1364.93, -912.91)) ward = 6;
  30. else if(IsPlayerInArea(playerid, 2499.38, 2916.17, -1313.70, -912.91)) ward = 7;
  31. else if(IsPlayerInArea(playerid, 114.21, 506.54, -1821.03, -1364.93)) ward = 8;
  32. else if(IsPlayerInArea(playerid, 506.54, 899.25, -1821.03, -1364.93)) ward = 9;
  33. else if(IsPlayerInArea(playerid, 899.25, 1313.58, -1721.90, -1313.70)) ward = 10;
  34. else if(IsPlayerInArea(playerid, 1313.58, 1727.49, -1821.03, -1364.93)) ward = 11;
  35. else if(IsPlayerInArea(playerid, 1727.49, 2108.13, -1821.03, -1364.93)) ward = 12;
  36. else if(IsPlayerInArea(playerid, 2108.13, 2499.38, -1821.03, -1364.93)) ward = 13;
  37. else if(IsPlayerInArea(playerid, 2499.38, 2916.17, -1737.65, -1313.70)) ward = 14;
  38. else if(IsPlayerInArea(playerid, 899.25, 1313.58, -2131.32, -1721.90)) ward = 15;
  39. else if(IsPlayerInArea(playerid, 899.25, 1313.58, -2489.99, -2131.32)) ward = 16;
  40. else if(IsPlayerInArea(playerid, 1313.58, 1727.49, -2250.92, -1821.03)) ward = 17;
  41. else if(IsPlayerInArea(playerid, 1727.49, 2108.13, -2250.92, -1821.03)) ward = 18;
  42. else if(IsPlayerInArea(playerid, 2108.13, 2499.38, -2250.92, -1821.03)) ward = 19;
  43. else if(IsPlayerInArea(playerid, 2499.38, 2916.17, -2172.41, -1737.65)) ward = 20;
  44. else if(IsPlayerInArea(playerid, 1313.58, 1727.49, -2690.47, -2250.92)) ward = 21;
  45. else if(IsPlayerInArea(playerid, 1727.49, 2108.13, -2690.47, -2250.92)) ward = 22;
  46. else if(IsPlayerInArea(playerid, 2108.13, 2499.38, -2690.47, -2250.92)) ward = 23;
  47. else if(IsPlayerInArea(playerid, 2499.38, 2916.17, -2567.91, -2172.41)) ward = 24;
  48. else if(IsPlayerInArea(playerid, 1114.47, 1478.16, 2444.49, 2901.03)) ward = 25;
  49. else if(IsPlayerInArea(playerid, 1478.16, 1828.16, 2444.49, 2901.03)) ward = 26;
  50. else if(IsPlayerInArea(playerid, 1828.16, 2150.16, 2444.49, 2901.03)) ward = 27;
  51. else if(IsPlayerInArea(playerid, 2150.16, 2528.16, 2444.49, 2901.03)) ward = 28;
  52. else if(IsPlayerInArea(playerid, 2528.16, 2878.16, 2444.49, 2901.03)) ward = 29;
  53. else if(IsPlayerInArea(playerid, 901.16, 1307.16, 1980.34, 2444.49)) ward = 30;
  54. else if(IsPlayerInArea(playerid, 1307.16, 1677.16, 1980.34, 2444.49)) ward = 31;
  55. else if(IsPlayerInArea(playerid, 1677.16, 2076.16, 1980.34, 2444.49)) ward = 32;
  56. else if(IsPlayerInArea(playerid, 2076.16, 2482.00, 1980.34, 2444.49)) ward = 33;
  57. else if(IsPlayerInArea(playerid, 2482.00, 2878.16, 1980.34, 2444.49)) ward = 34;
  58. else if(IsPlayerInArea(playerid, 901.16, 1307.16, 1528.09, 1980.34)) ward = 35;
  59. else if(IsPlayerInArea(playerid, 1307.16, 1677.16, 1528.09, 1980.34)) ward = 36;
  60. else if(IsPlayerInArea(playerid, 1677.16, 2076.16, 1528.09, 1980.34)) ward = 37;
  61. else if(IsPlayerInArea(playerid, 2076.16, 2482.00, 1528.09, 1980.34)) ward = 38;
  62. else if(IsPlayerInArea(playerid, 2482.00, 2878.16, 1528.09, 1980.34)) ward = 39;
  63. else if(IsPlayerInArea(playerid, 901.16, 1307.16, 1074.90, 1528.09)) ward = 40;
  64. else if(IsPlayerInArea(playerid, 1307.16, 1677.16, 1074.90, 1528.09)) ward = 41;
  65. else if(IsPlayerInArea(playerid, 1677.16, 2076.16, 1074.90, 1528.09)) ward = 42;
  66. else if(IsPlayerInArea(playerid, 2076.16, 2482.00, 1074.90, 1528.09)) ward = 43;
  67. else if(IsPlayerInArea(playerid, 2482.00, 2878.16, 1074.90, 1528.09)) ward = 44;
  68. else if(IsPlayerInArea(playerid, 1307.16, 1677.16, 663.83, 1074.90)) ward = 45;
  69. else if(IsPlayerInArea(playerid, 1677.16, 2076.16, 663.83, 1074.90)) ward = 46;
  70. else if(IsPlayerInArea(playerid, 2076.16, 2482.00, 663.83, 1074.90)) ward = 47;
  71. else if(IsPlayerInArea(playerid, 2482.00, 2878.16, 663.83, 1074.90)) ward = 48;
  72. else return 1;
  73. format(string, sizeof(string), "{00D7D7}War: {FFFFFF}Acest teritoriu a fost deja ocupat acum %d ore.", GangInfo[ward][gHours]);
  74. if(GangInfo[ward][gHours] > 0 && AdminDuty[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, string);
  75. //if(PlayerInfo[playerid][pLeader] >= 1) {} else return SendClientMessage(playerid, COLOR_WHITE, "{00D7D7}War: {FFFFFF}Trebuie sa fii liderul unei mafie!");
  76. new ftext[60], ftext1[60];
  77. if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5) format(ftext, sizeof(ftext), "{5F361E}Familia Dallas{FFFFFF}");
  78. if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) format(ftext, sizeof(ftext), "{C8C1BF}Familia Falcone{FFFFFF}");
  79. if(PlayerInfo[playerid][pMember] == 12 || PlayerInfo[playerid][pLeader] == 12) format(ftext, sizeof(ftext), "{7716A0}Familia Bonanno{FFFFFF}");
  80. if(PlayerInfo[playerid][pMember] == 13 || PlayerInfo[playerid][pLeader] == 13) format(ftext, sizeof(ftext), "{D4AA1E}Familia Orleans{FFFFFF}");
  81. if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14) format(ftext, sizeof(ftext), "{17B41F}Familia 15th Avenue{FFFFFF}");
  82. if(PlayerInfo[playerid][pMember] == 15 || PlayerInfo[playerid][pLeader] == 15) format(ftext, sizeof(ftext), "{1CCDB5}Sacra Corona Unita{FFFFFF}");
  83. if(GangInfo[ward][gFaction] == 5) format(ftext1, sizeof(ftext1), "{5F361E}Familiei Dallas{FFFFFF}");
  84. if(GangInfo[ward][gFaction] == 6) format(ftext1, sizeof(ftext1), "{C8C1BF}Familiei Falcone{FFFFFF}");
  85. if(GangInfo[ward][gFaction] == 12) format(ftext1, sizeof(ftext1), "{7716A0}Familiei Bonanno{FFFFFF}");
  86. if(GangInfo[ward][gFaction] == 13) format(ftext1, sizeof(ftext1), "{D4AA1E}Familiei Orleans{FFFFFF}");
  87. if(GangInfo[ward][gFaction] == 14) format(ftext1, sizeof(ftext1), "{17B41F}Familiei 15Avenue{FFFFFF}");
  88. if(GangInfo[ward][gFaction] == 15) format(ftext1, sizeof(ftext1), "{1CCDB5}Sacra Corona Unita{FFFFFF}");
  89. if(IsAAAlliance(playerid) && GangInfo[ward][gFaction] == 5 || IsAAAlliance(playerid) && GangInfo[ward][gFaction] == 14 || IsAAAlliance(playerid) && GangInfo[ward][gFaction] == 13)
  90. return SendClientMessage(playerid, COLOR_WHITE, "{00D7D7}War: {FFFFFF}Alianta ta deja a ocupat acest teritoriu!");
  91. if(IsAIAlliance(playerid) && GangInfo[ward][gFaction] == 6 || IsAIAlliance(playerid) && GangInfo[ward][gFaction] == 12 || IsAIAlliance(playerid) && GangInfo[ward][gFaction] == 15)
  92. return SendClientMessage(playerid, COLOR_WHITE, "{00D7D7}War: {FFFFFF}Alianta ta deja a ocupat acest teritoriu!");
  93. format(string, sizeof(string), "(( Gang News: )) %s a declansat un razboi impotriva %s!", ftext, ftext1);
  94. BroadCast(0x8D8DFFFF,string);
  95. format(string, sizeof(string), "(( Gang News: )) {FFFFFF}Razboiul se desfasoara in zona %s! Stati departe!", zone);
  96. BroadCast(0x8D8DFFFF,string);
  97. if(IsPlayerInArea(playerid, 114.21, 506.54, -1364.93, -912.91)) GangZoneFlashForAll(Gangzone[0], 0xFF6347AA);
  98. else if(IsPlayerInArea(playerid, 506.54, 899.25, -1364.93, -912.91)) GangZoneFlashForAll(Gangzone[1], 0xFF6347AA);
  99. else if(IsPlayerInArea(playerid, 899.25, 1313.58, -1313.70, -912.91)) GangZoneFlashForAll(Gangzone[2], 0xFF6347AA);
  100. else if(IsPlayerInArea(playerid, 1313.58, 1727.49, -1364.93, -912.91)) GangZoneFlashForAll(Gangzone[3], 0xFF6347AA);
  101. else if(IsPlayerInArea(playerid, 1727.49, 2108.13, -1364.93, -912.91)) GangZoneFlashForAll(Gangzone[4], 0xFF6347AA);
  102. else if(IsPlayerInArea(playerid, 2108.13, 2499.38, -1364.93, -912.91)) GangZoneFlashForAll(Gangzone[5], 0xFF6347AA);
  103. else if(IsPlayerInArea(playerid, 2499.38, 2916.17, -1313.70, -912.91)) GangZoneFlashForAll(Gangzone[6], 0xFF6347AA);
  104. else if(IsPlayerInArea(playerid, 114.21, 506.54, -1821.03, -1364.93)) GangZoneFlashForAll(Gangzone[7], 0xFF6347AA);
  105. else if(IsPlayerInArea(playerid, 506.54, 899.25, -1821.03, -1364.93)) GangZoneFlashForAll(Gangzone[8], 0xFF6347AA);
  106. else if(IsPlayerInArea(playerid, 899.25, 1313.58, -1721.90, -1313.70)) GangZoneFlashForAll(Gangzone[9], 0xFF6347AA);
  107. else if(IsPlayerInArea(playerid, 1313.58, 1727.49, -1821.03, -1364.93)) GangZoneFlashForAll(Gangzone[10], 0xFF6347AA);
  108. else if(IsPlayerInArea(playerid, 1727.49, 2108.13, -1821.03, -1364.93)) GangZoneFlashForAll(Gangzone[11], 0xFF6347AA);
  109. else if(IsPlayerInArea(playerid, 2108.13, 2499.38, -1821.03, -1364.93)) GangZoneFlashForAll(Gangzone[12], 0xFF6347AA);
  110. else if(IsPlayerInArea(playerid, 2499.38, 2916.17, -1737.65, -1313.70)) GangZoneFlashForAll(Gangzone[13], 0xFF6347AA);
  111. else if(IsPlayerInArea(playerid, 899.25, 1313.58, -2131.32, -1721.90)) GangZoneFlashForAll(Gangzone[14], 0xFF6347AA);
  112. else if(IsPlayerInArea(playerid, 899.25, 1313.58, -2489.99, -2131.32)) GangZoneFlashForAll(Gangzone[15], 0xFF6347AA);
  113. else if(IsPlayerInArea(playerid, 1313.58, 1727.49, -2250.92, -1821.03)) GangZoneFlashForAll(Gangzone[16], 0xFF6347AA);
  114. else if(IsPlayerInArea(playerid, 1727.49, 2108.13, -2250.92, -1821.03)) GangZoneFlashForAll(Gangzone[17], 0xFF6347AA);
  115. else if(IsPlayerInArea(playerid, 2108.13, 2499.38, -2250.92, -1821.03)) GangZoneFlashForAll(Gangzone[18], 0xFF6347AA);
  116. else if(IsPlayerInArea(playerid, 2499.38, 2916.17, -2172.41, -1737.65)) GangZoneFlashForAll(Gangzone[19], 0xFF6347AA);
  117. else if(IsPlayerInArea(playerid, 1313.58, 1727.49, -2690.47, -2250.92)) GangZoneFlashForAll(Gangzone[20], 0xFF6347AA);
  118. else if(IsPlayerInArea(playerid, 1727.49, 2108.13, -2690.47, -2250.92)) GangZoneFlashForAll(Gangzone[21], 0xFF6347AA);
  119. else if(IsPlayerInArea(playerid, 2108.13, 2499.38, -2690.47, -2250.92)) GangZoneFlashForAll(Gangzone[22], 0xFF6347AA);
  120. else if(IsPlayerInArea(playerid, 2499.38, 2916.17, -2567.91, -2172.41)) GangZoneFlashForAll(Gangzone[23], 0xFF6347AA);
  121. else if(IsPlayerInArea(playerid, 1114.47, 1478.16, 2444.49, 2901.03)) GangZoneFlashForAll(Gangzone[24], 0xFF6347AA);
  122. else if(IsPlayerInArea(playerid, 1478.16, 1828.16, 2444.49, 2901.03)) GangZoneFlashForAll(Gangzone[25], 0xFF6347AA);
  123. else if(IsPlayerInArea(playerid, 1828.16, 2150.16, 2444.49, 2901.03)) GangZoneFlashForAll(Gangzone[26], 0xFF6347AA);
  124. else if(IsPlayerInArea(playerid, 2150.16, 2528.16, 2444.49, 2901.03)) GangZoneFlashForAll(Gangzone[27], 0xFF6347AA);
  125. else if(IsPlayerInArea(playerid, 528.16, 2878.16, 2444.49, 2901.03)) GangZoneFlashForAll(Gangzone[28], 0xFF6347AA);
  126. else if(IsPlayerInArea(playerid, 901.16, 1307.16, 1980.34, 2444.49)) GangZoneFlashForAll(Gangzone[29], 0xFF6347AA);
  127. else if(IsPlayerInArea(playerid, 1307.16, 1677.16, 1980.34, 2444.49)) GangZoneFlashForAll(Gangzone[30], 0xFF6347AA);
  128. else if(IsPlayerInArea(playerid, 1677.16, 2076.16, 1980.34, 2444.49)) GangZoneFlashForAll(Gangzone[31], 0xFF6347AA);
  129. else if(IsPlayerInArea(playerid, 2076.16, 2482.00, 1980.34, 2444.49)) GangZoneFlashForAll(Gangzone[32], 0xFF6347AA);
  130. else if(IsPlayerInArea(playerid, 2482.00, 2878.16, 1980.34, 2444.49)) GangZoneFlashForAll(Gangzone[33], 0xFF6347AA);
  131. else if(IsPlayerInArea(playerid, 901.16, 1307.16, 1528.09, 1980.34)) GangZoneFlashForAll(Gangzone[34], 0xFF6347AA);
  132. else if(IsPlayerInArea(playerid, 1307.16, 1677.16, 1528.09, 1980.34)) GangZoneFlashForAll(Gangzone[35], 0xFF6347AA);
  133. else if(IsPlayerInArea(playerid, 1677.16, 2076.16, 1528.09, 1980.34)) GangZoneFlashForAll(Gangzone[36], 0xFF6347AA);
  134. else if(IsPlayerInArea(playerid, 2076.16, 2482.00, 1528.09, 1980.34)) GangZoneFlashForAll(Gangzone[37], 0xFF6347AA);
  135. else if(IsPlayerInArea(playerid, 2482.00, 2878.16, 1528.09, 1980.34)) GangZoneFlashForAll(Gangzone[38], 0xFF6347AA);
  136. else if(IsPlayerInArea(playerid, 901.16, 1307.16, 1074.90, 1528.09)) GangZoneFlashForAll(Gangzone[39], 0xFF6347AA);
  137. else if(IsPlayerInArea(playerid, 1307.16, 1677.16, 1074.90, 1528.09)) GangZoneFlashForAll(Gangzone[40], 0xFF6347AA);
  138. else if(IsPlayerInArea(playerid, 1677.16, 2076.16, 1074.90, 1528.09)) GangZoneFlashForAll(Gangzone[41], 0xFF6347AA);
  139. else if(IsPlayerInArea(playerid, 2076.16, 2482.00, 1074.90, 1528.09)) GangZoneFlashForAll(Gangzone[42], 0xFF6347AA);
  140. else if(IsPlayerInArea(playerid, 2482.00, 2878.16, 1074.90, 1528.09)) GangZoneFlashForAll(Gangzone[43], 0xFF6347AA);
  141. else if(IsPlayerInArea(playerid, 1307.16, 1677.16, 663.83, 1074.90)) GangZoneFlashForAll(Gangzone[44], 0xFF6347AA);
  142. else if(IsPlayerInArea(playerid, 1677.16, 2076.16, 663.83, 1074.90)) GangZoneFlashForAll(Gangzone[45], 0xFF6347AA);
  143. else if(IsPlayerInArea(playerid, 2076.16, 2482.00, 663.83, 1074.90)) GangZoneFlashForAll(Gangzone[46], 0xFF6347AA);
  144. else if(IsPlayerInArea(playerid, 2482.00, 2878.16, 663.83, 1074.90)) GangZoneFlashForAll(Gangzone[47], 0xFF6347AA);
  145.  
  146. WarStarted=1;
  147. WarF = side[playerid];
  148. WarF1 = GangInfo[ward][gFaction];
  149.  
  150. WarZone = ward;
  151.  
  152. for(new w = 0; w < sizeof(GangInfo); w++)
  153. {
  154. WarPoints[w] = 0;
  155. }
  156. if(side[playerid] == 5 || side[playerid] == 13 || side[playerid] == 14) WarAttack1 = 1; else WarAttack1 = 2;
  157. if(GangInfo[ward][gFaction] == 5 || GangInfo[ward][gFaction] == 13 || GangInfo[ward][gFaction] == 14) WarAttack2 = 1; else WarAttack2 = 2;
  158.  
  159. if(IsAIAlliance(playerid)) War = 1; else if(IsAAAlliance(playerid)) War = 2;
  160. //if(GangInfo[ward][gFaction] == 5 || GangInfo[ward][gFaction] == 13 || GangInfo[ward][gFaction] == 14) War1 = 2; else if(GangInfo[ward][gFaction] == 6 || GangInfo[ward][gFaction] == 12 || GangInfo[ward][gFaction] == 15) War1 = 1;
  161. WarMan1 = 999;
  162. WarMan2 = 999;
  163. WarScore1 = 0;
  164. WarScore2 = 0;
  165. for(new i=0; i<MAX_PLAYERS; i++)
  166. {
  167. WarStats1[i] = 0;
  168. WarStats2[i] = 0;
  169. if(IsAIAlliance(i) || IsAAAlliance(i))
  170. {
  171. format(string, sizeof(string), "{00D7D7}War: {FFFFFF}%s din %s a declansat un razboi! Pentru a castiga razboiul, trebuie sa faceti un scor mai bun in 15 minute!", sendername, ftext);
  172. SendClientMessage(i, COLOR_WHITE, string);
  173. }
  174. }
  175. }
  176. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement