08.08.2011, 03:43
Just because the function is buggy, doesn't mean it's ineffective ![Wink](images/smilies/wink.png)
Example:
To assure that there are no bugs, when calling anything to check which team the player is one, use the variable.
Instead of:
This is an example in relation to command which will allow both some-what of immunity to team-mates plus there shouldn't really be any bugs when using a variable.
![Wink](images/smilies/wink.png)
Example:
PHP код:
new playerteam[MAX_PLAYERS];
if(playerteam[playerid] == 1)
{
SetPlayerTeam(playerid, 1)
}
else if(playerteam[playerid] == 2)
{
SetPlayerTeam(playerid, 2)
}
PHP код:
CMD:hi(playerid, params[])
{
if(playerteam[playerid] == 1)
{
//code
}
}
PHP код:
CMD:hi(playerid, params[])
{
if(GetPlayerTeam(playerid) == 1)
{
//code
}
}