Hallo,
Wen ich die Flagge eingenommen habe bleibt der Name immer gleich.
Heißt:
Code
format(string, sizeof(string), "{AFAFAF}Flagge A\n%s\n\n%s", GangFight[gw][warZoneName], GetFrakName(GangFight[gw][warOwner]));
Update3DTextLabelText(GangFight[gw][WarLabel][0], COLOR_WHITE, string);
Sollte sich der warowner ändern wen er die Flagge eingenommen hat.
Code
public OnGWUpdate1()
{
new string[128];
for(new gw;gw<sizeof(GangFight);gw++)
{
if(GangFight[gw][warReady] > 0)GangFight[gw][warReady]--;
if(GangFight[gw][warTime] != 0 && GangFight[gw][warAttacker] != 0 && GangFight[gw][warStarted] != 0)
{
if(IsLoggedIn(GangFight[gw][warCapturedBy][0]) && IsPlayerInRangeOfPoint(GangFight[gw][warCapturedBy][0], 20.0, GangFight[gw][warFlagX1], GangFight[gw][warFlagY1], GangFight[gw][warFlagZ1]))
{
new tstr1[24], tstr2[24];
format(tstr1, 24, "~r~~h~~h~%s", GetFrakName(Spieler[GangFight[gw][warCapturedBy][0]][pFraktion]));
format(tstr2, 24, "~w~%s", GetFrakName(Spieler[GangFight[gw][warCapturedBy][0]][pFraktion]));
switch(GangFight[gw][warCaptureTime][0])
{
case 1:
{
SendClientMessage(GangFight[gw][warCapturedBy][0], COLOR_WHITE, "Noch 30 Sekunden bis zur Eroberung.");
TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
}
case 2: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 3: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 4: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 5: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 6: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 7: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 8: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 9: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 10: SendClientMessage(GangFight[gw][warCapturedBy][0], COLOR_WHITE, "Noch 20 Sekunden bis zur Eroberung."), TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 11: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 12: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 13: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 14: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 15: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 16: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 17: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 18: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 19: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 20: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 21: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 22: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 23: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 24: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 25: SendClientMessage(GangFight[gw][warCapturedBy][0], COLOR_WHITE, "Noch 5 Sekunden bis zur Eroberung."), TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 26: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 27: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 28: TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
case 29: TextDrawSetString(GangFight[gw][warDraw][9], tstr1);
case 30:
{
format(string, sizeof(string), "{FF9933}[GANGFIGHT] %s hat Flagge A erobert.", GetName(GangFight[gw][warCapturedBy][0]));
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
format(string, sizeof(string), "{AFAFAF}Flagge A\n%s\n\n%s", GangFight[gw][warZoneName], GetFrakName(GangFight[gw][warOwner]));
Update3DTextLabelText(GangFight[gw][WarLabel][0], COLOR_WHITE, string);
printf("Besitzer: %s", GetFrakName(GangFight[gw][warOwner]));
GangFight[gw][warCaptureTime][0] = 0;
GangFight[gw][warCapturedFlags][0] = Spieler[GangFight[gw][warCapturedBy][0]][pFraktion];
if(Spieler[GangFight[gw][warCapturedBy][0]][pFraktion] == GangFight[gw][warOwner])
{
GangFight[gw][warOwnerScore] += 5;
format(string, sizeof(string), "~b~%s:~w~ %d/%d Punkte", GetFrakName(GangFight[gw][warOwner]), GangFight[gw][warOwnerScore], MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][3], string);
TextDrawSetString(GangFight[gw][warDraw][9], GetFrakName(GangFight[gw][warOwner]));
}
if(Spieler[GangFight[gw][warCapturedBy][0]][pFraktion] == GangFight[gw][warAttacker])
{
GangFight[gw][warAttackerScore] += 5;
format(string, sizeof(string), "~b~%s:~w~ %d/%d Punkte", GetFrakName(GangFight[gw][warAttacker]), GangFight[gw][warAttackerScore], MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][4], string);
TextDrawSetString(GangFight[gw][warDraw][9], GetFrakName(GangFight[gw][warAttacker]));
}
GangFight[gw][warCapturedBy][0] = -1;
}
}
GangFight[gw][warCaptureTime][0]++;
}
else
{
SendClientMessage(GangFight[gw][warCapturedBy][0], COLOR_WHITE, "Flaggen-Eroberung wurde abgebrochen.");
GangFight[gw][warCaptureTime][0] = 0;
GangFight[gw][warCapturedBy][0] = -1;
new tstr2[24];
format(tstr2, 24, "~w~%s", GetFrakName(GangFight[gw][warCapturedFlags][0]));
TextDrawSetString(GangFight[gw][warDraw][9], tstr2);
}
if(IsLoggedIn(GangFight[gw][warCapturedBy][1]) && IsPlayerInRangeOfPoint(GangFight[gw][warCapturedBy][1], 20.0, GangFight[gw][warFlagX2], GangFight[gw][warFlagY2], GangFight[gw][warFlagZ2]))
{
new tstr1[24], tstr2[24];
format(tstr1, 24, "~r~~h~~h~%s", GetFrakName(Spieler[GangFight[gw][warCapturedBy][1]][pFraktion]));
format(tstr2, 24, "~w~%s", GetFrakName(Spieler[GangFight[gw][warCapturedBy][1]][pFraktion]));
switch(GangFight[gw][warCaptureTime][1])
{
case 1:
{
SendClientMessage(GangFight[gw][warCapturedBy][1], COLOR_WHITE, "Noch 30 Sekunden bis zur Eroberung.");
TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
}
case 2: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 3: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 4: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 5: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 6: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 7: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 8: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 9: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 10: SendClientMessage(GangFight[gw][warCapturedBy][1], COLOR_WHITE, "Noch 20 Sekunden bis zur Eroberung."), TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 11: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 12: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 13: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 14: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 15: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 16: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 17: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 18: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 19: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 20: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 21: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 22: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 23: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 24: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 25: SendClientMessage(GangFight[gw][warCapturedBy][1], COLOR_WHITE, "Noch 5 Sekunden bis zur Eroberung."), TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 26: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 27: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 28: TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
case 29: TextDrawSetString(GangFight[gw][warDraw][13], tstr1);
case 30:
{
format(string, sizeof(string), "{FF9933}[GANGFIGHT] %s hat Flagge B erobert.", GetName(GangFight[gw][warCapturedBy][1]));
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
format(string, sizeof(string), "{AFAFAF}Flagge B\n%s\n\n%s", GangFight[gw][warZoneName], GetFrakName(GangFight[gw][warOwner]));
Update3DTextLabelText(GangFight[gw][WarLabel][1], COLOR_WHITE, string);
printf("Besitzer: %s", GetFrakName(GangFight[gw][warOwner]));
GangFight[gw][warCaptureTime][1] = 0;
GangFight[gw][warCapturedFlags][1] = Spieler[GangFight[gw][warCapturedBy][1]][pFraktion];
if(Spieler[GangFight[gw][warCapturedBy][1]][pFraktion] == GangFight[gw][warOwner])
{
GangFight[gw][warOwnerScore] += 5;
format(string, sizeof(string), "~b~%s:~w~ %d/%d Punkte", GetFrakName(GangFight[gw][warOwner]), GangFight[gw][warOwnerScore], MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][3], string);
TextDrawSetString(GangFight[gw][warDraw][13], GetFrakName(GangFight[gw][warOwner]));
}
if(Spieler[GangFight[gw][warCapturedBy][1]][pFraktion] == GangFight[gw][warAttacker])
{
GangFight[gw][warAttackerScore] += 5;
format(string, sizeof(string), "~b~%s:~w~ %d/%d Punkte", GetFrakName(GangFight[gw][warAttacker]), GangFight[gw][warAttackerScore], MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][4], string);
TextDrawSetString(GangFight[gw][warDraw][13], GetFrakName(GangFight[gw][warAttacker]));
}
GangFight[gw][warCapturedBy][1] = -1;
}
}
GangFight[gw][warCaptureTime][1]++;
}
else
{
SendClientMessage(GangFight[gw][warCapturedBy][1], COLOR_WHITE, "Flaggen-Eroberung wurde abgebrochen.");
GangFight[gw][warCaptureTime][1] = 0;
GangFight[gw][warCapturedBy][1] = -1;
new tstr2[24];
format(tstr2, 24, "~w~%s", GetFrakName(GangFight[gw][warCapturedFlags][1]));
TextDrawSetString(GangFight[gw][warDraw][13], tstr2);
}
if(GangFight[gw][warOwnerScore] >= MAX_GANGFIGHTSCORE)
{
format(string, sizeof(string), "{FF9933}%s haben das Gangfight gewonnen.", GetFraktionName(GangFight[gw][warOwner]));
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
GangZoneStopFlashForAll(GangFight[gw][warZoneID]);
for(new i=0;i<GetMaxPlayers();i++)
{
if(IsLoggedIn(i))
{
if(Spieler[i][pFraktion] == GangFight[gw][warOwner] || Spieler[i][pFraktion] == GangFight[gw][warAttacker])
{
TextDrawHideForPlayer(i, GangFight[gw][warDraw][0]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][1]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][2]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][3]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][4]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][5]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][6]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][7]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][8]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][9]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][10]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][11]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][12]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][13]);
}
}
}
GWisStarted4Fraktion[GangFight[gw][warOwner]] = 0;
GWisStarted4Fraktion[GangFight[gw][warAttacker]] = 0;
GangFight[gw][warAttacker] = 0;
GangFight[gw][warAttackerScore] = 0;
GangFight[gw][warOwnerScore] = 0;
GangFight[gw][warCapturedBy][0] = -1;
GangFight[gw][warCapturedBy][1] = -1;
GangFight[gw][warCapturedFlags][0] = 0;
GangFight[gw][warCapturedFlags][1] = 0;
GangFight[gw][warStarted] = 0;
GangFight[gw][warTime] = 0;
GangFight[gw][warReady] = 120*60;
return 1;
}
if(GangFight[gw][warAttackerScore] >= MAX_GANGFIGHTSCORE)
{
format(string, sizeof(string), "{FF9933}%s haben das Gangfight gewonnen.", GetFraktionName(GangFight[gw][warAttacker]));
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
GangZoneStopFlashForAll(GangFight[gw][warZoneID]);
for(new i=0;i<GetMaxPlayers();i++)
{
if(IsLoggedIn(i))
{
if(Spieler[i][pFraktion] == GangFight[gw][warOwner] || Spieler[i][pFraktion] == GangFight[gw][warAttacker])
{
TextDrawHideForPlayer(i, GangFight[gw][warDraw][0]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][1]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][2]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][3]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][4]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][5]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][6]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][7]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][8]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][9]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][10]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][11]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][12]);
TextDrawHideForPlayer(i, GangFight[gw][warDraw][13]);
}
}
}
GWisStarted4Fraktion[GangFight[gw][warOwner]] = 0;
GWisStarted4Fraktion[GangFight[gw][warAttacker]] = 0;
GangFight[gw][warOwner] = GangFight[gw][warAttacker];
GangFight[gw][warAttacker] = 0;
GangFight[gw][warAttackerScore] = 0;
GangFight[gw][warOwnerScore] = 0;
GangFight[gw][warCapturedBy][0] = -1;
GangFight[gw][warCapturedBy][1] = -1;
GangFight[gw][warCapturedFlags][0] = 0;
GangFight[gw][warCapturedFlags][1] = 0;
GangFight[gw][warStarted] = 0;
GangFight[gw][warTime] = 0;
GangFight[gw][warReady] = 120*60;
return 1;
}
}
}
return 1;
}
Alles anzeigen