Quote:
Originally Posted by Berlovan
pawn Код:
forward SetPlayerToTeamColor(playerid); // On the top.
// Between 2 public functions :
SetPlayerToTeamColor(playerid); { if (gTeam[playerid] == TEAM_GROVE) { SetPlayerColor(playerid, TEAM_GROVE_COLOR); } else if (gTeam[playerid] == TEAM_BALLA) { SetPlayerColor(playerid, TEAM_BALLA_COLOR); } return 1; }
// OnPlayerSpawn
public OnPlayerSpawn(playerid) { SetPlayerToTeamColor(playerid); return 1; }
:3
|
There is no need to call a function within another function! Especially when the arguments are only valid to the player.