ocmd:flag(playerid, params)
{
new gw = GetPlayerGangzone(playerid), string[128];
if(IsGang(Spieler[playerid][pFraktion]))
{
if(!IsPlayerInAnyVehicle(playerid) && GangFight[gw][warTime] != 0 || GangFight[gw][warAttacker] != 0 || GangFight[gw][warStarted] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, GangFight[gw][warFlagX1], GangFight[gw][warFlagY1], GangFight[gw][warFlagZ1]))
{
if(Spieler[playerid][pFraktion] == GangFight[gw][warOwner])
{
if(GangFight[gw][warCapturedFlags][0] == GangFight[gw][warOwner])
{
GangFight[gw][warOwnerScore] += 1;
format(string, sizeof(string), "~b~%03d", GangFight[gw][warOwnerScore]);
TextDrawSetString(GangFight[gw][warDraw][5], string);
format(string, sizeof(string), "~b~%d", MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][3], string);
format(string, sizeof(string), "~w~%s", GetFrakName(GangFight[gw][warOwner]));
TextDrawSetString(GangFight[gw][warDraw][15], string);
format(string, sizeof(string), "{FF9933}[GANGFIGHT] %s (%s) hat Flagge A erobert.", GetName(playerid), GetFrakName(GangFight[gw][warOwner]));
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
GangFight[gw][warCaptureTime][0] = 0;
GangFight[gw][warCapturedFlags][0] = Spieler[playerid][pFraktion];
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Diese Flagge gehört bereits deiner Fraktion.");
}
if(Spieler[playerid][pFraktion] == GangFight[gw][warAttacker])
{
if(GangFight[gw][warCapturedFlags][0] == GangFight[gw][warAttacker])
{
GangFight[gw][warOwnerScore] += 1;
format(string, sizeof(string), "~b~%03d", GangFight[gw][warAttackerScore]);
TextDrawSetString(GangFight[gw][warDraw][6], string);
format(string, sizeof(string), "~b~%d", MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][2], string);
format(string, sizeof(string), "~w~%s", GetFrakName(GangFight[gw][warAttacker]));
TextDrawSetString(GangFight[gw][warDraw][15], string);
format(string, sizeof(string), "{FF9933}[GANGFIGHT] %s (%s) hat Flagge A erobert.", GetName(playerid), GetFrakName(GangFight[gw][warAttacker]));
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
GangFight[gw][warCaptureTime][0] = 0;
GangFight[gw][warCapturedFlags][0] = Spieler[playerid][pFraktion];
format(string, sizeof(string), "{AFAFAF}Flagge A\n%s\n\n%s", GangFight[gw][warZoneName], GetFrakName(GangFight[gw][warAttacker]));
Update3DTextLabelText(GangFight[gw][WarLabel][0], COLOR_WHITE, string);
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Diese Flagge gehört bereits deiner Fraktion.");
}
}
}
if(IsPlayerInRangeOfPoint(playerid, 5.0, GangFight[gw][warFlagX2], GangFight[gw][warFlagY2], GangFight[gw][warFlagZ2]))
{
if(Spieler[playerid][pFraktion] == GangFight[gw][warOwner])
{
if(GangFight[gw][warCapturedFlags][1] == GangFight[gw][warOwner])
{
GangFight[gw][warOwnerScore] += 1;
format(string, sizeof(string), "~b~%03d", GangFight[gw][warOwnerScore]);
TextDrawSetString(GangFight[gw][warDraw][5], string);
format(string, sizeof(string), "~b~%d", MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][3], string);
format(string, sizeof(string), "~w~%s", GetFrakName(GangFight[gw][warOwner]));
TextDrawSetString(GangFight[gw][warDraw][16], string);
format(string, sizeof(string), "{FF9933}[GANGFIGHT] %s (%s) hat Flagge B erobert.", GetName(playerid), GetFrakName(GangFight[gw][warOwner]));
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
GangFight[gw][warCaptureTime][1] = 0;
GangFight[gw][warCapturedFlags][1] = Spieler[playerid][pFraktion];
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);
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Diese Flagge gehört bereits deiner Fraktion.");
}
if(Spieler[playerid][pFraktion] == GangFight[gw][warAttacker])
{
if(GangFight[gw][warCapturedFlags][1] == GangFight[gw][warAttacker])
{
GangFight[gw][warAttackerScore] += 1;
format(string, sizeof(string), "~b~%03d", GangFight[gw][warAttackerScore]);
TextDrawSetString(GangFight[gw][warDraw][6], string);
format(string, sizeof(string), "~b~%d", MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][2], string);
format(string, sizeof(string), "~w~%s", GetFrakName(GangFight[gw][warAttacker]));
TextDrawSetString(GangFight[gw][warDraw][16], string);
format(string, sizeof(string), "{FF9933}[GANGFIGHT] %s (%s) hat Flagge B erobert.", GetName(playerid), GetFrakName(GangFight[gw][warAttacker]));
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
GangFight[gw][warCaptureTime][1] = 0;
GangFight[gw][warCapturedFlags][1] = Spieler[playerid][pFraktion];
format(string, sizeof(string), "{AFAFAF}Flagge B\n%s\n\n%s", GangFight[gw][warZoneName], GetFrakName(GangFight[gw][warAttacker]));
Update3DTextLabelText(GangFight[gw][WarLabel][1], COLOR_WHITE, string);
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Diese Flagge gehört bereits deiner Fraktion.");
}
}
if(IsPlayerInRangeOfPoint(playerid, 5.0, GangFight[gw][warFlagX3], GangFight[gw][warFlagY3], GangFight[gw][warFlagZ3]))
{
if(Spieler[playerid][pFraktion] == GangFight[gw][warOwner])
{
if(GangFight[gw][warCapturedFlags][2] == GangFight[gw][warOwner])
{
GangFight[gw][warOwnerScore] += 1;
format(string, sizeof(string), "~b~%03d", GangFight[gw][warOwnerScore]);
TextDrawSetString(GangFight[gw][warDraw][5], string);
format(string, sizeof(string), "~b~%d", MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][3], string);
format(string, sizeof(string), "~w~%s", GetFrakName(GangFight[gw][warOwner]));
TextDrawSetString(GangFight[gw][warDraw][17], string);
format(string, sizeof(string), "{FF9933}[GANGFIGHT] %s (%s) hat Flagge C erobert.", GetName(playerid), GetFrakName(GangFight[gw][warOwner]));
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
GangFight[gw][warCaptureTime][2] = 0;
GangFight[gw][warCapturedFlags][2] = Spieler[playerid][pFraktion];
format(string, sizeof(string), "{AFAFAF}Flagge C\n%s\n\n%s", GangFight[gw][warZoneName], GetFrakName(GangFight[gw][warOwner]));
Update3DTextLabelText(GangFight[gw][WarLabel][2], COLOR_WHITE, string);
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Diese Flagge gehört bereits deiner Fraktion.");
}
if(Spieler[playerid][pFraktion] == GangFight[gw][warAttacker])
{
if(GangFight[gw][warCapturedFlags][2] == GangFight[gw][warAttacker])
{
GangFight[gw][warAttackerScore] += 1;
format(string, sizeof(string), "~b~%03d", GangFight[gw][warAttackerScore]);
TextDrawSetString(GangFight[gw][warDraw][6], string);
format(string, sizeof(string), "~b~%d", MAX_GANGFIGHTSCORE);
TextDrawSetString(GangFight[gw][warDraw][2], string);
format(string, sizeof(string), "~w~%s", GetFrakName(GangFight[gw][warAttacker]));
TextDrawSetString(GangFight[gw][warDraw][17], string);
format(string, sizeof(string), "{FF9933}[GANGFIGHT] %s (%s) hat Flagge C erobert.", GetName(playerid), GetFrakName(GangFight[gw][warAttacker]));
SendFraktionMessage(GangFight[gw][warAttacker], COLOR_WHITE, string);
SendFraktionMessage(GangFight[gw][warOwner], COLOR_WHITE, string);
GangFight[gw][warCaptureTime][2] = 0;
GangFight[gw][warCapturedFlags][2] = Spieler[playerid][pFraktion];
format(string, sizeof(string), "{AFAFAF}Flagge C\n%s\n\n%s", GangFight[gw][warZoneName], GetFrakName(GangFight[gw][warAttacker]));
Update3DTextLabelText(GangFight[gw][WarLabel][2], COLOR_WHITE, string);
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Diese Flagge gehört bereits deiner Fraktion.");
}
return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Du befindest dich an keiner Flagge.");
}
return SendClientMessage(playerid, COLOR_WHITE, "{AFAFAF}Derzeit ist kein Gangfight aktiv!");
}
return 1;
}
Alles anzeigen