Thread: [Solved] team name
View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-06-2020 , 15:26   Re: team name
Reply With Quote #3

Quote:
Originally Posted by tepegoz View Post
I want to show team names as T,CT,SPEC but it is showing 1,2,3. How to change 1,2,3 to T,CT,SPEC ?


PHP Code:
new team get_user_team(z)
new 
lFirstSaid[64];

   
format(lFirstSaid63"%s - %i: %i: %i - %i -",anameg_s[z][TIME_MINUTES], g_s[z][TIME_SECONDS], g_s[z][TIME_MSECONDS],team
In your code, 'team' is the integer representation/index of the team.
0 = unassigned
1 = T
2 = CT
3 = Spec

You also need to use %s, not %i to format a string value

Add #include <cstrike>
PHP Code:
new CsTeams:team cs_get_user_team(z)
new 
lFirstSaid[64];
new const 
szTeamsCsTeams ][] = { "UNASSIGNED" "T" "CT" "SPEC" };

formatex(lFirstSaidcharsmax(lFirstSaid), "%s - %i: %i: %i - %s -",anameg_s[z][TIME_MINUTES], g_s[z][TIME_SECONDS], g_s[z][TIME_MSECONDS],szTeamsteam ] ) 
__________________
Bugsy is offline