06.05.2013, 12:45
Hello, i just made my own turf system and i got a problem. When someone takes over a turf, i wanna give at WHOLE team of who captured the turfs, score and money. So i made this:
The problem is:
Im in team usa and i take over Abandoned Airport, but the score and money goes to all players with OTHER teams (i've like germany, japan etc). How to fix this? I wanna give score/money ONLY at players online that are in the same team of who captured the zone.
pawn Код:
if(gTeam[playerid] == TEAM_USA && iCP[playerid] == AbandonedAp)
{
GangZoneShowForAll(Zone[AbandonedAp],COLOR_BLUE);
new string[128], pName5[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName5,sizeof(pName5));
format(string,sizeof string,"** %s (%d) has captured Abandoned Airport for Usa forces!",pName5,playerid);
SendClientMessageToAll(0x008000AA,string);
new echo[128];
format(echo,sizeof echo,"1,5** %s (%d) has captured Abandoned Airport for Usa forces!",pName5,playerid);
IRC_GroupSay(gGroupID, IRC_CHANNEL, echo);
tCP[AbandonedAp] = TEAM_USA;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && gTeam[i] == TEAM_USA)
SCM(i,YELLOW,"** Your team has captured Abandoned Airport and you got +2 score and extra money.");
SetPlayerScore(i, GetPlayerScore(i) +2);
new mrand =random(2500);
GivePlayerMoney(i,mrand);
}
}
Im in team usa and i take over Abandoned Airport, but the score and money goes to all players with OTHER teams (i've like germany, japan etc). How to fix this? I wanna give score/money ONLY at players online that are in the same team of who captured the zone.