Advertisement
Guest User

Untitled

a guest
Mar 25th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.74 KB | None | 0 0
  1. //#define FILTERSCRIPT
  2.  
  3. #include <a_samp>
  4. #include <ocmd>
  5. #include <dini>
  6. #include <utils>
  7.  
  8. #if defined FILTERSCRIPT
  9.  
  10.  
  11. #define FS_COL_GREY (0xAFAFAFAA)
  12. #define FS_COL_YELLOW (0xFFFF00FF)
  13. forward Fight_Init();
  14. forward Fight_Close();
  15. forward FightUpdate_1();
  16. forward FightUpdate_2();
  17.  
  18. forward WantedShow();
  19.  
  20. enum fsSyS{
  21. Float:fsMinX,
  22. Float:fsMinY,
  23. Float:fsMaxX,
  24. Float:fsMaxY,
  25. Float:fsCTFx,
  26. Float:fsCTFy,
  27. Float:fsCTFz,
  28. fsOwnerFaction,
  29. fsAttackFaction,
  30. fsKillsOfOwner,
  31. fsKillsOfAttack,
  32. fsFightTime,
  33. fsCTF[3],
  34. fsLastFight,
  35. fsZoneID,
  36. fsFlag,
  37. Text:fsWinFaction,
  38. Text:fsLoseFaction,
  39. Text:fsWinKills,
  40. Text:fsLoseKills,
  41. Text:fsTime
  42. };
  43. new FightSystem[][fsSyS]={
  44. /*MinX, MinY, MaxX, MaxY, CTFx, CTFy, CTFz*/
  45. {2727.9424,-1828.0203,11.8438,351.0223,2727.9424,-1828.0203,11.8438},//Arena
  46. {2793.5134,-1087.9183,30.2709,181.8607,2793.5134,-1087.9183,30.2709},//Parkhaus
  47. {2804.2117,-1429.2977,39.5956,12.1877,2804.2117,-1429.2977,39.5956},//Hotel
  48. {-2506.7,740.0255,-2383.094,826.8147,2459.4094,787.3281,35.1719},//Markt
  49. {-1850.044,1438.284,-1710.987,1584.248,-1789.1478,1543.3608,7.1875},//Hafen
  50. {-1891.4263,857.8361,-1722.0261,1095.5897,-1720.0752,1018.2902,17.5859},//Bank
  51. {1828.318,-1938.465,2071.699,-1760.817,1958.6156,-1853.2424,4.3392},//Tanke
  52. {1828.0573,-2161.2705,1956.4136,-2057.7964,1924.0941,-2125.0146,13.5826}//Airport(LS)
  53. };
  54. new Text:Fight,Text:FightUnderline;
  55. new FightTimer[2];
  56.  
  57. main()
  58. {
  59.  
  60. }
  61. public OnGameModeInit()
  62. {
  63. SetGameModeText("Training Server");
  64. AddPlayerClass(106,2495.4700,-1691.1353,14.7656,88.7245,24,999,31,1000,0,0); // Groveskin
  65. AddPlayerClass(104,2526.5800,-1033.9400,69.5800,255.1027,24,999,31,1000,0,0); // Vagosskin
  66. return 1;
  67. }
  68.  
  69. public OnGameModeExit()
  70. {
  71. return 1;
  72. }
  73.  
  74. public OnPlayerRequestClass(playerid, classid)
  75. {
  76. SetupPlayerForClassSelection(playerid);
  77. switch (classid)
  78. {
  79. case 0:
  80. {
  81. GameTextForPlayer(playerid, "~COLOR_GREEN~Grove Street", 1200, 3);
  82. Faction[playerid] = 1;
  83. }
  84. case 1:
  85. {
  86. GameTextForPlayer(playerid, "~COLOR_PURPLE~Ballas Family", 1200, 3);
  87. Faction[playerid] = 2;
  88. }
  89.  
  90. }
  91. return 1;
  92. }
  93.  
  94. public OnPlayerConnect(playerid)
  95. {
  96. return 1;
  97. }
  98.  
  99. public OnPlayerSpawn(playerid)
  100. {
  101. GangZoneShowForPlayer(playerid, Gangfightzone, -66);
  102. GangZoneFlashForAll(Gangfightzone,COLOR_RED2);
  103. if(Faction[playerid] == 1)
  104. {
  105. GivePlayerWeapon(playerid,24,9999);
  106. GivePlayerWeapon(playerid,31,9999);
  107. GivePlayerWeapon(playerid,29,9999);
  108. SetPlayerToTeamColour(playerid);
  109. SetPlayerHealth(playerid, 100);
  110. SetPlayerArmour(playerid, 100);
  111. SetPlayerTeam(playerid,0);
  112. SetPlayerInterior(playerid,0);
  113. SetPlayerPos(playerid, 2498.4678,-1683.5477,13.3831);
  114. TextDrawShowForPlayer(playerid, Textdraw);
  115. }
  116. else if(Faction[playerid] == 2)
  117. {
  118. GivePlayerWeapon(playerid,24,9999);
  119. GivePlayerWeapon(playerid,31,9999);
  120. GivePlayerWeapon(playerid,29,9999);
  121. SetPlayerColor(playerid, 0xFFFF00AA);
  122. SetPlayerToTeamColour(playerid);
  123. SetPlayerHealth(playerid, 100);
  124. SetPlayerArmour(playerid, 100);
  125. SetPlayerTeam(playerid,1);
  126. SetPlayerInterior(playerid,0);
  127. SetPlayerPos(playerid, 2520.7314,-2017.1422,13.5469);
  128. TextDrawShowForPlayer(playerid, Textdraw);
  129. }
  130.  
  131. return 1;
  132. }
  133.  
  134. public SetupPlayerForClassSelection(playerid)
  135. {
  136. SetPlayerInterior(playerid,11);
  137. SetPlayerPos(playerid,508.7362,-87.4335,998.9609);
  138. SetPlayerCameraPos(playerid,508.7362,-83.4335,998.9609);
  139. SetPlayerCameraLookAt(playerid,508.7362,-87.4335,998.9609);
  140. SetPlayerFacingAngle(playerid,0.0);
  141. new string[64], pName[MAX_PLAYER_NAME];
  142. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  143. format(string,sizeof string,"%s hat den Server betreten!",pName);
  144. }
  145.  
  146. public OnPlayerCommandText(playerid, cmdtext[])
  147. {
  148. //Fraktionscar SYSTEM LALALALALALL!
  149. FRAC_OnPlayerCommandText(playerid, cmdtext);
  150. //=========================================
  151. //====== GW LALALAL!
  152. if(strcmp(cmdtext,"/gangwar",true)==0){
  153. if(IsAFightFaction(GetPlayerFaction(playerid))){
  154. new TempZone = GetPlayerFightzone(playerid);
  155. if(TempZone != -255){
  156. if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
  157. return SendClientMessage(playerid,FS_COL_GREY,"** Du darfst das nur zu Fuß machen ...");
  158. if(!FightSystem[TempZone][fsFightTime] || FightSystem[TempZone][fsAttackFaction] == -255)
  159. return SendClientMessage(playerid,FS_COL_GREY,"** Hier gibt es nichts zu erobern.");
  160.  
  161. if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid) || FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid)){
  162. if(IsPlayerInRangeOfPoint(playerid,5.0,FightSystem[TempZone][fsCTFx],FightSystem[TempZone][fsCTFy],FightSystem[TempZone][fsCTFz])){
  163. if(FightSystem[TempZone][fsCTF][0] != -255){
  164. if(GetPlayerFaction(FightSystem[TempZone][fsCTF][0]) != GetPlayerFaction(playerid))
  165. SendClientMessage(playerid,FS_COL_GREY,"** Die Flagge wird von deinen Feinden erobert, töte sie zuerst!");
  166. else
  167. SendClientMessage(playerid,FS_COL_GREY,"** Deine Gang / Mafia erobert bereits die Flagge!");
  168. return 1;
  169. }
  170. FightSystem[TempZone][fsCTF][0] = playerid;
  171. new fsName[MAX_PLAYER_NAME];
  172. GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
  173. new fsText[128];
  174. format(fsText,sizeof(fsText),">>> Fight <<< | %s hat begonnen die Flagge zu erobern!",fsName);
  175. for(new i;i<MAX_PLAYERS;i++){
  176. if(IsPlayerConnected(i)){
  177. if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[TempZone][fsAttackFaction]){
  178. PlayerPlaySound(i,1058,0.0,0.0,0.0);
  179. SendClientMessage(i,FS_COL_YELLOW,fsText);
  180. }
  181. }
  182. }
  183. }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist nicht in der nähe der Flagge!");
  184. }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist nicht in diesem Fight verwickelt ...");
  185. }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keinem Gebiet!");
  186. }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keiner Gang / Mafia.");
  187. return 1;
  188. }
  189. if(strcmp(cmdtext,"/invade",true)==0){
  190. if(IsAFightFaction(GetPlayerFaction(playerid))){
  191. for(new fs;fs<sizeof(FightSystem);fs++){
  192. if((FightSystem[fs][fsOwnerFaction] == GetPlayerFaction(playerid) && FightSystem[fs][fsFightTime]) || FightSystem[fs][fsAttackFaction] == GetPlayerFaction(playerid))
  193. return SendClientMessage(playerid,FS_COL_GREY,"** Deine Gang / Mafia ist bereits in einem Fight.");
  194. }
  195. new TempZone = GetPlayerFightzone(playerid);
  196. if(TempZone != -255){
  197. if(!IsAFightFaction(FightSystem[TempZone][fsOwnerFaction]))
  198. return SendClientMessage(playerid,FS_COL_GREY,"Gebiet wurde ausgeschaltet.");
  199. if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid))
  200. return SendClientMessage(playerid,FS_COL_GREY,"** Man greift nicht seine eigenen Leute an.");
  201. if(FightSystem[TempZone][fsFightTime] || FightSystem[TempZone][fsAttackFaction] != -255)
  202. return SendClientMessage(playerid,FS_COL_GREY,"** In diesem Gebiet wird bereits geschossen.");
  203. if(FightSystem[TempZone][fsLastFight]){
  204. new fsText[178];
  205. format(fsText,sizeof(fsText),"Ganggebiet: Dieses Ganggebiet wurde bereits Angegriffen, wartet noch: '%d' Minuten.",FightSystem[TempZone][fsLastFight]);
  206. SendClientMessage(playerid,FS_COL_GREY,fsText);
  207. return 1;
  208. }
  209. for(new fs;fs<sizeof(FightSystem);fs++){
  210. if(FightSystem[fs][fsOwnerFaction] == FightSystem[TempZone][fsOwnerFaction] && (FightSystem[fs][fsFightTime] || FightSystem[fs][fsAttackFaction] != -255))
  211. return SendClientMessage(playerid,FS_COL_GREY,"Ganggebiet: Die Gang / Mafia der das Ganggebiet gehört hat bereits ein Kampf.");
  212. }
  213. new fsTextToOwner[255];
  214. format(fsTextToOwner,sizeof(fsTextToOwner),">>> Fight <<< | Ihr werden von: %s angegriffen, setzt euch zur wehr!",GetFactionNameOfFaction(GetPlayerFaction(playerid)));
  215. new fsName[MAX_PLAYER_NAME];
  216. GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
  217. new fsTextToAttack[255];
  218. format(fsTextToAttack,sizeof(fsTextToAttack),">>> Fight <<< | %s hat ein Kampf mit: %s begonnen, macht sie Platt!",fsName,GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
  219. new fsText[64];
  220. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
  221. TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
  222. TextDrawSetString(FightSystem[TempZone][fsWinKills],"~y~00 Kills");
  223. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(GetPlayerFaction(playerid)));
  224. TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
  225. TextDrawSetString(FightSystem[TempZone][fsLoseKills],"~y~00 Kills");
  226. TextDrawSetString(FightSystem[TempZone][fsTime],"Verbl. Zeit: 120 Minuten");//ZEIT
  227. for(new i;i<MAX_PLAYERS;i++){
  228. if(IsPlayerConnected(i)){
  229. GangZoneFlashForPlayer(i,FightSystem[TempZone][fsZoneID],GetZoneColorOfFaction(GetPlayerFaction(playerid)));
  230. if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction]){
  231. PlayerPlaySound(i,1058,0.0,0.0,0.0);
  232. SendClientMessage(i,FS_COL_YELLOW,fsTextToOwner);
  233. TextDrawShowForPlayer(i,Fight);
  234. TextDrawShowForPlayer(i,FightUnderline);
  235. TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinFaction]);
  236. TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinKills]);
  237. TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseFaction]);
  238. TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseKills]);
  239. TextDrawShowForPlayer(i,FightSystem[TempZone][fsTime]);
  240. }
  241. if(GetPlayerFaction(i) == GetPlayerFaction(playerid)){
  242. PlayerPlaySound(i,1058,0.0,0.0,0.0);
  243. SendClientMessage(i,FS_COL_YELLOW,fsTextToAttack);
  244. TextDrawShowForPlayer(i,Fight);
  245. TextDrawShowForPlayer(i,FightUnderline);
  246. TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinFaction]);
  247. TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinKills]);
  248. TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseFaction]);
  249. TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseKills]);
  250. TextDrawShowForPlayer(i,FightSystem[TempZone][fsTime]);
  251. }
  252. }
  253. }
  254. FightSystem[TempZone][fsAttackFaction] = GetPlayerFaction(playerid);
  255. FightSystem[TempZone][fsKillsOfOwner] = 0;
  256. FightSystem[TempZone][fsKillsOfAttack] = 0;
  257. FightSystem[TempZone][fsFightTime] = 120;//ZEIT
  258. FightSystem[TempZone][fsCTF][0] = -255;
  259. FightSystem[TempZone][fsCTF][1] = 0;
  260. FightSystem[TempZone][fsCTF][2] = 0;
  261. return 1;
  262. }return SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keinem Gebiet!");
  263. }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keiner Gang / Mafia.");
  264. return 1;
  265. }
  266.  
  267. forward GW_OnPlayerDisconnect(playerid);
  268. public GW_OnPlayerDisconnect(playerid){
  269. for(new fs;fs<sizeof(FightSystem);fs++){
  270. if(FightSystem[fs][fsAttackFaction] != -255 && FightSystem[fs][fsFightTime]){
  271. if(FightSystem[fs][fsCTF][0] != -255 && FightSystem[fs][fsCTF][0] == playerid){
  272. new fsName[MAX_PLAYER_NAME];
  273. GetPlayerName(FightSystem[fs][fsCTF][0],fsName,MAX_PLAYER_NAME);
  274. new fsText[128];
  275. format(fsText,sizeof(fsText),">>> Fight <<< | %s hat es nicht geschafft die Flagge zu erobern!",fsName);
  276. for(new i;i<MAX_PLAYERS;i++){
  277. if(IsPlayerConnected(i)){
  278. if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
  279. PlayerPlaySound(i,1058,0.0,0.0,0.0);
  280. SendClientMessage(i,FS_COL_YELLOW,fsText);
  281. }
  282. }
  283. }
  284. FightSystem[fs][fsCTF][0] = -255;
  285. FightSystem[fs][fsCTF][1] = 0;
  286. FightSystem[fs][fsCTF][2] = 0;
  287. }
  288. if(GetPVarInt(playerid,"Spawned")==1){
  289. GangZoneStopFlashForPlayer(playerid,FightSystem[fs][fsZoneID]);
  290. if(GetPlayerFaction(playerid) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(playerid) == FightSystem[fs][fsAttackFaction]){
  291. TextDrawHideForPlayer(playerid,Fight);
  292. TextDrawHideForPlayer(playerid,FightUnderline);
  293. TextDrawHideForPlayer(playerid,FightSystem[fs][fsWinFaction]);
  294. TextDrawHideForPlayer(playerid,FightSystem[fs][fsLoseFaction]);
  295. TextDrawHideForPlayer(playerid,FightSystem[fs][fsWinKills]);
  296. TextDrawHideForPlayer(playerid,FightSystem[fs][fsLoseKills]);
  297. TextDrawHideForPlayer(playerid,FightSystem[fs][fsTime]);
  298. }
  299. }
  300. }GangZoneHideForPlayer(playerid,FightSystem[fs][fsZoneID]);
  301. }DeletePVar(playerid,"Spawned");
  302. return 1;
  303. }
  304. forward GW_OnPlayerSpawn(playerid);
  305. public GW_OnPlayerSpawn(playerid){
  306. if(GetPVarInt(playerid,"Spawned")==0){
  307. SetPVarInt(playerid,"Spawned",1);
  308. for(new fs;fs<sizeof(FightSystem);fs++){
  309. if(FightSystem[fs][fsAttackFaction] != -255 && FightSystem[fs][fsFightTime]){
  310. GangZoneFlashForPlayer(playerid,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsAttackFaction]));
  311. if(GetPlayerFaction(playerid) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(playerid) == FightSystem[fs][fsAttackFaction]){
  312. TextDrawShowForPlayer(playerid,Fight);
  313. TextDrawShowForPlayer(playerid,FightUnderline);
  314. TextDrawShowForPlayer(playerid,FightSystem[fs][fsWinFaction]);
  315. TextDrawShowForPlayer(playerid,FightSystem[fs][fsLoseFaction]);
  316. TextDrawShowForPlayer(playerid,FightSystem[fs][fsWinKills]);
  317. TextDrawShowForPlayer(playerid,FightSystem[fs][fsLoseKills]);
  318. TextDrawShowForPlayer(playerid,FightSystem[fs][fsTime]);
  319. }
  320. }
  321. }
  322. }return 1;
  323. }
  324. forward GW_OnPlayerDeath(playerid, killerid, reason);
  325. public GW_OnPlayerDeath(playerid, killerid, reason){
  326. if(IsPlayerConnected(killerid)){
  327. if(IsAFightFaction(GetPlayerFaction(killerid))){
  328. new TempZone = GetPlayerFightzone(killerid);
  329. if(TempZone != -255){
  330. if(FightSystem[TempZone][fsFightTime] && FightSystem[TempZone][fsAttackFaction] != -255){
  331. if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(killerid) || FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(killerid)){
  332. if(IsAFightFaction(GetPlayerFaction(playerid))){
  333. new fsText[64];
  334. if(FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(killerid) && FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid)){
  335. PlayerPlaySound(killerid,1084,0.0,0.0,0.0);
  336. GameTextForPlayer(killerid,"~g~GANGFIGHTKILL",3125,3);
  337. GameTextForPlayer(playerid,"~r~GANGFIGHTKILL",3125,3);
  338. FightSystem[TempZone][fsKillsOfAttack]++;
  339. if(FightSystem[TempZone][fsKillsOfOwner] > FightSystem[TempZone][fsKillsOfAttack]){
  340. format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
  341. TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
  342. format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
  343. TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
  344. format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
  345. TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
  346. format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
  347. TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
  348. }
  349. else if(FightSystem[TempZone][fsKillsOfAttack] > FightSystem[TempZone][fsKillsOfOwner]){
  350. format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
  351. TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
  352. format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
  353. TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
  354. format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
  355. TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
  356. format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
  357. TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
  358. }else{
  359. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
  360. TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
  361. format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
  362. TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
  363. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
  364. TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
  365. format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
  366. TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
  367. }
  368. }
  369. else if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(killerid) && FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid)){
  370. PlayerPlaySound(killerid,1084,0.0,0.0,0.0);
  371. GameTextForPlayer(killerid,"~g~GANGFIGHTKILL",3125,3);
  372. GameTextForPlayer(playerid,"~r~GANGFIGHTKILL",3125,3);
  373. FightSystem[TempZone][fsKillsOfOwner]++;
  374. if(FightSystem[TempZone][fsKillsOfOwner] > FightSystem[TempZone][fsKillsOfAttack]){
  375. format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
  376. TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
  377. format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
  378. TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
  379. format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
  380. TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
  381. format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
  382. TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
  383. }
  384. else if(FightSystem[TempZone][fsKillsOfAttack] > FightSystem[TempZone][fsKillsOfOwner]){
  385. format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
  386. TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
  387. format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
  388. TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
  389. format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
  390. TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
  391. format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
  392. TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
  393. }else{
  394. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
  395. TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
  396. format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
  397. TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
  398. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
  399. TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
  400. format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
  401. TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
  402. }
  403. }
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }
  410. if(IsAFightFaction(GetPlayerFaction(playerid))){
  411. new TempZone = GetPlayerFightzone(playerid);
  412. if(TempZone != -255){
  413. if(FightSystem[TempZone][fsFightTime] && FightSystem[TempZone][fsAttackFaction] != -255){
  414. if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid) || FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid)){
  415. if(FightSystem[TempZone][fsCTF][0] == playerid){
  416. new fsName[MAX_PLAYER_NAME];
  417. GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
  418. new fsText[128];
  419. format(fsText,sizeof(fsText),">>> Fight <<< | %s hat es nicht geschafft die Flagge zu erobern.",fsName);
  420. for(new i;i<MAX_PLAYERS;i++){
  421. if(IsPlayerConnected(i)){
  422. if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[TempZone][fsAttackFaction]){
  423. PlayerPlaySound(i,1058,0.0,0.0,0.0);
  424. SendClientMessage(i,FS_COL_YELLOW,fsText);
  425. }
  426. }
  427. }
  428. FightSystem[TempZone][fsCTF][0] = -255;
  429. FightSystem[TempZone][fsCTF][1] = 0;
  430. FightSystem[TempZone][fsCTF][2] = 0;
  431. }
  432. }
  433. }
  434. }
  435. }return 1;
  436. }
  437. public FightUpdate_1(){
  438. for(new fs;fs<sizeof(FightSystem);fs++){
  439. if(FightSystem[fs][fsFightTime] && FightSystem[fs][fsAttackFaction] != -255){
  440. new fsText[128];
  441. if(FightSystem[fs][fsCTF][0] != -255){
  442. if(IsPlayerConnected(FightSystem[fs][fsCTF][0])){
  443. if(IsPlayerInRangeOfPoint(FightSystem[fs][fsCTF][0],5.0,FightSystem[fs][fsCTFx],FightSystem[fs][fsCTFy],FightSystem[fs][fsCTFz])){
  444. FightSystem[fs][fsCTF][2] = 0;
  445. FightSystem[fs][fsCTF][1]++;
  446. format(fsText,sizeof(fsText),"~n~~n~~n~~n~~n~~n~~n~~w~Bonus in:~n~~r~%d ~w~Sekunden",(60-FightSystem[fs][fsCTF][1]));
  447. GameTextForPlayer(FightSystem[fs][fsCTF][0],fsText,1250,3);
  448. if(FightSystem[fs][fsCTF][1] >= 60){
  449. new fsName[MAX_PLAYER_NAME];
  450. GetPlayerName(FightSystem[fs][fsCTF][0],fsName,MAX_PLAYER_NAME);
  451. FightSystem[fs][fsCTF][1] = 0;
  452. format(fsText,sizeof(fsText),">>> Fight <<< | %s hat die Flagge erobert!",fsName);
  453. for(new i;i<MAX_PLAYERS;i++){
  454. if(IsPlayerConnected(i)){
  455. if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
  456. PlayerPlaySound(i,1058,0.0,0.0,0.0);
  457. SendClientMessage(i,FS_COL_YELLOW,fsText);
  458. }
  459. }
  460. }
  461. if(GetPlayerFaction(FightSystem[fs][fsCTF][0]) == FightSystem[fs][fsOwnerFaction])
  462. FightSystem[fs][fsKillsOfOwner]++;
  463. if(GetPlayerFaction(FightSystem[fs][fsCTF][0]) == FightSystem[fs][fsAttackFaction])
  464. FightSystem[fs][fsKillsOfAttack]++;
  465. if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
  466. format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
  467. TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
  468. format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[fs][fsKillsOfOwner]);
  469. TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
  470. format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
  471. TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
  472. format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[fs][fsKillsOfAttack]);
  473. TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
  474. }
  475. else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
  476. format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
  477. TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
  478. format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[fs][fsKillsOfAttack]);
  479. TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
  480. format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
  481. TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
  482. format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[fs][fsKillsOfOwner]);
  483. TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
  484. }else{
  485. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
  486. TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
  487. format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[fs][fsKillsOfOwner]);
  488. TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
  489. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
  490. TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
  491. format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[fs][fsKillsOfAttack]);
  492. TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
  493. }FightSystem[fs][fsCTF][0] = -255;
  494. }
  495. }else{
  496. format(fsText,sizeof(fsText),"~n~~n~~n~~n~~n~~n~~n~~r~Erobere die Flagge!~n~~b~%d Sekunden",(10-FightSystem[fs][fsCTF][2]));
  497. GameTextForPlayer(FightSystem[fs][fsCTF][0],fsText,1250,3);
  498. FightSystem[fs][fsCTF][2]++;
  499. if(FightSystem[fs][fsCTF][2] >= 10){
  500. new fsName[MAX_PLAYER_NAME];
  501. GetPlayerName(FightSystem[fs][fsCTF][0],fsName,MAX_PLAYER_NAME);
  502. format(fsText,sizeof(fsText),">>> Fight <<< | %s hat es nicht geschafft die Flagge zu erobern!",fsName);
  503. for(new i;i<MAX_PLAYERS;i++){
  504. if(IsPlayerConnected(i)){
  505. if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
  506. PlayerPlaySound(i,1058,0.0,0.0,0.0);
  507. SendClientMessage(i,FS_COL_YELLOW,fsText);
  508. }
  509. }
  510. }
  511. FightSystem[fs][fsCTF][0] = -255;
  512. FightSystem[fs][fsCTF][1] = 0;
  513. FightSystem[fs][fsCTF][2] = 0;
  514. }
  515. }
  516. }else{
  517. FightSystem[fs][fsCTF][0] = -255;
  518. FightSystem[fs][fsCTF][1] = 0;
  519. FightSystem[fs][fsCTF][2] = 0;
  520. }
  521. }
  522. }
  523. }return 1;
  524. }
  525. public FightUpdate_2(){
  526. for(new fs;fs<sizeof(FightSystem);fs++){
  527. if(FightSystem[fs][fsFightTime]){
  528. FightSystem[fs][fsFightTime]--;
  529. new fsText[64];
  530. format(fsText,sizeof(fsText),"Verbl. Zeit: %d Minuten",FightSystem[fs][fsFightTime]);
  531. TextDrawSetString(FightSystem[fs][fsTime],fsText);
  532. if(!FightSystem[fs][fsFightTime]){
  533. FightSystem[fs][fsLastFight] = 0;
  534. new fsTextToOwner[255];
  535. new fsTextToAttack[255];
  536. new fsType;
  537. if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
  538. fsType = 2;
  539. format(fsTextToOwner,sizeof(fsTextToOwner),">>> Fight <<< | Ihr habt gewonnen...");
  540. format(fsTextToAttack,sizeof(fsTextToAttack),">>> Fight <<< | Ihr habt verloren...");
  541. }
  542. else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
  543. fsType = 3;
  544. format(fsTextToOwner,sizeof(fsTextToOwner),">>> Fight <<< | Ihr habt verloren...");
  545. format(fsTextToAttack,sizeof(fsTextToAttack),">>> Fight <<< | Ihr habt gewonnen...");
  546. }else{
  547. fsType = 1;
  548. format(fsTextToOwner,sizeof(fsTextToOwner),">>> Fight <<< | Unentschieden, ihr behaltet euer gebiet.");
  549. format(fsTextToAttack,sizeof(fsTextToAttack),">>> Fight <<< | Unentschieden, ihr müsst euch mehr antrengen.");
  550. }
  551. for(new i;i<MAX_PLAYERS;i++){
  552. if(IsPlayerConnected(i)){
  553. GangZoneStopFlashForPlayer(i,FightSystem[fs][fsZoneID]);
  554. if(fsType == 3){
  555. GangZoneHideForPlayer(i,FightSystem[fs][fsZoneID]);
  556. GangZoneShowForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsAttackFaction]));
  557. }
  558. if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction]){
  559. PlayerPlaySound(i,1058,0.0,0.0,0.0);
  560. TextDrawHideForPlayer(i,Fight);
  561. TextDrawHideForPlayer(i,FightUnderline);
  562. TextDrawHideForPlayer(i,FightSystem[fs][fsWinFaction]);
  563. TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
  564. TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
  565. TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
  566. TextDrawHideForPlayer(i,FightSystem[fs][fsTime]);
  567. SendClientMessage(i,FS_COL_YELLOW,fsTextToOwner);
  568. if(fsType == 3 && GetPlayerFightzone(i) == fs)
  569. SetPlayerHealth(i,0.0);
  570. }
  571. else if(GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
  572. PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
  573. TextDrawHideForPlayer(i,Fight);
  574. TextDrawHideForPlayer(i,FightUnderline);
  575. TextDrawHideForPlayer(i,FightSystem[fs][fsWinFaction]);
  576. TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
  577. TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
  578. TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
  579. TextDrawHideForPlayer(i,FightSystem[fs][fsTime]);
  580. SendClientMessage(i,FS_COL_YELLOW,fsTextToAttack);
  581. if(fsType != 3 && GetPlayerFightzone(i) == fs)
  582. SetPlayerHealth(i,0.0);
  583. }
  584. }
  585. }
  586. FightSystem[fs][fsKillsOfAttack] = 0;
  587. FightSystem[fs][fsKillsOfOwner] = 0;
  588. if(fsType == 3)
  589. FightSystem[fs][fsOwnerFaction] = FightSystem[fs][fsAttackFaction];
  590. FightSystem[fs][fsAttackFaction] = -255;
  591. FightSystem[fs][fsCTF][0] = -255;
  592. }
  593. }
  594. if(FightSystem[fs][fsLastFight])
  595. FightSystem[fs][fsLastFight]--;
  596. }return 1;
  597. }
  598. public Fight_Init(){
  599. Fight = TextDrawCreate(88.000000,244.000000,"Fight:~n~_~n~_~n~_~n~_~n~_");
  600. TextDrawUseBox(Fight,1);
  601. TextDrawBoxColor(Fight,0x00000066);
  602. TextDrawTextSize(Fight,102.000000,124.000000);
  603. TextDrawAlignment(Fight,2);
  604. TextDrawBackgroundColor(Fight,0xff000033);
  605. TextDrawFont(Fight,2);
  606. TextDrawLetterSize(Fight,0.499999,1.000000);
  607. TextDrawColor(Fight,0xffffffff);
  608. TextDrawSetOutline(Fight,1);
  609. TextDrawSetProportional(Fight,1);
  610. FightUnderline = TextDrawCreate(91.000000,274.000000,".");
  611. TextDrawAlignment(FightUnderline,2);
  612. TextDrawBackgroundColor(FightUnderline,0x000000ff);
  613. TextDrawFont(FightUnderline,3);
  614. TextDrawLetterSize(FightUnderline,14.799997,1.000000);
  615. TextDrawColor(FightUnderline,0xffffffff);
  616. TextDrawSetProportional(FightUnderline,1);
  617. TextDrawSetShadow(FightUnderline,1);
  618. if(!fexist("Fightzones.cfg")){
  619. new File:fFile=fopen("Fightzones.cfg",io_write);
  620. for(new fs;fs<sizeof(FightSystem);fs++)
  621. fwrite(fFile,"-255 -255 0 0 0\r\n");
  622. fclose(fFile);
  623. }
  624. new File:fFile=fopen("Fightzones.cfg",io_read),Content[64],fs;
  625. while(fread(fFile,Content) && fs < sizeof(FightSystem)){
  626. FightSystem[fs][fsWinFaction] = TextDrawCreate(26.000000,256.000000," ");
  627. TextDrawSetProportional(FightSystem[fs][fsWinFaction],1);
  628. TextDrawAlignment(FightSystem[fs][fsWinFaction],0);
  629. TextDrawBackgroundColor(FightSystem[fs][fsWinFaction],0x000000ff);
  630. TextDrawFont(FightSystem[fs][fsWinFaction],2);
  631. TextDrawLetterSize(FightSystem[fs][fsWinFaction],0.199999,1.000000);
  632. TextDrawColor(FightSystem[fs][fsWinFaction],0xffffffff);
  633. TextDrawSetOutline(FightSystem[fs][fsWinFaction],1);
  634. FightSystem[fs][fsLoseFaction] = TextDrawCreate(26.000000,267.000000," ");
  635. TextDrawSetProportional(FightSystem[fs][fsLoseFaction],1);
  636. TextDrawSetOutline(FightSystem[fs][fsLoseFaction],1);
  637. TextDrawColor(FightSystem[fs][fsLoseFaction],0xffffffff);
  638. TextDrawFont(FightSystem[fs][fsLoseFaction],2);
  639. TextDrawLetterSize(FightSystem[fs][fsLoseFaction],0.199999,0.899999);
  640. TextDrawBackgroundColor(FightSystem[fs][fsLoseFaction],0x000000ff);
  641. TextDrawAlignment(FightSystem[fs][fsLoseFaction],0);
  642. FightSystem[fs][fsWinKills] = TextDrawCreate(107.000000,256.000000," ");
  643. TextDrawSetProportional(FightSystem[fs][fsWinKills],1);
  644. TextDrawSetOutline(FightSystem[fs][fsWinKills],1);
  645. TextDrawColor(FightSystem[fs][fsWinKills],0xffffffff);
  646. TextDrawSetShadow(FightSystem[fs][fsWinKills],1);
  647. TextDrawFont(FightSystem[fs][fsWinKills],2);
  648. TextDrawLetterSize(FightSystem[fs][fsWinKills],0.199999,1.000000);
  649. TextDrawBackgroundColor(FightSystem[fs][fsWinKills],0x000000ff);
  650. TextDrawAlignment(FightSystem[fs][fsWinKills],0);
  651. FightSystem[fs][fsLoseKills] = TextDrawCreate(107.000000,267.000000," ");
  652. TextDrawSetProportional(FightSystem[fs][fsLoseKills],1);
  653. TextDrawSetShadow(FightSystem[fs][fsLoseKills],1);
  654. TextDrawSetOutline(FightSystem[fs][fsLoseKills],1);
  655. TextDrawColor(FightSystem[fs][fsLoseKills],0xffffffff);
  656. TextDrawFont(FightSystem[fs][fsLoseKills],2);
  657. TextDrawLetterSize(FightSystem[fs][fsLoseKills],0.199999,1.000000);
  658. TextDrawBackgroundColor(FightSystem[fs][fsLoseKills],0x000000ff);
  659. TextDrawAlignment(FightSystem[fs][fsLoseKills],0);
  660. FightSystem[fs][fsTime] = TextDrawCreate(26.000000,286.000000," ");
  661. TextDrawColor(FightSystem[fs][fsTime],0xffffffff);
  662. TextDrawAlignment(FightSystem[fs][fsTime],0);
  663. TextDrawBackgroundColor(FightSystem[fs][fsTime],0x000000ff);
  664. TextDrawFont(FightSystem[fs][fsTime],2);
  665. TextDrawLetterSize(FightSystem[fs][fsTime],0.199999,0.899999);
  666. TextDrawSetProportional(FightSystem[fs][fsTime],1);
  667. StripNewLine(Content);
  668. sscanf(Content,"ddddd",FightSystem[fs][fsOwnerFaction],FightSystem[fs][fsAttackFaction],FightSystem[fs][fsKillsOfOwner],FightSystem[fs][fsKillsOfAttack],FightSystem[fs][fsFightTime]);
  669. FightSystem[fs][fsCTF][0] = -255;
  670. FightSystem[fs][fsCTF][1] = 0;
  671. FightSystem[fs][fsCTF][2] = 0;
  672. FightSystem[fs][fsLastFight] = 0;
  673. FightSystem[fs][fsZoneID] = GangZoneCreate(FightSystem[fs][fsMinX],FightSystem[fs][fsMinY],FightSystem[fs][fsMaxX],FightSystem[fs][fsMaxY]);
  674. FightSystem[fs][fsFlag] = CreatePickup(1314,1,FightSystem[fs][fsCTFx],FightSystem[fs][fsCTFy],FightSystem[fs][fsCTFz],-1);
  675. if(FightSystem[fs][fsFightTime] && FightSystem[fs][fsAttackFaction] != -255){
  676. new fsText[64];
  677. format(fsText,sizeof(fsText),"Verbl. Zeit: %d Minuten",FightSystem[fs][fsFightTime]);
  678. TextDrawSetString(FightSystem[fs][fsTime],fsText);
  679. if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
  680. format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
  681. TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
  682. format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[fs][fsKillsOfOwner]);
  683. TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
  684. format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
  685. TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
  686. format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[fs][fsKillsOfAttack]);
  687. TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
  688. }
  689. else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
  690. format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
  691. TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
  692. format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[fs][fsKillsOfAttack]);
  693. TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
  694. format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
  695. TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
  696. format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[fs][fsKillsOfOwner]);
  697. TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
  698. }else{
  699. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
  700. TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
  701. format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[fs][fsKillsOfOwner]);
  702. TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
  703. format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
  704. TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
  705. format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[fs][fsKillsOfAttack]);
  706. TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
  707. }
  708. }
  709. for(new i;i<MAX_PLAYERS;i++){
  710. if(IsPlayerConnected(i)){
  711. SetPVarInt(i,"Spawned",1);
  712. GangZoneShowForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsOwnerFaction]));
  713. if(FightSystem[fs][fsAttackFaction] && FightSystem[fs][fsFightTime]){
  714. GangZoneFlashForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsAttackFaction]));
  715. if(GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction] || GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction]){
  716. TextDrawShowForPlayer(i,Fight);
  717. TextDrawShowForPlayer(i,FightUnderline);
  718. TextDrawShowForPlayer(i,FightSystem[fs][fsWinFaction]);
  719. TextDrawShowForPlayer(i,FightSystem[fs][fsLoseFaction]);
  720. TextDrawShowForPlayer(i,FightSystem[fs][fsWinKills]);
  721. TextDrawShowForPlayer(i,FightSystem[fs][fsLoseKills]);
  722. TextDrawShowForPlayer(i,FightSystem[fs][fsTime]);
  723. }
  724. }
  725. }
  726. }
  727. fs++;
  728. }
  729. fclose(fFile);
  730. FightTimer[0] = SetTimer("FightUpdate_1",1003,true);
  731. FightTimer[1] = SetTimer("FightUpdate_2",60017,true);
  732. return 1;
  733. }
  734. public Fight_Close(){
  735. KillTimer(FightTimer[0]);
  736. KillTimer(FightTimer[1]);
  737. if(fexist("Fightzones.cfg")) fremove("Fightzones.cfg");
  738. new File:fFile=fopen("Fightzones.cfg",io_append),Content[64];
  739. for(new fs;fs<sizeof(FightSystem);fs++){
  740. if(FightSystem[fs][fsAttackFaction] != -255 && FightSystem[fs][fsFightTime]){
  741. GangZoneStopFlashForAll(FightSystem[fs][fsZoneID]);
  742. for(new i;i<MAX_PLAYERS;i++){
  743. if(IsPlayerConnected(i)){
  744. DeletePVar(i,"Spawned");
  745. if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
  746. TextDrawHideForPlayer(i,Fight);
  747. TextDrawHideForPlayer(i,FightUnderline);
  748. TextDrawHideForPlayer(i,FightSystem[fs][fsWinFaction]);
  749. TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
  750. TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
  751. TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
  752. TextDrawHideForPlayer(i,FightSystem[fs][fsTime]);
  753. }
  754. }
  755. }
  756. }
  757. TextDrawDestroy(FightSystem[fs][fsWinFaction]);
  758. TextDrawDestroy(FightSystem[fs][fsLoseFaction]);
  759. TextDrawDestroy(FightSystem[fs][fsWinKills]);
  760. TextDrawDestroy(FightSystem[fs][fsLoseKills]);
  761. TextDrawDestroy(FightSystem[fs][fsTime]);
  762. GangZoneHideForAll(FightSystem[fs][fsZoneID]);
  763. GangZoneDestroy(FightSystem[fs][fsZoneID]);
  764. DestroyPickup(FightSystem[fs][fsFlag]);
  765. format(Content,sizeof(Content),"%d %d %d %d %d\r\n",FightSystem[fs][fsOwnerFaction],FightSystem[fs][fsAttackFaction],FightSystem[fs][fsKillsOfOwner],FightSystem[fs][fsKillsOfAttack],FightSystem[fs][fsFightTime]);
  766. fwrite(fFile,Content);
  767. }
  768. fclose(fFile);
  769. TextDrawDestroy(Fight);
  770. TextDrawDestroy(FightUnderline);
  771. return 1;
  772. }
  773. stock GetPlayerFightzone(playerid){
  774. new Float:GangZone[3];
  775. GetPlayerPos(playerid,GangZone[0],GangZone[1],GangZone[2]);
  776. for(new fs;fs<sizeof(FightSystem);fs++){
  777. if((GangZone[0] >= FightSystem[fs][fsMinX] && GangZone[0] <= FightSystem[fs][fsMaxX]) && (GangZone[1] >= FightSystem[fs][fsMinY] && GangZone[1] <= FightSystem[fs][fsMaxY]) && GangZone[2] <= 500)
  778. return fs;
  779. }return -255;
  780. }
  781. stock IsAFightFaction(Faction){
  782. if((Faction == 5 || Faction == 6) || (Faction >= 13 && Faction <= 17) || Faction == 22)
  783. return 1;
  784. return 0;
  785. }
  786. stock GetZoneColorOfFaction(Faction){
  787. if(Faction == 5) return 0x00000095; // L.C.N
  788. else if(Faction == 6) return 0x9D9D9D95; // Yakuza
  789. else if(Faction == 13) return 0x00800095; // G.S.F
  790. else if(Faction == 14) return 0x80008095; // Ballas
  791. else if(Faction == 15) return 0xFF000095; // Red Soldiers
  792. else if(Faction == 16) return 0xFFFF0095; // Vagos
  793. else if(Faction == 17) return 0x0080FF95; // Atzecas
  794. else if(Faction == 22) return 0x0000E196; // Triaden
  795. else return 0xFFFFFF77; // NoN-Gang
  796. }
  797. stock GetFactionNameOfFaction(Faction){
  798. new FactionName[64];
  799. if(Faction == 1) format(FactionName,sizeof(FactionName),"Grove Street");
  800. else if(Faction == 2) format(FactionName,sizeof(FactionName),"Ballas");
  801. else format(FactionName,sizeof(FactionName),"NoN-Gang");
  802. return FactionName;
  803. }
  804. stock GetPlayerFaction(playerid){
  805. new Member = GetPlayerMember(playerid);
  806. if(Member)
  807. return Member;
  808. new Leader = GetPlayerLeader(playerid);
  809. if(Leader)
  810. return Leader;
  811. return 0;
  812. }
  813. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement