20.08.2011, 16:52
Try this. I don't know if it works but as Lorenc_ also said, this is an example
If you got a function like "GetTeamArea" then you need to replace "if(gTeam[i] ==)"
Add this at the area capture
NOTE: You don't have to add the loops everywhere. At the top of the public function start with "for(new i; i < MAX_PLAYERS; i++)".
Open with a bracket and then end with a bracket.
Add this when he enters the area
Add this when the area is taken over from an other team
If you got a function like "GetTeamArea" then you need to replace "if(gTeam[i] ==)"
Add this at the area capture
NOTE: You don't have to add the loops everywhere. At the top of the public function start with "for(new i; i < MAX_PLAYERS; i++)".
Open with a bracket and then end with a bracket.
pawn Code:
for(new i; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == gTeam[playerid])
{
SetPVarInt(i, "areaTaken/*add the area here for example Area69*/", 1);
}
}
pawn Code:
for(new i; i < MAX_PLAYERS; i++)
{
if(gTeam[i] == /* add team here*/ && (GetPVarInt(i, "areaTaken/*add the area here for example Area69*/") == 1))
{
SendClientMessage(playerid, "Your team has already taken over this area");
SetPVarInt(playerid, "team/*team name*/_area/*area name*/", 1);
}
}
pawn Code:
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPVarInt(i, teamEurope_areaArea69) == 1) // THIS IS AN EXAMPLE
{
SetPVarInt(i, teamEurope_areaArea69, 0);
}
if(gTeam[i] == /* add team here*/ && (GetPVarInt(i, "areaTaken/*add the area here for example Area69*/") == 1))
{
SetPVarInt(playerid, "team/*team name*/_area/*area name*/", 1);
}
}