Advertisement
Guest User

Untitled

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