Advertisement
Guest User

RGR Gangfight by [My]Kevin

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