Hallo Leute wenn ich ein gangwar gebiet erobern will steht da : das gebiet wurde ausgeschaltet
if(strcmp(cmdtext,"/erobern",true)==0)
{
if(IsAFightFaction(GetPlayerFaction(playerid)))
{
new TempZone = GetPlayerFightzone(playerid);
if(TempZone != -14)
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
return SendClientMessage(playerid,FS_COL_GREY,"** Du musst aus dem Fahrzeug raus!");
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,"** Ein Feind versucht das Gebiet zu /erobern, töte ihn zuerst!");
else
SendClientMessage(playerid,FS_COL_GREY,"** Deine Gang erobert bereits das Gebiet!");
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),"*GangwarGuard* | %s versucht das Gebiet von euch 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 musst näher am /erobern- Punkt sein!");
}
}
else
{
SendClientMessage(playerid,FS_COL_GREY,"** Du bist nicht an diesem Gangwar beteiligt!");
}
}
else
{
SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keinem Gebiet!");
}
}
else
{
SendClientMessage(playerid,FS_COL_GREY,"** Du bist in keiner Gang.");
}
return 1;
}
if(strcmp(cmdtext,"/gangwar",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 ist bereits in einem Gangwar.");
}
new on[2];
on[0] = 0;
on[1] = 0;
for(new fs;fs<sizeof(FightSystem);fs++){
for(new p=0;p<MAX_PLAYERS;p++)
{
if(GetPlayerFaction(p) == FightSystem[fs][fsOwnerFaction]) {
on[0]++;
}
if(GetPlayerFaction(p) == GetPlayerFaction(playerid))
{
on[1]++;
}
}
}
if(testphase == 0) {
if(on[0] <= 2) return SendClientMessage(playerid, COLOR_WHITE, "Um ein Gangwar zu starten, muss die gegnerische Gang mindstens 2 Member am start haben, die Online sind!");
if(on[1] <= 2) return SendClientMessage(playerid, COLOR_WHITE, "Um ein Gangwar zu starten, muss die gegnerische Gang mindstens 2 Member am start haben, die Online sind!");
}
new TempZone = GetPlayerFightzone(playerid);
if(TempZone != -255){
if(FightSystem[TempZone][fsFightTimeCool] != 0) {
format(stringx, sizeof(stringx), "Das Gebiet kann erst wieder in ca. %d Minuten erobert werden.", FightSystem[TempZone][fsFightTimeCool]);
return SendClientMessage(playerid, FS_COL_GREY,stringx);
}
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,"** Du kannst nicht das Gebiet deiner Gang einnehmen!");
if(FightSystem[TempZone][fsFightTime] || FightSystem[TempZone][fsAttackFaction] != -255)
return SendClientMessage(playerid,FS_COL_GREY,"** Das Gebiet wird gerade umkämpft!");
if(FightSystem[TempZone][fsLastFight]){
new fsText[178];
format(fsText,sizeof(fsText),"Ganggebiet: Dieses Ganggebiet wurde gerade erst angegriffen, warte 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][fsFightTime] || FightSystem[fs][fsAttackFaction] != -255))
return SendClientMessage(playerid,FS_COL_GREY,"*GangwarGuard: Die Gang der das Ganggebiet gehört hat bereits ein Kampf.");
}
new fsTextToOwner[255];
format(fsTextToOwner,sizeof(fsTextToOwner),"*GangwarGuard* | Ihr werdet von: %s angegriffen!",GetFactionNameOfFaction(GetPlayerFaction(playerid)));
new fsName[MAX_PLAYER_NAME];
GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
new fsTextToAttack[255];
format(fsTextToAttack,sizeof(fsTextToAttack),"*GangwarGuard* | %s hat ein Kampf mit: %s begonnen!",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],"Verbl. Zeit: 30 Minuten");//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] = 30;//ZEIT
FightSystem[TempZone][fsFightTimeCool] = 90;//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.");
return 1;
}