Hallo,
immer wenn ich /angriff in einer Zone mache kommt immer GZ: Du bist in keiner angriffszone
hab aber alles richtig angegeben:
if(strcmp(cmd, "/angriff",true)==0)
{
new PlayerGangZone = GetPlayerGangZone(playerid);
new PlayerFraction;
if(IsPlayerInFrac(playerid,5) || IsPlayerInFrac(playerid,6) || IsPlayerInFrac(playerid,13)
|| IsPlayerInFrac(playerid,14) || IsPlayerInFrac(playerid,15) || IsPlayerInFrac(playerid,16) || IsPlayerInFrac(playerid,17)
|| IsPlayerInFrac(playerid,18) || IsPlayerInFrac(playerid,19) || IsPlayerInFrac(playerid,23))
{
if(PlayerGangZone >= 0 && PlayerGangZone < 10)
{
if(GangZone[PlayerGangZone][gzOwner] != PlayerInfo[playerid][pMember] && GangZone[PlayerGangZone][gzOwner] != PlayerInfo[playerid][pLeader])
{
if(GangZone[PlayerGangZone][gzLock] == 0)
{
for(new i=4; i<25; i++)
{
if(IsPlayerInFrac(playerid,i))
{
PlayerFraction = i;
}
}
GangZone[PlayerGangZone][gzAttacker] = PlayerFraction;
printf("%d",PlayerFraction);
GangZone[PlayerGangZone][gzAttacked] = 1;
GangZone[PlayerGangZone][gzLock] = 22;
GangZone[PlayerGangZone][gzAttackerdeaths] = 0;
GangZone[PlayerGangZone][gzOwnerdeaths] = 0;
new getsAttackedstring[128];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(GangZone[PlayerGangZone][gzOwner] == PlayerInfo[i][pMember] || GangZone[PlayerGangZone][gzOwner] == PlayerInfo[i][pLeader]
||GangZone[PlayerGangZone][gzAttacker] == PlayerInfo[i][pMember] || GangZone[PlayerGangZone][gzAttacker] == PlayerInfo[i][pLeader])
{
format(getsAttackedstring, sizeof(getsAttackedstring), "GZ: Die GangZone %d wird angegriffen begib dich schnell dort hin(blinkende GangZone)!",GangZone[PlayerGangZone][gzID]);
SendClientMessage(i, COLOR_LIGHTRED, getsAttackedstring);
SendClientMessage(i, COLOR_LIGHTRED, "Sieh zu dass du nicht stirbst und die Gegner tötest. In 7 Minuten wird der Gewinner entschieden.");
GangZoneFlashForPlayer(i,GangZone[PlayerGangZone][gzID],GetPlayerGangZoneColor(playerid));
}
}
new rand = random(sizeof(GangZoneAttackZeiten));
SetTimerEx("GangZoneAttacked",GangZoneAttackZeiten[rand], false,"d",PlayerGangZone);
}
else
{
new Lockstring[128];
format(Lockstring, sizeof(Lockstring), "GZ: Die GangZone ist noch etwa %d Minuten geschützt",GangZone[PlayerGangZone][gzLock]);
SendClientMessage(playerid, COLOR_LIGHTRED, Lockstring);
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "GZ: Diese GangZone gehört dir schon.");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "GZ: Du bist in keiner Gangzone");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTRED, "GZ: Dafür musst du in einer Gang/Mafia sein.");
}
return 1;
}
Function GetPlayerGangZone(playerid)
{
new GangZoneID;
if(IsPlayerInArea(playerid,2210.904785, -1875.752807, 2298.904785, -1787.752807))//Gangzone 0
{
GangZoneID = 0;
}
Function LoadGangZones()
{
new saverstring[128];
for(new i; i<sizeof(GangZone); i++)
{
format(saverstring,sizeof(saverstring),"GangZone_%d_ID",i);
GangZone[i][gzID] = dini_Int("GangZonen.ini",saverstring);
format(saverstring,sizeof(saverstring),"GangZone_%d_X1",i);
GangZone[i][x1] = dini_Float("GangZonen.ini",saverstring);
format(saverstring,sizeof(saverstring),"GangZone_%d_X2",i);
GangZone[i][x2] = dini_Float("GangZonen.ini",saverstring);
format(saverstring,sizeof(saverstring),"GangZone_%d_Y1",i);
GangZone[i][y1] = dini_Float("GangZonen.ini",saverstring);
format(saverstring,sizeof(saverstring),"GangZone_%d_Y2",i);
GangZone[i][y2] = dini_Float("GangZonen.ini",saverstring);
format(saverstring,sizeof(saverstring),"GangZone_%d_Owner",i);
GangZone[i][gzOwner] = dini_Int("GangZonen.ini",saverstring);
}
return 1;
}
Function CreateGangZones()
{
for(new i; i<sizeof(GangZone); i++)
{
GangZone[i][gzID] = GangZoneCreate(GangZone[i][x1],GangZone[i][y1],GangZone[i][x2],GangZone[i][y2]);
}
}
GangZone_0_ID=10
GangZone_0_X1=2210.904785
GangZone_0_X2=2298.904785
GangZone_0_Y1=-1875.752807
GangZone_0_Y2=-1787.752807
GangZone_0_Owner=13
LG
moritz