13.12.2012, 16:39
I think SA-MP provides 'GetPlayerTeam' function only for getting the Team ID. Here's a small stock in creating team name too.
Now the SetPlayerTeamEx sets the team as well as a name.
Example: SetPlayerTeamEx(playerid, 1, "Lordz's team");
Which means the team id of player is 1 and team name of player is "Lordz's team".
GetPlayerTeamName gets the team name of the player. If you want too hook the SetPlayerTeam function so that it do sets team and teamname without using setplayerteamex, use this too below:
pawn Код:
new playateamname[MAX_PLAYER_NAME][128];
stock SetPlayerTeamEx(playerid, team, teamname[])
{
SetPlayerTeam(playerid, team);
playateamname[playerid] = teamname;
return 1;
}
stock GetPlayerTeamName(playerid)
{
return playateamname[playerid];
}
Example: SetPlayerTeamEx(playerid, 1, "Lordz's team");
Which means the team id of player is 1 and team name of player is "Lordz's team".
GetPlayerTeamName gets the team name of the player. If you want too hook the SetPlayerTeam function so that it do sets team and teamname without using setplayerteamex, use this too below:
pawn Код:
#if defined _ALS_SetPlayerTeam
#undef SetPlayerTeam
#else
#define _ALS_SetPlayerTeam
#endif
#define SetPlayerTeam SetPlayerTeamEx
/*Now the SetPlayerTeam has been added with setting team name too:
SetPlayerTeam(playerid, teamid, teamname[]);
GetPlayerTeam(playerid); -> For getting team id.
GetPlayerTeamName(playerid); -> For getting team name. */