nach langen probieren und testen, brauche ich nun eure Hilfe. Ich habe das RGR Gangfightsystem in meinen script eingebaut und nun alles zu meinen Fraktionen/Gangs/mafien geändert und nun habe ich das Problem das wenn ich in einem Gebiet bin, das da steht Du bist in keiner gang/mafia. Ich hoffe mir kann jemand helfen.
if(!strcmp("/Einnehmen",cmdtext,true)){
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 Fight.");
}
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, 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][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),">>> Gangfightfight <<< | Ihr werden von: %s angegriffen, setzt euch zur wehr!",GetFactionNameOfFaction(GetPlayerFaction(playerid)));
new fsName[MAX_PLAYER_NAME];
GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
new fsTextToAttack[255];
format(fsTextToAttack,sizeof(fsTextToAttack),">>> Gangfight <<< | %s hat ein Kampf mit: %s begonnen, macht sie Platt!",fsName,GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
new fsText[64];
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[TempZone][fsOwnerFaction]));
TextDrawSetString(FightSystem[TempZone][fsWinFaction],fsText);
TextDrawSetString(FightSystem[TempZone][fsWinKills],"00 Punkte");
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(GetPlayerFaction(playerid)));
TextDrawSetString(FightSystem[TempZone][fsLoseFaction],fsText);
TextDrawSetString(FightSystem[TempZone][fsLoseKills],"00 Punkte");
for(new i;i<GetMaxPlayers();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,FightSystem[TempZone][fsWinFaction]);
TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinKills]);
TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseFaction]);
TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseKills]);
}
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,FightSystem[TempZone][fsWinFaction]);
TextDrawShowForPlayer(i,FightSystem[TempZone][fsWinKills]);
TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseFaction]);
TextDrawShowForPlayer(i,FightSystem[TempZone][fsLoseKills]);
}
}
}
FightSystem[TempZone][fsAttackFaction] = GetPlayerFaction(playerid);
FightSystem[TempZone][fsKillsOfOwner] = 0;
FightSystem[TempZone][fsKillsOfAttack] = 0;
FightSystem[TempZone][fsFightTime] = FIGHT_TIME;
FightSystem[TempZone][fsCtfOfOwner][0] = -255;
FightSystem[TempZone][fsCtfOfOwner][1] = 0;
FightSystem[TempZone][fsCtfOfAttack][0] = -255;
FightSystem[TempZone][fsCtfOfAttack][1] = 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;
}
if(!strcmp("/Flagge",cmdtext,true)){
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][fsAttackFaction] == -255 || !FightSystem[TempZone][fsFightTime])
return SendClientMessage(playerid,FS_COL_GREY,"Hier gibt es nichts zu erobern.");
if(FightSystem[TempZone][fsOwnerFaction] == GetPlayerFaction(playerid)){
if(IsPlayerInRangeOfPoint(playerid,5.0,FightSystem[TempZone][fsCtfOfAttackx],FightSystem[TempZone][fsCtfOfAttacky],FightSystem[TempZone][fsCtfOfAttackz])){
if(FightSystem[TempZone][fsCtfOfAttack][0] != -255)
return SendClientMessage(playerid,FS_COL_GREY,"Deine Gang / Mafia erobert bereits die Flagge!");
FightSystem[TempZone][fsCtfOfAttack][1] = 0;
FightSystem[TempZone][fsCtfOfAttack][0] = playerid;
AttachObjectToPlayer(FightSystem[TempZone][fsFlagOfAttack],playerid,0.0,0.0,0.0,0.0,0.0,0.0);
new fsName[MAX_PLAYER_NAME];
GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
new fsText[128];
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge aufgehoben!",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 if(FightSystem[TempZone][fsAttackFaction] == GetPlayerFaction(playerid)){
if(IsPlayerInRangeOfPoint(playerid,5.0,FightSystem[TempZone][fsCtfOfOwnerx],FightSystem[TempZone][fsCtfOfOwnery],FightSystem[TempZone][fsCtfOfOwnerz])){
if(FightSystem[TempZone][fsCtfOfOwner][0] != -255)
return SendClientMessage(playerid,FS_COL_GREY,"Deine Gang / Mafia erobert bereits die Flagge!");
FightSystem[TempZone][fsCtfOfOwner][1] = 0;
FightSystem[TempZone][fsCtfOfOwner][0] = playerid;
AttachObjectToPlayer(FightSystem[TempZone][fsFlagOfOwner],playerid,0.0,0.0,0.0,0.0,0.0,0.0);
new fsName[MAX_PLAYER_NAME];
GetPlayerName(playerid,fsName,MAX_PLAYER_NAME);
new fsText[128];
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge aufgehoben!",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;
}
public FightUpdate_1(){
for(new fs;fs<sizeof(FightSystem);fs++){
if(FightSystem[fs][fsFightTime] && FightSystem[fs][fsAttackFaction] != -255){
new fsText[128];
if(FightSystem[fs][fsCtfOfOwner][0] != -255){
if(IsPlayerConnected(FightSystem[fs][fsCtfOfOwner][0])){
if(GetPlayerFightzone(FightSystem[fs][fsCtfOfOwner][0]) == fs){
if(IsPlayerInRangeOfPoint(FightSystem[fs][fsCtfOfOwner][0],5.0,FightSystem[fs][fsCtfOfAttackx],FightSystem[fs][fsCtfOfAttacky],FightSystem[fs][fsCtfOfAttackz])){
FightSystem[fs][fsCtfOfOwner][1]++;
format(fsText,sizeof(fsText),"~n~~n~~n~~w~Abgegeben in:~n~~r~%d ~w~Sekunden",(60-FightSystem[fs][fsCtfOfOwner][1]));
GameTextForPlayer(FightSystem[fs][fsCtfOfOwner][0],fsText,1250,3);
if(FightSystem[fs][fsCtfOfOwner][1] > 60){
DestroyObject(FightSystem[fs][fsFlagOfOwner]);
FightSystem[fs][fsFlagOfOwner] = CreateObject(2993,FightSystem[fs][fsCtfOfOwnerx],FightSystem[fs][fsCtfOfOwnery],(FightSystem[fs][fsCtfOfOwnerz]-1.0),0.0,0.0,0.0,150.0);
new fsName[MAX_PLAYER_NAME];
GetPlayerName(FightSystem[fs][fsCtfOfOwner][0],fsName,MAX_PLAYER_NAME);
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge abgegeben!",fsName);
for(new i;i<GetMaxPlayers();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][fsCtfOfOwner][0] = -255;
FightSystem[fs][fsCtfOfOwner][1] = 0;
FightSystem[fs][fsKillsOfAttack]++;
if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
}
else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
format(fsText,sizeof(fsText),"%d Punkte",FightSystem[fs][fsKillsOfAttack]);
TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
}else{
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
}
}
}
}
else
{
new fsName[MAX_PLAYER_NAME];
GetPlayerName(FightSystem[fs][fsCtfOfOwner][0],fsName,MAX_PLAYER_NAME);
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge fallen gelassen!",fsName);
for(new i;i<GetMaxPlayers();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);
}
}
}
DestroyObject(FightSystem[fs][fsFlagOfOwner]);
FightSystem[fs][fsFlagOfOwner] = CreateObject(2993,FightSystem[fs][fsCtfOfOwnerx],FightSystem[fs][fsCtfOfOwnery],(FightSystem[fs][fsCtfOfOwnerz]-1.0),0.0,0.0,0.0,150.0);
FightSystem[fs][fsCtfOfOwner][0] = -255;
FightSystem[fs][fsCtfOfOwner][1] = 0;
}
}
}
if(FightSystem[fs][fsCtfOfAttack][0] != -255){
if(IsPlayerConnected(FightSystem[fs][fsCtfOfAttack][0])){
if(GetPlayerFightzone(FightSystem[fs][fsCtfOfAttack][0]) == fs){
if(IsPlayerInRangeOfPoint(FightSystem[fs][fsCtfOfAttack][0],5.0,FightSystem[fs][fsCtfOfOwnerx],FightSystem[fs][fsCtfOfOwnery],FightSystem[fs][fsCtfOfOwnerz])){
FightSystem[fs][fsCtfOfAttack][1]++;
format(fsText,sizeof(fsText),"~n~~n~~n~~w~Abgegeben in:~n~~r~%d ~w~Sekunden",(60-FightSystem[fs][fsCtfOfAttack][1]));
GameTextForPlayer(FightSystem[fs][fsCtfOfAttack][0],fsText,1250,3);
if(FightSystem[fs][fsCtfOfAttack][1] > 60){
DestroyObject(FightSystem[fs][fsFlagOfAttack]);
FightSystem[fs][fsFlagOfAttack] = CreateObject(2993,FightSystem[fs][fsCtfOfAttackx],FightSystem[fs][fsCtfOfAttacky],(FightSystem[fs][fsCtfOfAttackz]-1.0),0.0,0.0,0.0,150.0);
new fsName[MAX_PLAYER_NAME];
GetPlayerName(FightSystem[fs][fsCtfOfAttack][0],fsName,MAX_PLAYER_NAME);
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge abgegeben!",fsName);
for(new i;i<GetMaxPlayers();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][fsCtfOfAttack][0] = -255;
FightSystem[fs][fsCtfOfAttack][1] = 0;
FightSystem[fs][fsKillsOfOwner]++;
if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
}
else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
format(fsText,sizeof(fsText),"%d Punkte",FightSystem[fs][fsKillsOfAttack]);
TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
}else{
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
}
}
}
}
else
{
new fsName[MAX_PLAYER_NAME];
GetPlayerName(FightSystem[fs][fsCtfOfAttack][0],fsName,MAX_PLAYER_NAME);
format(fsText,sizeof(fsText),">>> Gangfight <<< | %s hat die Flagge fallen gelassen!",fsName);
for(new i;i<GetMaxPlayers();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);
}
}
}
DestroyObject(FightSystem[fs][fsFlagOfAttack]);
FightSystem[fs][fsFlagOfAttack] = CreateObject(2993,FightSystem[fs][fsCtfOfAttackx],FightSystem[fs][fsCtfOfAttacky],(FightSystem[fs][fsCtfOfAttackz]-1.0),0.0,0.0,0.0,150.0);
FightSystem[fs][fsCtfOfAttack][0] = -255;
FightSystem[fs][fsCtfOfAttack][1] = 0;
}
}
}
}
}return 1;
}
public FightUpdate_2(){
for(new fs;fs<sizeof(FightSystem);fs++){
if(FightSystem[fs][fsFightTime]){
FightSystem[fs][fsFightTime]--;
if(!FightSystem[fs][fsFightTime]){
FightSystem[fs][fsLastFight] = FIGHT_WAIT_TIME;
new fsTextToOwner[255];
new fsTextToAttack[255];
new fsType;
if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
fsType = 2;
format(fsTextToOwner,sizeof(fsTextToOwner),">>> Gangfight <<< | Ihr habt gewonnen...");
format(fsTextToAttack,sizeof(fsTextToAttack),">>> Gangfight <<< | Ihr habt verloren...");
}
else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
fsType = 3;
format(fsTextToOwner,sizeof(fsTextToOwner),">>> Gangfight <<< | Ihr habt verloren...");
format(fsTextToAttack,sizeof(fsTextToAttack),">>> Gangfight <<< | Ihr habt gewonnen...");
}else{
fsType = 1;
format(fsTextToOwner,sizeof(fsTextToOwner),">>> Gangfight <<< | Unentschieden, ihr behaltet euer gebiet.");
format(fsTextToAttack,sizeof(fsTextToAttack),">>> Gangfight <<< | Unentschieden, ihr müsst euch mehr anstrengen.");
}
for(new i;i<GetMaxPlayers();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,FightSystem[fs][fsWinFaction]);
TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
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,FightSystem[fs][fsWinFaction]);
TextDrawHideForPlayer(i,FightSystem[fs][fsWinKills]);
TextDrawHideForPlayer(i,FightSystem[fs][fsLoseFaction]);
TextDrawHideForPlayer(i,FightSystem[fs][fsLoseKills]);
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;
if(FightSystem[fs][fsCtfOfOwner][0] != -255){
DestroyObject(FightSystem[fs][fsFlagOfOwner]);
FightSystem[fs][fsFlagOfOwner] = CreateObject(2993,FightSystem[fs][fsCtfOfOwnerx],FightSystem[fs][fsCtfOfOwnery],(FightSystem[fs][fsCtfOfOwnerz]-1.0),0.0,0.0,0.0,150.0);
}
FightSystem[fs][fsCtfOfOwner][0] = -255;
FightSystem[fs][fsCtfOfOwner][1] = 0;
if(FightSystem[fs][fsCtfOfAttack][0] != -255){
DestroyObject(FightSystem[fs][fsFlagOfAttack]);
FightSystem[fs][fsFlagOfAttack] = CreateObject(2993,FightSystem[fs][fsCtfOfAttackx],FightSystem[fs][fsCtfOfAttacky],(FightSystem[fs][fsCtfOfAttackz]-1.0),0.0,0.0,0.0,150.0);
}
FightSystem[fs][fsCtfOfAttack][0] = -255;
FightSystem[fs][fsCtfOfAttack][1] = 0;
}
}
if(FightSystem[fs][fsLastFight])
FightSystem[fs][fsLastFight]--;
}return 1;
}
public Fight_Init(){
Fight = TextDrawCreate(241.000000,351.000000,"Gangfight:");
TextDrawAlignment(Fight,0);
TextDrawBackgroundColor(Fight,0x000000ff);
TextDrawFont(Fight,0);
TextDrawLetterSize(Fight,1.200000,1.500000);
TextDrawColor(Fight,0xffffffff);
TextDrawSetOutline(Fight,1);
TextDrawSetProportional(Fight,1);
TextDrawSetShadow(Fight,1);
if(!fexist(FIGHT_FILE)){
new File:fFile=fopen(FIGHT_FILE,io_write);
for(new fs;fs<sizeof(FightSystem);fs++)
fwrite(fFile,"15 -255 0 0 0\r\n");
fclose(fFile);
}
new File:fFile=fopen(FIGHT_FILE,io_read),Content[64],fs;
while(fread(fFile,Content) && fs < sizeof(FightSystem)){
FightSystem[fs][fsWinFaction] = TextDrawCreate(206.000000,379.000000," ");
TextDrawAlignment(FightSystem[fs][fsWinFaction],0);
TextDrawBackgroundColor(FightSystem[fs][fsWinFaction],0x000000ff);
TextDrawFont(FightSystem[fs][fsWinFaction],0);
TextDrawLetterSize(FightSystem[fs][fsWinFaction],0.899999,1.300000);
TextDrawColor(FightSystem[fs][fsWinFaction],0xffffffff);
TextDrawSetShadow(FightSystem[fs][fsWinFaction],1);
TextDrawSetOutline(FightSystem[fs][fsWinFaction],1);
TextDrawSetProportional(FightSystem[fs][fsWinFaction],1);
FightSystem[fs][fsLoseFaction] = TextDrawCreate(206.000000,400.000000," ");
TextDrawAlignment(FightSystem[fs][fsLoseFaction],0);
TextDrawBackgroundColor(FightSystem[fs][fsLoseFaction],0x000000ff);
TextDrawFont(FightSystem[fs][fsLoseFaction],0);
TextDrawLetterSize(FightSystem[fs][fsLoseFaction],0.799999,1.300000);
TextDrawColor(FightSystem[fs][fsLoseFaction],0xffffffff);
TextDrawSetShadow(FightSystem[fs][fsLoseFaction],1);
TextDrawSetOutline(FightSystem[fs][fsLoseFaction],1);
TextDrawSetProportional(FightSystem[fs][fsLoseFaction],1);
FightSystem[fs][fsWinKills] = TextDrawCreate(328.000000,379.000000," ");
TextDrawAlignment(FightSystem[fs][fsWinKills],0);
TextDrawBackgroundColor(FightSystem[fs][fsWinKills],0x000000ff);
TextDrawFont(FightSystem[fs][fsWinKills],0);
TextDrawLetterSize(FightSystem[fs][fsWinKills],0.599999,1.200000);
TextDrawColor(FightSystem[fs][fsWinKills],0xffffffff);
TextDrawSetShadow(FightSystem[fs][fsWinKills],1);
TextDrawSetOutline(FightSystem[fs][fsWinKills],1);
TextDrawSetProportional(FightSystem[fs][fsWinKills],1);
FightSystem[fs][fsLoseKills] = TextDrawCreate(328.000000,400.000000," ");
TextDrawAlignment(FightSystem[fs][fsLoseKills],0);
TextDrawBackgroundColor(FightSystem[fs][fsLoseKills],0x000000ff);
TextDrawFont(FightSystem[fs][fsLoseKills],0);
TextDrawLetterSize(FightSystem[fs][fsLoseKills],0.599999,1.300000);
TextDrawColor(FightSystem[fs][fsLoseKills],0xffffffff);
TextDrawSetShadow(FightSystem[fs][fsLoseKills],1);
TextDrawSetOutline(FightSystem[fs][fsLoseKills],1);
TextDrawSetProportional(FightSystem[fs][fsLoseKills],1);
StripNewLine(Content);
sscanf(Content,"dddddd",FightSystem[fs][fsOwnerFaction],FightSystem[fs][fsAttackFaction],FightSystem[fs][fsKillsOfOwner],FightSystem[fs][fsKillsOfAttack],FightSystem[fs][fsFightTime],FightSystem[fs][fsLastFight]);
FightSystem[fs][fsCtfOfOwner][0] = -255;
FightSystem[fs][fsCtfOfOwner][1] = 0;
FightSystem[fs][fsCtfOfAttack][0] = -255;
FightSystem[fs][fsCtfOfAttack][1] = 0;
FightSystem[fs][fsZoneID] = GangZoneCreate(FightSystem[fs][fsMinX],FightSystem[fs][fsMinY],FightSystem[fs][fsMaxX],FightSystem[fs][fsMaxY]);
FightSystem[fs][fsFlagOfOwner] = CreateObject(2993,FightSystem[fs][fsCtfOfOwnerx],FightSystem[fs][fsCtfOfOwnery],(FightSystem[fs][fsCtfOfOwnerz]-1.0),0.0,0.0,0.0,150.0);
FightSystem[fs][fsFlagOfAttack] = CreateObject(2993,FightSystem[fs][fsCtfOfAttackx],FightSystem[fs][fsCtfOfAttacky],(FightSystem[fs][fsCtfOfAttackz]-1.0),0.0,0.0,0.0,150.0);
if(FightSystem[fs][fsFightTime] && FightSystem[fs][fsAttackFaction] != -255){
new fsText[64];
if(FightSystem[fs][fsKillsOfOwner] > FightSystem[fs][fsKillsOfAttack]){
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
}
else if(FightSystem[fs][fsKillsOfAttack] > FightSystem[fs][fsKillsOfOwner]){
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
}else{
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsOwnerFaction]));
TextDrawSetString(FightSystem[fs][fsWinFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfOwner]);
TextDrawSetString(FightSystem[fs][fsWinKills],fsText);
format(fsText,sizeof(fsText),"%s",GetFactionNameOfFaction(FightSystem[fs][fsAttackFaction]));
TextDrawSetString(FightSystem[fs][fsLoseFaction],fsText);
format(fsText,sizeof(fsText),"%02d Punkte",FightSystem[fs][fsKillsOfAttack]);
TextDrawSetString(FightSystem[fs][fsLoseKills],fsText);
}
}
for(new i;i<GetMaxPlayers();i++){
if(IsPlayerConnected(i)){
SetPVarInt(i,"Spawned",1);
GangZoneShowForPlayer(i,FightSystem[fs][fsZoneID],GetZoneColorOfFaction(FightSystem[fs][fsOwnerFaction]));
if(FightSystem[fs][fsAttackFaction] != -255 && 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,FightSystem[fs][fsWinFaction]);
TextDrawShowForPlayer(i,FightSystem[fs][fsLoseFaction]);
TextDrawShowForPlayer(i,FightSystem[fs][fsWinKills]);
TextDrawShowForPlayer(i,FightSystem[fs][fsLoseKills]);
}
}
}
}fs++;
}
fclose(fFile);
FightTimer[0] = SetTimer("FightUpdate_1",1003,true);
FightTimer[1] = SetTimer("FightUpdate_2",60017,true);
}
public Fight_Close(){
KillTimer(FightTimer[0]);
KillTimer(FightTimer[1]);
for(new i;i<GetMaxPlayers();i++){
if(IsPlayerConnected(i))
DeletePVar(i,"Spawned");
}
new File:fFile=fopen(FIGHT_FILE,io_write),Content[64];
for(new fs;fs<sizeof(FightSystem);fs++){
TextDrawDestroy(FightSystem[fs][fsWinFaction]);
TextDrawDestroy(FightSystem[fs][fsLoseFaction]);
TextDrawDestroy(FightSystem[fs][fsWinKills]);
TextDrawDestroy(FightSystem[fs][fsLoseKills]);
GangZoneDestroy(FightSystem[fs][fsZoneID]);
DestroyObject(FightSystem[fs][fsFlagOfOwner]);
DestroyObject(FightSystem[fs][fsFlagOfAttack]);
format(Content,sizeof(Content),"%d %d %d %d %d %d\r\n",FightSystem[fs][fsOwnerFaction],FightSystem[fs][fsAttackFaction],FightSystem[fs][fsKillsOfOwner],FightSystem[fs][fsKillsOfAttack],FightSystem[fs][fsFightTime],FightSystem[fs][fsLastFight]);
fwrite(fFile,Content);
}
fclose(fFile);
TextDrawDestroy(Fight);
return 1;
}
Falls ihr noch mehr Zeilen braucht, schreibt es. Ich habe keine Errors bekommen!! ICh freue mich über jede Antwort