Problem beim gangzonen system :
Beim sterben bekommt das team des getöteten punktabzug und das des killers punkte
public OnPlayerDeath(playerid, killerid, reason)
{
for(new i = 0;i < sizeof zone;i++)
{
if (IsPlayerInArea(playerid,zone[i][zone_minx], zone[i][zone_miny], zone[i][zone_maxx], zone[i][zone_maxy]))
{
if(zone[i][angriff] == 1)
{
if(pInfo[killerid][Team] <= 3)
{
zone[i][copp] += 5;
}
else if(pInfo[killerid][Team] == 5)
{
zone[i][grovep] += 5;
}
else if(pInfo[killerid][Team] == 6)
{
zone[i][mementop] += 5;
}
else if(pInfo[killerid][Team] == 7)
{
zone[i][cosap] += 5;
}
else if(pInfo[killerid][Team] == 8)
{
zone[i][yakuzap] += 5;
}
if(pInfo[playerid][Team] <= 3)
{
zone[i][copp] -= 6;
}
else if(pInfo[playerid][Team] == 5)
{
zone[i][grovep] -= 6;
}
else if(pInfo[playerid][Team] == 6)
{
zone[i][mementop] -= 6;
}
else if(pInfo[playerid][Team] == 7)
{
zone[i][cosap] -= 6;
}
else if(pInfo[playerid][Team] == 8)
{
zone[i][yakuzap] -= 6;
}
}
else
{
if(pInfo[killerid][Team] <= 3)
{
zone[i][copp] += 2;
}
else if(pInfo[killerid][Team] == 5)
{
zone[i][grovep] += 2;
}
else if(pInfo[killerid][Team] == 6)
{
zone[i][mementop] += 2;
}
else if(pInfo[killerid][Team] == 7)
{
zone[i][cosap] += 2;
}
else if(pInfo[killerid][Team] == 8)
{
zone[i][yakuzap] += 2;
}
if(pInfo[playerid][Team] <= 3)
{
zone[i][copp] -= 1;
}
else if(pInfo[playerid][Team] == 5)
{
zone[i][grovep] -= 1;
}
else if(pInfo[playerid][Team] == 6)
{
zone[i][mementop] -= 1;
}
else if(pInfo[playerid][Team] == 7)
{
zone[i][cosap] -= 1;
}
else if(pInfo[playerid][Team] == 8)
{
zone[i][yakuzap] -= 1;
}
}
}
}
return 1;
}
und wenn das besitzerteam weniger punkte hatt als ein anderes soll ein krieg beginnen, wo am ende ein team als neuer besitzer hervorgeht, jedoch ist hir keine reaktion
public Update()
{
if(skrieg == 0)
{
for(new i = 0;i < sizeof zone;i++)
{
if(zone[i][besitzer] == 0)
{
if(zone[i][copp] <= zone[i][grovep] || zone[i][copp] <= zone[i][mementop] || zone[i][copp] <= zone[i][cosap] || zone[i][copp] <= zone[i][yakuzap])
{
zone[i][angriff] = 1;
GangZoneFlashForAll(zone[i][zname],COLOR_zone1);
skrieg = 1;
SetTimer("ekrieg", 1000*60*4, 0);
}
}
else if(zone[i][besitzer] == 5)
{
if(zone[i][grovep] <= zone[i][copp] || zone[i][grovep] <= zone[i][mementop] || zone[i][grovep] <= zone[i][cosap] || zone[i][grovep] <= zone[i][yakuzap])
{
zone[i][angriff] = 1;
GangZoneFlashForAll(zone[i][zname],COLOR_zone1);
skrieg = 1;
SetTimer("ekrieg", 1000*60*4, 0);
}
}
else if(zone[i][besitzer] == 6)
{
if(zone[i][mementop] <= zone[i][copp] || zone[i][mementop] <= zone[i][grovep] || zone[i][mementop] <= zone[i][cosap] || zone[i][mementop] <= zone[i][yakuzap])
{
zone[i][angriff] = 1;
GangZoneFlashForAll(zone[i][zname],COLOR_zone1);
skrieg = 1;
SetTimer("ekrieg", 1000*60*4, 0);
}
}
else if(zone[i][besitzer] == 7)
{
if(zone[i][cosap] <= zone[i][copp] || zone[i][cosap] <= zone[i][mementop] || zone[i][cosap] <= zone[i][grovep] || zone[i][cosap] <= zone[i][yakuzap])
{
zone[i][angriff] = 1;
GangZoneFlashForAll(zone[i][zname],COLOR_zone1);
skrieg = 1;
SetTimer("ekrieg", 1000*60*4, 0);
}
}
else if(zone[i][besitzer] == 8)
{
if(zone[i][yakuzap] <= zone[i][copp] || zone[i][yakuzap] <= zone[i][mementop] || zone[i][yakuzap] <= zone[i][grovep] || zone[i][yakuzap] <= zone[i][cosap])
{
zone[i][angriff] = 1;
GangZoneFlashForAll(zone[i][zname],COLOR_zone1);
skrieg = 1;
SetTimer("ekrieg", 1000*60*4, 0);
}
}
}
}
public ekrieg()
{
for(new i = 0;i < sizeof zone;i++)
{
if(zone[i][copp] >= zone[i][grovep] && zone[i][copp] >= zone[i][mementop] && zone[i][copp] >= zone[i][cosap] && zone[i][copp] >= zone[i][yakuzap])
{
zone[i][besitzer] = 0;
GangZoneShowForAll(zone[i][zname], COLOR_zone0);
zone[i][angriff] = 0;
GangZoneStopFlashForAll(zone[i][zname]);
}
else if(zone[i][grovep] >= zone[i][copp] && zone[i][grovep] >= zone[i][mementop] && zone[i][grovep] >= zone[i][cosap] && zone[i][grovep] >= zone[i][yakuzap])
{
zone[i][besitzer] = 5;
GangZoneShowForAll(zone[i][zname], COLOR_T5);
zone[i][angriff] = 0;
GangZoneStopFlashForAll(zone[i][zname]);
}
else if(zone[i][mementop] >= zone[i][copp] && zone[i][mementop] >= zone[i][grovep] && zone[i][mementop] >= zone[i][cosap] && zone[i][mementop] >= zone[i][yakuzap])
{
zone[i][besitzer] = 6;
GangZoneShowForAll(zone[i][zname], COLOR_T6);
zone[i][angriff] = 0;
GangZoneStopFlashForAll(zone[i][zname]);
}
else if(zone[i][cosap] >= zone[i][copp] && zone[i][cosap] >= zone[i][mementop] && zone[i][cosap] >= zone[i][grovep] && zone[i][cosap] >= zone[i][yakuzap])
{
zone[i][besitzer] = 7;
GangZoneShowForAll(zone[i][zname], COLOR_T7);
zone[i][angriff] = 0;
GangZoneStopFlashForAll(zone[i][zname]);
}
else if(zone[i][yakuzap] >= zone[i][copp] && zone[i][yakuzap] >= zone[i][mementop] && zone[i][yakuzap] >= zone[i][grovep] && zone[i][yakuzap] >= zone[i][cosap])
{
zone[i][besitzer] = 8;
GangZoneShowForAll(zone[i][zname], COLOR_T8);
zone[i][angriff] = 0;
GangZoneStopFlashForAll(zone[i][zname]);
}
}
}
public krieg()
{
skrieg = 0;
}
//EDIT:
könnte es hier liegen?
if(zone[i][besitzer] == 0)
{
if(zone[i][copp] <= zone[i][grovep] || zone[i][copp] <= zone[i][mementop] || zone[i][copp] <= zone[i][cosap] || zone[i][copp] <= zone[i][yakuzap])
{
zone[i][angriff] = 1;
GangZoneFlashForAll(zone[i][zname],COLOR_zone1);
skrieg = 1;
SetTimer("ekrieg", 1000*60*4, 0);
}
}
copp ist = 2 und grovep = 3 es pasiert aber leider nix