Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FS_COL_GREY (0xFF2800FF)
- #define FS_COL_YELLOW (0xFFAA00FF)
- #define GANGFIGHT_DAUER 30 //Standart :60 Minuten
- // Die folgenden beiden Funktionen in den Gamemode einfügen
- /*
- forward GetPlayerMember(playerid);
- public GetPlayerMember(playerid)
- {
- return PlayerInfo[playerid][pMember];
- }
- forward GetPlayerLeader(playerid);
- public GetPlayerLeader(playerid)
- {
- return PlayerInfo[playerid][pLeader];
- }
- */
- stock GetZoneColorOfFaction(Faction){
- if(Faction == 5) return 0x19000095; // LCN
- else if(Faction == 6) return 0xF0F0F0CA; // Yakuza
- else if(Faction == 8) return 0x73000095; // Hitman
- else if(Faction == 12) return 0x82828295; // Triaden
- else if(Faction == 13) return 0xB9009D95; // Ballas
- else if(Faction == 14) return 0x008C009D; // Groove
- else if(Faction == 15) return 0x00FF9395; // Biker
- else if(Faction == 16) return 0xFFBE0095; // Vagos
- else if(Faction == 17) return 0x56FFFF95; // Aztekas
- else if(Faction == 18) return 0xFF460095; // Rifas
- else if(Faction == 19) return 0xFFAA00D6; // Carli Kartell
- else if(Faction == 21) return 0x00FF0095; // Wheelman
- else if(Faction == 23) return 0x14141495; // Brigada
- else return 0x00FFB4FF; // NoN-Gang
- }
- stock GetFactionNameOfFaction(Faction){
- new FactionName[64];
- if(Faction == 5) format(FactionName,sizeof(FactionName),"LCN");
- else if(Faction == 6) format(FactionName,sizeof(FactionName),"Yakuza");
- else if(Faction == 8) format(FactionName,sizeof(FactionName),"Hitman");
- else if(Faction == 12) format(FactionName,sizeof(FactionName),"Triaden");
- else if(Faction == 13) format(FactionName,sizeof(FactionName),"Ballas");
- else if(Faction == 14) format(FactionName,sizeof(FactionName),"Groove");
- else if(Faction == 15) format(FactionName,sizeof(FactionName),"Biker");
- else if(Faction == 16) format(FactionName,sizeof(FactionName),"Vagos");
- else if(Faction == 17) format(FactionName,sizeof(FactionName),"Aztecas");
- else if(Faction == 18) format(FactionName,sizeof(FactionName),"Rifas");
- else if(Faction == 19) format(FactionName,sizeof(FactionName),"Carli Kartell");
- else if(Faction == 21) format(FactionName,sizeof(FactionName),"Wheelman");
- else if(Faction == 23) format(FactionName,sizeof(FactionName),"Brigada");
- else format(FactionName,sizeof(FactionName),"NoN-Gang");
- return FactionName;
- }
- stock IsAFightFaction(Faction){
- if(Faction == 5 ||Faction == 6 ||Faction == 8 || (Faction >= 12 && Faction <= 19) || Faction == 21|| Faction == 23)
- return 1;
- return 0;
- }
- forward Fight_Init();
- forward Fight_Close();
- forward FightUpdate_1();
- forward FightUpdate_2();
- enum fsSyS{
- Float:fsMinX,
- Float:fsMinY,
- Float:fsMaxX,
- Float:fsMaxY,
- Float:fsCTFx,
- Float:fsCTFy,
- Float:fsCTFz,
- fsOwnerFaction,
- fsAttackFaction,
- fsKillsOfOwner,
- fsKillsOfAttack,
- fsFightTime,
- fsCTF[3],
- fsLastFight,
- fsZoneID,
- fsFlag,
- Text:fsWinFaction,
- Text:fsLoseFaction,
- Text:fsWinKills,
- Text:fsLoseKills,
- Text:fsTime
- };
- new FightSystem[14][fsSyS]={
- /*MinX, MinY, MaxX, MaxY, CTFx, CTFy, CTFz*/
- {1060.145,-1721.339,1166.624,-1583.168,1072.4016,-1619.3834,20.4583},//Kaufhaus
- {-887.5186,1377.989,-583.8938,1634.903,-813.6335,1525.2080,26.5065},//Wüste (EDIT)
- {116.9961,-206.6548,325.0713,23.0153,184.0991,-132.7829,1.5781},//NÄHE BAUERNHOFF!
- {-1850.044,1438.284,-1710.987,1584.248,-1789.1478,1543.3608,7.1875},//Hafen
- {2757.3616,2282.8716,2918.1382,2555.8530,2834.3164,2345.0874,10.8130},//LV EINKAUFSZENTRUM!
- {2559.6809,-2564.0767,2809.9153,-2330.7429,2773.5503,-2503.6750,13.6346},//DOGS!
- {1828.318,-1938.465,2071.699,-1760.817,1958.6156,-1853.2424,4.3392},//Tankstelle (GS)
- {990.2909,1821.38,1177.724,2057.332,1067.5798,1884.2932,10.8203},//Container
- {-2506.7,740.0255,-2383.094,826.8147,2459.4094,787.3281,35.1719},//Markt
- {-1891.4263,857.8361,-1722.0261,1095.5897,-1720.0752,1018.2902,17.5859},//Bank
- {-2740.5977,344.5840,-2671.9817,406.6133,-2706.5498,376.1853,4.9687},//sf stadthalle...
- {1854.8732,-1471.0433,1947.8140,-1367.2166,1886.1451,-1425.1245,10.3594},//SKATE PARK!
- {2824.4021,-1485.0060,2785.6079,-1415.1707,2792.3425,-1429.5293,36.0938},//Parkhaus LS
- {2286.1406,-2260.2925,2061.2966,-2304.4919,2151.2476,-2255.7471,13.2985},//Hafen-LS
- {}//ENDE!
- };
- new Text:Fight,Text:FightUnderline;
- new FightTimer[2];
- public OnFilterScriptInit(){
- Fight_Init();
- return 1;
- }
- public OnFilterScriptExit(){
- Fight_Close();
- return 1;
- }
- public OnPlayerConnect(playerid){
- SetPVarInt(playerid,"Spawned",0);
- for(new fs;fs<sizeof(FightSystem);fs++){
- GangZoneShowForPlayer(playerid,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsOwnerFaction]));
- }return 1;
- }
- public OnPlayerDisconnect(playerid, reason){
- for(new fs;fs<sizeof(FightSystem);fs++){
- if(FightSystem[fs][fsAttackFaction] != -255 && FightSystem[fs][fsFightTime]){
- if(FightSystem[fs][fsCTF][0] != -255 && FightSystem[fs][fsCTF][0] == playerid){
- new fsName[MAX_PLAYER_NAME];
- GetPlayerName(FightSystem[fs][fsCTF][0],fsName,MAX_PLAYER_NAME);
- new fsText[128];
- format(fsText,sizeof(fsText),"-|War Info: %s hat es leider nicht geschafft die Flagge zu erobern!",fsName);
- for(new i;i<MAX_PLAYERS;i++){
- if(IsPlayerConnected(i)){
- if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
- PlayerPlaySound(i,1058,0.0,0.0,0.0);
- SendClientMessage(i,FS_COL_YELLOW,fsText);
- }
- }
- }
- FightSystem[fs][fsCTF][0] = -255;
- FightSystem[fs][fsCTF][1] = 0;
- FightSystem[fs][fsCTF][2] = 0;
- }
- if(GetPVarInt(playerid,"Spawned")==1){
- GangZoneStopFlashForPlayer(playerid,FightSystem[fs][fsZoneID]);
- if(GetPlayerFaction(playerid) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(playerid) == FightSystem[fs][fsAttackFaction]){
- TextDrawHideForPlayer(playerid,Fight);
- TextDrawHideForPlayer(playerid,FightUnderline);
- TextDrawHideForPlayer(playerid,FightSystem[fs][fsWinFaction]);
- TextDrawHideForPlayer(playerid,FightSystem[fs][fsLoseFaction]);
- TextDrawHideForPlayer(playerid,FightSystem[fs][fsWinKills]);
- TextDrawHideForPlayer(playerid,FightSystem[fs][fsLoseKills]);
- TextDrawHideForPlayer(playerid,FightSystem[fs][fsTime]);
- }
- }
- }GangZoneHideForPlayer(playerid,FightSystem[fs][fsZoneID]);
- }DeletePVar(playerid,"Spawned");
- return 1;
- }
- public OnPlayerSpawn(playerid){
- if(GetPVarInt(playerid,"Spawned")==0)
- {
- SetPVarInt(playerid,"Spawned",1);
- for(new fs;fs<sizeof(FightSystem);fs++)
- {
- if(FightSystem[fs][fsAttackFaction] != -255 && FightSystem[fs][fsFightTime])
- {
- GangZoneFlashForPlayer(playerid,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsAttackFaction]));
- if(GetPlayerFaction(playerid) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(playerid) == FightSystem[fs][fsAttackFaction])
- {
- TextDrawShowForPlayer(playerid,Fight);
- TextDrawShowForPlayer(playerid,FightUnderline);
- TextDrawShowForPlayer(playerid,FightSystem[fs][fsWinFaction]);
- TextDrawShowForPlayer(playerid,FightSystem[fs][fsLoseFaction]);
- TextDrawShowForPlayer(playerid,FightSystem[fs][fsWinKills]);
- TextDrawShowForPlayer(playerid,FightSystem[fs][fsLoseKills]);
- TextDrawShowForPlayer(playerid,FightSystem[fs][fsTime]);
- }
- }
- }
- }return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- if(IsPlayerConnected(killerid))
- {
- if(IsAFightFaction(GetPlayerFaction(killerid)))
- {
- new TempZone = GetPlayerFightzone(killerid);
- if(TempZone != -255)
- {
- if(FightSystem[TempZone][fsFightTime] && FightSystem[TempZone][fsAttackFaction] != -255)
- {
- if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(killerid) || FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(killerid))
- {
- if(IsAFightFaction(GetPlayerFaction(playerid)))
- {
- new fsText[64];
- if(FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(killerid) && FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid))
- {
- PlayerPlaySound(killerid,1084,0.0,0.0,0.0);
- GameTextForPlayer(killerid,"~g~GANGZONEKILL",3125,3);
- GameTextForPlayer(playerid,"~r~GANGZONEKILL",3125,3);
- FightSystem[TempZone][fsKillsOfAttack]++;
- if(FightSystem[TempZone][fsKillsOfOwner] > FightSystem[TempZone][fsKillsOfAttack])
- {
- format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
- TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
- TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
- }
- else if(FightSystem[TempZone][fsKillsOfAttack] > FightSystem[TempZone][fsKillsOfOwner])
- {
- format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
- TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
- TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
- }
- else
- {
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
- TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
- TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
- }
- }
- else if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(killerid) && FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid))
- {
- PlayerPlaySound(killerid,1084,0.0,0.0,0.0);
- GameTextForPlayer(killerid,"~g~GANGZONEKILL",3125,3);
- GameTextForPlayer(playerid,"~r~GANGZONEKILL",3125,3);
- FightSystem[TempZone][fsKillsOfOwner]++;
- if(FightSystem[TempZone][fsKillsOfOwner] > FightSystem[TempZone][fsKillsOfAttack])
- {
- format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
- TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
- TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
- }
- else if(FightSystem[TempZone][fsKillsOfAttack] > FightSystem[TempZone][fsKillsOfOwner])
- {
- format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
- TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
- TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
- }
- else
- {
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
- TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[TempZone][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[TempZone][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsAttackFaction]));
- TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[TempZone][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[TempZone][fsLoseKills],fsText);
- }
- }
- }
- }
- }
- }
- }
- }
- if(IsAFightFaction(GetPlayerFaction(playerid))){
- new TempZone = GetPlayerFightzone(playerid);
- if(TempZone != -255){
- if(FightSystem[TempZone][fsFightTime] && FightSystem[TempZone][fsAttackFaction] != -255){
- if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid) || FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid)){
- if(FightSystem[TempZone][fsCTF][0] == playerid){
- new fsName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
- new fsText[128];
- format(fsText,sizeof(fsText),"-|War Info: | %s hat es leider nicht geschafft die Flagge zu erobern!",fsName);
- for(new i;i<MAX_PLAYERS;i++){
- if(IsPlayerConnected(i)){
- if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[TempZone][fsAttackFaction]){
- PlayerPlaySound(i,1058,0.0,0.0,0.0);
- SendClientMessage(i,FS_COL_YELLOW,fsText);
- }
- }
- }
- FightSystem[TempZone][fsCTF][0] = -255;
- FightSystem[TempZone][fsCTF][1] = 0;
- FightSystem[TempZone][fsCTF][2] = 0;
- }
- }
- }
- }
- }return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext,"/ctf",true)==0){
- if(IsAFightFaction(GetPlayerFaction(playerid))){
- new TempZone = GetPlayerFightzone(playerid);
- if(TempZone != -255){
- if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
- return SendClientMessage(playerid,FS_COL_GREY,"** Du darfst das nur zu Fuß machen ...");
- if(!FightSystem[TempZone][fsFightTime] || FightSystem[TempZone][fsAttackFaction] == -255)
- return SendClientMessage(playerid,FS_COL_GREY,"** Hier gibt es nichts zu erobern.");
- if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid) || FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid)){
- if(IsPlayerInRangeOfPoint(playerid,5.0,FightSystem[TempZone][fsCTFx],FightSystem[TempZone][fsCTFy],FightSystem[TempZone][fsCTFz])){
- if(FightSystem[TempZone][fsCTF][0] != -255){
- if(GetPlayerFaction(FightSystem[TempZone][fsCTF][0]) != GetPlayerFaction(playerid))
- SendClientMessage(playerid,FS_COL_GREY,"** Die Flagge wird von deinen Feinden erobert, töte sie zuerst!");
- else
- SendClientMessage(playerid,FS_COL_GREY,"** Deine Gang / Mafia erobert bereits die Flagge!");
- return 1;
- }
- FightSystem[TempZone][fsCTF][0] = playerid;
- new fsName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
- new fsText[128];
- format(fsText,sizeof(fsText),"-|War Info:| %s hat angefangen die Flagge zu erobern!",fsName);
- for(new i;i<MAX_PLAYERS;i++){
- if(IsPlayerConnected(i)){
- if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[TempZone][fsAttackFaction]){
- PlayerPlaySound(i,1058,0.0,0.0,0.0);
- SendClientMessage(i,FS_COL_YELLOW,fsText);
- }
- }
- }
- }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist nicht in der nähe der Flagge!");
- }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist nicht in diesem Fight verwickelt ...");
- }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keinem Gebiet!");
- }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keiner Gang / Mafia.");
- return 1;
- }
- if(strcmp(cmdtext,"/invade",true)==0){
- if(IsAFightFaction(GetPlayerFaction(playerid))){
- for(new fs;fs<sizeof(FightSystem);fs++){
- if((FightSystem[fs][fsOwnerFaction] == GetPlayerFaction(playerid) && FightSystem[fs][fsFightTime]) || FightSystem[fs][fsAttackFaction] == GetPlayerFaction(playerid))
- return SendClientMessage(playerid,FS_COL_GREY,"** Deine Gang / Mafia ist bereits in einem GangWar..!");
- }
- new TempZone = GetPlayerFightzone(playerid);
- if(TempZone != -255){
- if(!IsAFightFaction(FightSystem[TempZone][fsOwnerFaction]))
- return SendClientMessage(playerid,FS_COL_GREY,"Gebiet wurde ausgeschaltet.");
- if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid))
- return SendClientMessage(playerid,FS_COL_GREY,"** Man greift nicht seine eigenen Leute an.");
- if(FightSystem[TempZone][fsFightTime] || FightSystem[TempZone][fsAttackFaction] != -255)
- return SendClientMessage(playerid,FS_COL_GREY,"** In diesem Gebiet wird bereits geschossen.");
- if(FightSystem[TempZone][fsLastFight]){
- new fsText[178];
- format(fsText,sizeof(fsText),"Ganggebiet: Dieses Ganggebiet wurde bereits Angegriffen, wartet noch: '%d' Minuten.",FightSystem[TempZone][fsLastFight]);
- SendClientMessage(playerid,FS_COL_GREY,fsText);
- return 1;
- }
- for(new fs;fs<sizeof(FightSystem);fs++){
- if(FightSystem[fs][fsOwnerFaction] == FightSystem[TempZone][fsOwnerFaction] && FightSystem[fs][fsAttackFaction] != -255)
- return SendClientMessage(playerid,FS_COL_GREY,"Ganggebiet: Die Gang / Mafia der das Ganggebiet gehört hat bereits ein Kampf.");
- }
- new fsTextToOwner[255];
- format(fsTextToOwner,sizeof(fsTextToOwner),"-|War Info:| Ihr werden von: %s angegriffen, begebt euch zum GangWar..!",GetFactionNameOfFaction(GetPlayerFaction(playerid)));
- new fsName[MAX_PLAYER_NAME];
- GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
- new fsTextToAttack[255];
- format(fsTextToAttack,sizeof(fsTextToAttack),"-|War Info: | %s hat ein GangWar mit: %s gestartet, ihr müsst sie nun ausschalten..!",fsName,GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
- new fsText[64];
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
- TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
- TextDrawSetString(FightSystem[TempZone][fsWinKills],"~y~00 Kills");
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(GetPlayerFaction(playerid)));
- TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
- TextDrawSetString(FightSystem[TempZone][fsLoseKills],"~y~00 Kills");
- TextDrawSetString(FightSystem[TempZone][fsTime],"Ablauf Zeit: 2 min.");//ZEIT
- for(new i;i<MAX_PLAYERS;i++){
- if(IsPlayerConnected(i)){
- GangZoneFlashForPlayer(i,FightSystem[TempZone][fsZoneID],GetZoneColorOfFaction(GetPlayerFaction(playerid)));
- if(GetPlayerFaction(i) == FightSystem[TempZone][fsOwnerFaction]){
- PlayerPlaySound(i,1058,0.0,0.0,0.0);
- SendClientMessage(i,FS_COL_YELLOW,fsTextToOwner);
- TextDrawShowForPlayer(i,Fight);
- TextDrawShowForPlayer(i,FightUnderline);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinFaction]);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinKills]);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseFaction]);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseKills]);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsTime]);
- }
- if(GetPlayerFaction(i) == GetPlayerFaction(playerid)){
- PlayerPlaySound(i,1058,0.0,0.0,0.0);
- SendClientMessage(i,FS_COL_YELLOW,fsTextToAttack);
- TextDrawShowForPlayer(i,Fight);
- TextDrawShowForPlayer(i,FightUnderline);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinFaction]);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinKills]);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseFaction]);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseKills]);
- TextDrawShowForPlayer(i,FightSystem[TempZone][fsTime]);
- }
- }
- }
- FightSystem[TempZone][fsAttackFaction] = GetPlayerFaction(playerid);
- FightSystem[TempZone][fsKillsOfOwner] = 0;
- FightSystem[TempZone][fsKillsOfAttack] = 0;
- FightSystem[TempZone][fsFightTime] = GANGFIGHT_DAUER;//ZEIT
- FightSystem[TempZone][fsCTF][0] = -255;
- FightSystem[TempZone][fsCTF][1] = 0;
- FightSystem[TempZone][fsCTF][2] = 0;
- return 1;
- }return SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keinem Gebiet!");
- }else SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keiner Gang / Mafia.");
- return 1;
- }return 0;
- }
- public FightUpdate_1()
- {
- for(new fs;fs<sizeof(FightSystem);fs++)
- {
- if(FightSystem[fs][fsFightTime] && FightSystem[fs][fsAttackFaction] != -255)
- {
- new fsText[128];
- if(FightSystem[fs][fsCTF][0] != -255)
- {
- if(IsPlayerConnected(FightSystem[fs][fsCTF][0]))
- {
- if(IsPlayerInRangeOfPoint(FightSystem[fs][fsCTF][0],5.0,FightSystem[fs][fsCTFx],FightSystem[fs][fsCTFy],FightSystem[fs][fsCTFz]))
- {
- FightSystem[fs][fsCTF][2] = 5;
- FightSystem[fs][fsCTF][1]++;
- format(fsText,sizeof(fsText),"~n~~n~~n~~n~~n~~n~~n~~w~(1)Punkt in:~n~~r~%d ~w~sek.",(1-FightSystem[fs][fsCTF][1]));
- GameTextForPlayer(FightSystem[fs][fsCTF][0],fsText,1250,3);
- if(FightSystem[fs][fsCTF][1] >= 1)
- {
- new fsName[MAX_PLAYER_NAME];
- GetPlayerName(FightSystem[fs][fsCTF][0],fsName,MAX_PLAYER_NAME);
- FightSystem[fs][fsCTF][1] = 0;
- format(fsText,sizeof(fsText),"-|War Info:| %s hat die Flagge erfolgreich erobert..!",fsName);
- for(new i;i<MAX_PLAYERS;i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction])
- {
- PlayerPlaySound(i,1058,0.0,0.0,0.0);
- SendClientMessage(i,FS_COL_YELLOW,fsText);
- }
- }
- }
- if(GetPlayerFaction(FightSystem[fs][fsCTF][0]) == FightSystem[fs][fsOwnerFaction]) FightSystem[fs][fsKillsOfOwner]++;
- if(GetPlayerFaction(FightSystem[fs][fsCTF][0]) == FightSystem[fs][fsAttackFaction]) FightSystem[fs][fsKillsOfAttack]++;
- if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack])
- {
- format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
- TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[fs][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
- TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[fs][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
- }
- else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner])
- {
- format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
- TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[fs][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
- TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[fs][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
- }
- else
- {
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
- TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[fs][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
- TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[fs][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
- }
- FightSystem[fs][fsCTF][0] = -255;
- }
- }
- else
- {
- format(fsText,sizeof(fsText),"~n~~n~~n~~n~~n~~n~~n~~r~Erobere die Flagge!~n~~b~%d Sekunden",(1-FightSystem[fs][fsCTF][2]));
- GameTextForPlayer(FightSystem[fs][fsCTF][0],fsText,1250,3);
- FightSystem[fs][fsCTF][2]++;
- if(FightSystem[fs][fsCTF][2] >= 1)
- {
- new fsName[MAX_PLAYER_NAME];
- GetPlayerName(FightSystem[fs][fsCTF][0],fsName,MAX_PLAYER_NAME);
- format(fsText,sizeof(fsText),"-|War Info:| %s hat es leider nicht geschafft die Flagge zu erobern!",fsName);
- for(new i;i<MAX_PLAYERS;i++)
- {
- if(IsPlayerConnected(i))
- {
- if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction])
- {
- PlayerPlaySound(i,1058,0.0,0.0,0.0);
- SendClientMessage(i,FS_COL_YELLOW,fsText);
- }
- }
- }
- FightSystem[fs][fsCTF][0] = -255;
- FightSystem[fs][fsCTF][1] = 0;
- FightSystem[fs][fsCTF][2] = 0;
- }
- }
- }
- else
- {
- FightSystem[fs][fsCTF][0] = -255;
- FightSystem[fs][fsCTF][1] = 0;
- FightSystem[fs][fsCTF][2] = 0;
- }
- }
- }
- }return 1;
- }
- public FightUpdate_2(){
- for(new fs;fs<sizeof(FightSystem);fs++){
- if(FightSystem[fs][fsFightTime]){
- FightSystem[fs][fsFightTime]--;
- new fsText[64];
- format(fsText,sizeof(fsText),"Fight Zeit: %d min.",FightSystem[fs][fsFightTime]);
- TextDrawSetString(FightSystem[fs][fsTime],fsText);
- if(!FightSystem[fs][fsFightTime]){
- FightSystem[fs][fsLastFight] = 0;
- new fsTextToOwner[255];
- new fsTextToAttack[255];
- new fsType;
- if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
- fsType = 2;
- format(fsTextToOwner,sizeof(fsTextToOwner),"-|War Info: | Deine Gang/Mafia hat das GangWar gewonnen.");
- format(fsTextToAttack,sizeof(fsTextToAttack),"-|War Info: | Deine Gang/Mafia hat das GangWar verloren.");
- }
- else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
- fsType = 3;
- format(fsTextToOwner,sizeof(fsTextToOwner),"-|War Info: | Deine Gang/Mafia hat das GangWar verloren.");
- format(fsTextToAttack,sizeof(fsTextToAttack),"-|War Info: | Deine Gang/Mafia hat das GangWar gewonnen.");
- }else{
- fsType = 1;
- format(fsTextToOwner,sizeof(fsTextToOwner),"-|War Info: | Es war,Unentschieden ihr werdet euer gebiet behalten.");
- format(fsTextToAttack,sizeof(fsTextToAttack),"-|War Info: | Es war,Unentschieden ihr müsst euch mehr anstrengen.");
- }
- for(new i;i<MAX_PLAYERS;i++){
- if(IsPlayerConnected(i)){
- GangZoneStopFlashForPlayer(i,FightSystem[fs][fsZoneID]);
- if(fsType == 3){
- GangZoneHideForPlayer(i,FightSystem[fs][fsZoneID]);
- GangZoneShowForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsAttackFaction]));
- }
- if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction]){
- PlayerPlaySound(i,1058,0.0,0.0,0.0);
- TextDrawHideForPlayer(i,Fight);
- TextDrawHideForPlayer(i,FightUnderline);
- TextDrawHideForPlayer(i,FightSystem[fs][fsWinFaction]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsTime]);
- SendClientMessage(i,FS_COL_YELLOW,fsTextToOwner);
- if(fsType == 3 && GetPlayerFightzone(i) == fs)
- SetPlayerHealth(i,0.0);
- }
- else if(GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
- PlayerPlaySound(i, 1058, 0.0, 0.0, 0.0);
- TextDrawHideForPlayer(i,Fight);
- TextDrawHideForPlayer(i,FightUnderline);
- TextDrawHideForPlayer(i,FightSystem[fs][fsWinFaction]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsTime]);
- SendClientMessage(i,FS_COL_YELLOW,fsTextToAttack);
- if(fsType != 3 && GetPlayerFightzone(i) == fs)
- SetPlayerHealth(i,0.0);
- }
- }
- }
- FightSystem[fs][fsKillsOfAttack] = 0;
- FightSystem[fs][fsKillsOfOwner] = 0;
- if(fsType == 3)
- FightSystem[fs][fsOwnerFaction] = FightSystem[fs][fsAttackFaction];
- FightSystem[fs][fsAttackFaction] = -255;
- FightSystem[fs][fsCTF][0] = -255;
- }
- }
- if(FightSystem[fs][fsLastFight])
- FightSystem[fs][fsLastFight]--;
- }return 1;
- }
- public Fight_Init(){
- Fight = TextDrawCreate(88.000000,244.000000,"GangWar:");
- TextDrawUseBox(Fight,1);
- TextDrawBoxColor(Fight,0x00000066);
- TextDrawTextSize(Fight,102.000000,124.000000);
- TextDrawAlignment(Fight,2);
- TextDrawBackgroundColor(Fight,0x4BFF00FF);
- TextDrawFont(Fight,2);
- TextDrawLetterSize(Fight,0.500000,1.000000);
- TextDrawColor(Fight,0x000000FF);
- TextDrawSetOutline(Fight,1);
- TextDrawSetProportional(Fight,1);
- FightUnderline = TextDrawCreate(91.000000,274.000000,".");
- TextDrawAlignment(FightUnderline,2);
- TextDrawBackgroundColor(FightUnderline,0x00FFE6FF);//0x000000ff
- TextDrawFont(FightUnderline,3);
- TextDrawLetterSize(FightUnderline,14.799997,1.000000);
- TextDrawColor(FightUnderline,0xffffffff);
- TextDrawSetProportional(FightUnderline,1);
- TextDrawSetShadow(FightUnderline,1);
- if(!fexist("Fightzones_Gangfight.cfg")){
- new File:fFile=fopen("Fightzones_Gangfight.cfg",io_write);
- for(new fs;fs<sizeof(FightSystem);fs++)
- fwrite(fFile,"5 -255 0 0 0\r\n");
- fclose(fFile);
- }
- new File:fFile=fopen("Fightzones_Gangfight.cfg",io_read),Content[64],fs;
- while(fread(fFile,Content) && fs < sizeof(FightSystem)){
- FightSystem[fs][fsWinFaction] = TextDrawCreate(26.000000,256.000000," ");
- TextDrawSetProportional(FightSystem[fs][fsWinFaction],1);
- TextDrawAlignment(FightSystem[fs][fsWinFaction],0);
- TextDrawBackgroundColor(FightSystem[fs][fsWinFaction],0x000000ff);
- TextDrawFont(FightSystem[fs][fsWinFaction],2);
- TextDrawLetterSize(FightSystem[fs][fsWinFaction],0.199999,1.000000);
- TextDrawColor(FightSystem[fs][fsWinFaction],0xffffffff);
- TextDrawSetOutline(FightSystem[fs][fsWinFaction],1);
- FightSystem[fs][fsLoseFaction] = TextDrawCreate(26.000000,267.000000," ");
- TextDrawSetProportional(FightSystem[fs][fsLoseFaction],1);
- TextDrawSetOutline(FightSystem[fs][fsLoseFaction],1);
- TextDrawColor(FightSystem[fs][fsLoseFaction],0xffffffff);
- TextDrawFont(FightSystem[fs][fsLoseFaction],2);
- TextDrawLetterSize(FightSystem[fs][fsLoseFaction],0.199999,0.899999);
- TextDrawBackgroundColor(FightSystem[fs][fsLoseFaction],0x000000ff);
- TextDrawAlignment(FightSystem[fs][fsLoseFaction],0);
- FightSystem[fs][fsWinKills] = TextDrawCreate(107.000000,256.000000," ");
- TextDrawSetProportional(FightSystem[fs][fsWinKills],1);
- TextDrawSetOutline(FightSystem[fs][fsWinKills],1);
- TextDrawColor(FightSystem[fs][fsWinKills],0xffffffff);
- TextDrawSetShadow(FightSystem[fs][fsWinKills],1);
- TextDrawFont(FightSystem[fs][fsWinKills],2);
- TextDrawLetterSize(FightSystem[fs][fsWinKills],0.199999,1.000000);
- TextDrawBackgroundColor(FightSystem[fs][fsWinKills],0x000000ff);
- TextDrawAlignment(FightSystem[fs][fsWinKills],0);
- FightSystem[fs][fsLoseKills] = TextDrawCreate(107.000000,267.000000," ");
- TextDrawSetProportional(FightSystem[fs][fsLoseKills],1);
- TextDrawSetShadow(FightSystem[fs][fsLoseKills],1);
- TextDrawSetOutline(FightSystem[fs][fsLoseKills],1);
- TextDrawColor(FightSystem[fs][fsLoseKills],0xffffffff);
- TextDrawFont(FightSystem[fs][fsLoseKills],2);
- TextDrawLetterSize(FightSystem[fs][fsLoseKills],0.199999,1.000000);
- TextDrawBackgroundColor(FightSystem[fs][fsLoseKills],0x000000ff);
- TextDrawAlignment(FightSystem[fs][fsLoseKills],0);
- FightSystem[fs][fsTime] = TextDrawCreate(26.000000,286.000000," ");
- TextDrawColor(FightSystem[fs][fsTime],0xffffffff);
- TextDrawAlignment(FightSystem[fs][fsTime],0);
- TextDrawBackgroundColor(FightSystem[fs][fsTime],0x000000ff);
- TextDrawFont(FightSystem[fs][fsTime],2);
- TextDrawLetterSize(FightSystem[fs][fsTime],0.199999,0.899999);
- TextDrawSetProportional(FightSystem[fs][fsTime],1);
- StripNewLine(Content);
- sscanf(Content,"ddddd",FightSystem[fs][fsOwnerFaction],FightSystem[fs][fsAttackFaction],FightSystem[fs][fsKillsOfOwner],FightSystem[fs][fsKillsOfAttack],FightSystem[fs][fsFightTime]);
- FightSystem[fs][fsCTF][0] = -255;
- FightSystem[fs][fsCTF][1] = 0;
- FightSystem[fs][fsCTF][2] = 0;
- FightSystem[fs][fsLastFight] = 0;
- FightSystem[fs][fsZoneID] = GangZoneCreate(FightSystem[fs][fsMinX],FightSystem[fs][fsMinY],FightSystem[fs][fsMaxX],FightSystem[fs][fsMaxY]);
- FightSystem[fs][fsFlag] = CreatePickup(2993,1,FightSystem[fs][fsCTFx],FightSystem[fs][fsCTFy],FightSystem[fs][fsCTFz],-1);
- if(FightSystem[fs][fsFightTime] && FightSystem[fs][fsAttackFaction] != -255){
- new fsText[64];
- format(fsText,sizeof(fsText),"Fight Zeit: %d min.",FightSystem[fs][fsFightTime]);
- TextDrawSetString(FightSystem[fs][fsTime],fsText);
- if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
- format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
- TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[fs][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
- TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[fs][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
- }
- else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
- format(fsText,sizeof(fsText),"~g~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
- TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~g~%d Kills",FightSystem[fs][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~r~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
- TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~r~%d Kills",FightSystem[fs][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
- }else{
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
- TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
- format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[fs][fsKillsOfOwner]);
- TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
- format(fsText,sizeof(fsText),"~y~%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
- TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
- format(fsText,sizeof(fsText),"~y~%d Kills",FightSystem[fs][fsKillsOfAttack]);
- TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
- }
- }
- for(new i;i<MAX_PLAYERS;i++){
- if(IsPlayerConnected(i)){
- SetPVarInt(i,"Spawned",1);
- GangZoneShowForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsOwnerFaction]));
- if(FightSystem[fs][fsAttackFaction] && FightSystem[fs][fsFightTime]){
- GangZoneFlashForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsAttackFaction]));
- if(GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction] || GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction]){
- TextDrawShowForPlayer(i,Fight);
- TextDrawShowForPlayer(i,FightUnderline);
- TextDrawShowForPlayer(i,FightSystem[fs][fsWinFaction]);
- TextDrawShowForPlayer(i,FightSystem[fs][fsLoseFaction]);
- TextDrawShowForPlayer(i,FightSystem[fs][fsWinKills]);
- TextDrawShowForPlayer(i,FightSystem[fs][fsLoseKills]);
- TextDrawShowForPlayer(i,FightSystem[fs][fsTime]);
- }
- }
- }
- }
- fs++;
- }
- fclose(fFile);
- FightTimer[0] = SetTimer("FightUpdate_1",1003,true);
- FightTimer[1] = SetTimer("FightUpdate_2",60017,true);
- return 1;
- }
- public Fight_Close(){
- KillTimer(FightTimer[0]);
- KillTimer(FightTimer[1]);
- if(fexist("Fightzones_Gangfight.cfg")) fremove("Fightzones_Gangfight.cfg");
- new File:fFile=fopen("Fightzones_Gangfight.cfg",io_append),Content[64];
- for(new fs;fs<sizeof(FightSystem);fs++){
- if(FightSystem[fs][fsAttackFaction] != -255 && FightSystem[fs][fsFightTime]){
- GangZoneStopFlashForAll(FightSystem[fs][fsZoneID]);
- for(new i;i<MAX_PLAYERS;i++){
- if(IsPlayerConnected(i)){
- DeletePVar(i,"Spawned");
- if(GetPlayerFaction(i) == FightSystem[fs][fsOwnerFaction] || GetPlayerFaction(i) == FightSystem[fs][fsAttackFaction]){
- TextDrawHideForPlayer(i,Fight);
- TextDrawHideForPlayer(i,FightUnderline);
- TextDrawHideForPlayer(i,FightSystem[fs][fsWinFaction]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
- TextDrawHideForPlayer(i,FightSystem[fs][fsTime]);
- }
- }
- }
- }
- TextDrawDestroy(FightSystem[fs][fsWinFaction]);
- TextDrawDestroy(FightSystem[fs][fsLoseFaction]);
- TextDrawDestroy(FightSystem[fs][fsWinKills]);
- TextDrawDestroy(FightSystem[fs][fsLoseKills]);
- TextDrawDestroy(FightSystem[fs][fsTime]);
- GangZoneHideForAll(FightSystem[fs][fsZoneID]);
- GangZoneDestroy(FightSystem[fs][fsZoneID]);
- DestroyPickup(FightSystem[fs][fsFlag]);
- 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]);
- fwrite(fFile,Content);
- }
- fclose(fFile);
- TextDrawDestroy(Fight);
- TextDrawDestroy(FightUnderline);
- return 1;
- }
- stock GetPlayerFightzone(playerid)
- {
- new Float:GangZone[3];
- GetPlayerPos(playerid,GangZone[0],GangZone[1],GangZone[2]);
- for(new fs;fs<sizeof(FightSystem);fs++)
- {
- if((GangZone[0] >= FightSystem[fs][fsMinX] && GangZone[0] <= FightSystem[fs][fsMaxX]) && (GangZone[1] >= FightSystem[fs][fsMinY] && GangZone[1] <= FightSystem[fs][fsMaxY]) && GangZone[2] <= 500)
- return fs;
- }return -255;
- }
- stock GetPlayerFaction(playerid){
- new Member = CallRemoteFunction("GetPlayerMember","i",playerid);
- if(Member)
- return Member;
- new Leader = CallRemoteFunction("GetPlayerLeader","i",playerid);
- if(Leader)
- return Leader;
- return 0;
- }
- stock sscanf(string[],format[],{Float,_}:...){
- new formatPos=0,stringPos=0,paramPos=2,paramCount=numargs();
- while(paramPos < paramCount && string[stringPos]){
- switch (format[formatPos++]){
- case '\0':{return 0;}case 'i','d':{
- new neg=1,num=0,ch=string[stringPos];
- if(ch=='-'){neg=-1;ch=string[++stringPos];}
- do{ stringPos++;
- if(ch>='0'&&ch<='9'){num=(num*10)+(ch-'0');}else{return 1;}
- }while((ch=string[stringPos])&&ch!=' ');setarg(paramPos,0,num*neg);}
- case 'h','x':{
- new ch,num=0;while((ch=string[stringPos++])){
- switch (ch){
- case 'x','X':{num=0;continue;}case '0'..'9':{num=(num<<4)|(ch-'0');}
- case 'a'..'f':{num=(num<<4)|(ch-('a'-10));}case 'A'..'F':{num=(num<<4)|(ch-('A'-10));}
- case ' ':{break;}default:{return 1;}}
- }setarg(paramPos,0,num);}
- case 'c':{setarg(paramPos,0,string[stringPos++]);}
- case 'f':{
- new tmp[25];
- strmid(tmp,string,stringPos,stringPos+sizeof(tmp)-2);
- setarg(paramPos,0,_:floatstr(tmp));}
- case 's','z':{
- new i=0,ch;
- if(format[formatPos]){
- while ((ch=string[stringPos++])&&ch!=' '){
- setarg(paramPos,i++,ch);
- }if(!i)return 1;
- }else{while((ch=string[stringPos++])){setarg(paramPos,i++,ch);}
- }stringPos--;setarg(paramPos,i,'\0');
- }default:{continue;}}
- while(string[stringPos]&&string[stringPos]!=' '){stringPos++;}
- while(string[stringPos]==' '){stringPos++;}
- paramPos++;}
- while(format[formatPos]=='z')formatPos++;
- return format[formatPos];
- }
- stock StripNewLine(string[]){
- new len=strlen(string);
- if(string[0]==0) return ;
- if((string[len-1]=='\n')||(string[len - 1]=='\r')){
- string[len - 1] = 0;
- if(string[0]==0) return ;
- if((string[len-2]=='\n')||(string[len-2]=='\r')) string[len-2]=0;
- }
- }
- //0x00000066
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement