Get a players team (Not with id)
#7

I think SA-MP provides 'GetPlayerTeam' function only for getting the Team ID. Here's a small stock in creating team name too.
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];
}
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 Код:
#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. */
Reply


Messages In This Thread
Get a players team (Not with id) - by davve95 - 13.12.2012, 15:42
Re: Get a players team (Not with id) - by [HK]Ryder[AN] - 13.12.2012, 15:44
Re: Get a players team (Not with id) - by davve95 - 13.12.2012, 15:59
Re: Get a players team (Not with id) - by tyler12 - 13.12.2012, 16:06
Re: Get a players team (Not with id) - by Lordzy - 13.12.2012, 16:11
Re: Get a players team (Not with id) - by davve95 - 13.12.2012, 16:14
Re: Get a players team (Not with id) - by Lordzy - 13.12.2012, 16:39
Re: Get a players team (Not with id) - by davve95 - 13.12.2012, 17:00
Re: Get a players team (Not with id) - by Lordzy - 13.12.2012, 18:30
Re: Get a players team (Not with id) - by davve95 - 13.12.2012, 18:33

Forum Jump:


Users browsing this thread: 3 Guest(s)