Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (
/showthread.php?tid=609253)
Help -
karoliko - 10.06.2016
Hello i have gang wars system and it work perfectly, but i want to the gang zone conquist start only if there arenґt enemy players, i have 4 teams.
code
Код:
CallBack: ZoneUpdate()
{
for(new z=0; z < MAX_ZONES; 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))
{
PlayerConquista( i );
}
}
}
}
}
}
for(new z=0; z < MAX_ZONES; z++)
{
if(ZoneTakeOverTeam[z] != -1)
{
if(GetMembersInZone(z, ZoneTakeOverTeam[z]) >= 1)
{
ZoneTakeOverTime[z]++;
if(ZoneTakeOverTime[z] >= 5)//Parpadeos
{
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;
}
}
}
}
Teams
Код:
// * [ { TEAMґS } ] * //
#define TEAM_GROVE (1)
#define TEAM_BALLAS (2)
#define TEAM_VAGOS (3)
#define TEAM_AZTECAZ (4)
Код:
GetMembersInZone(zoneid, team)
{
new count = 0;
new Float:px, Float:py, Float:pz;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(GetPlayerState(i) != PLAYER_STATE_WASTED && Equipo[i] == team)
{
GetPlayerPos(i, px, py, pz);
if(px > ZoneInfo[zoneid][z_minx] && py > ZoneInfo[zoneid][z_miny] && px < ZoneInfo[zoneid][z_maxx] && py < ZoneInfo[zoneid][z_maxy])
{
count++;
}
}
}
}
return count;
}
Re: Help -
Sime30 - 10.06.2016
Код:
IF player from TEAM A and TEAM B in the zone - Don't start the war
Use checks
Re: Help -
karoliko - 10.06.2016
I don't know how.
Re: Help -
karoliko - 10.06.2016
Someone help me please, i need this...
Re: Help -
karoliko - 12.06.2016
Help,,,