Hello i have this code on my gamemode, when x players are in the zone it will start to conquist, but i want to make it too when 1 player or x, if get 3 kills on this zone, starts to conquist it.
Код:
CallBack: ZoneUpdate()
{
for(new z=0; z < MAX_ZONAS; z++)
{
if(ZoneTakeOverTeam[z] == -1)
{
for(new t=0; t < MAX_TEAMS; t++)
{
if(t == ZoneInfo[z][z_team]) continue;
if(GetMembersInZone(z, t) >= 1)
{
ZoneTakeOverTeam[z] = t;
GangZoneFlashForAll(ZoneInfo[z][z_id], GetTeamColor(t));
ZoneTakeOverTime[z] = 0;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerConquistZone( i );
}
}
}
}
}
else
{
if(GetMembersInZone(z, ZoneTakeOverTeam[z]) > 0) // Members, just test
{
ZoneTakeOverTime[z]++;
if(ZoneTakeOverTime[z] >= 5)//20 //The number of gang zone flash, just test
{
GangZoneStopFlashForAll(ZoneInfo[z][z_id]);
GangZoneShowForAll(ZoneInfo[z][z_id], GetTeamColor(ZoneTakeOverTeam[z]));
ZoneInfo[z][z_team] = ZoneTakeOverTeam[z];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerZone(i) == z && Equipo[i] == ZoneTakeOverTeam[z])
{
PlayerWinZone( i );
}
}
}
ZoneTakeOverTeam[z] = -1;
ZoneTakeOverTime[z] = 0;
}
}
else
{
ZoneTakeOverTeam[z] = -1;
GangZoneStopFlashForAll(ZoneInfo[z][z_id]);
ZoneTakeOverTime[z] = 0;
}
}
}
}
CallBack: PlayerConquistZone( playerid )
{
GameTextForPlayer( playerid , "_~n~_~n~_~n~_~w~Has empezado la conquista de esta zona", 2000 , 6 );
new str[128], txt[24] ,zone[MAX_ZONE_NAME];
switch ( Equipo[playerid] )
{
case 1: txt = "~g~Grove";
case 2: txt = "~p~Ballas";
case 3: txt = "~y~Vagos";
case 4: txt = "~b~~h~~h~Aztecas";
}
GetPlayer3DZone(playerid , zone, MAX_ZONE_NAME);
format( str , sizeof str , "~w~Los %s ~w~conquistan una zona cerca de ~y~%s",txt , zone);
Anuncios( str );
return 1;
}
CallBack: PlayerWinZone( playerid )
{
GameTextForPlayer( playerid , "_~n~_~n~_~n~_~g~~h~~h~Has conquistado esta zona~n~~y~~h~ +5 Score~n~~p~~h~ $2500", 2000 , 6 );
DropMoney( playerid , 2500 );
DropScore( playerid , 5 );
new str[128], txt[24] ,zone[MAX_ZONE_NAME];
switch ( Equipo[playerid] )
{
case 1: txt = "~g~Grove";
case 2: txt = "~p~Ballas";
case 3: txt = "~y~Vagos";
case 4: txt = "~b~~h~~h~Aztecas";
}
GetPlayer3DZone(playerid , zone, MAX_ZONE_NAME);
format( str , sizeof str , "~w~Los %s ~w~han conquistado una zona cerca de ~y~%s",txt , zone);
Anuncios( str );
return 1;
}