12.07.2011, 21:05
For my gamemode I need to be able to give a whole team money. I know where to place the code I just don't know how to do it. Could someone give me an example?
foreach(Player, i)
{
if(GetPlayerTeam(i) == TEAM_YOU_WANT) GivePlayerMoney(i, 5000);
}
foreach(Player, i)
{
if(gTeam[i] == TEAM_YOU_WANT) GivePlayerMoney(i, 5000);
}
GiveTeamMoney(teamid, amount) {
foreach(Player, i)
{
if(GetPlayerTeam(i) == teamid) GivePlayerMoney(i, amount);
}
}
change forach(Player,i) to foreach(Player,i)