|
AlliedModders Donor
Join Date: Jun 2007
Location: HCMC, Vietnam
|
05-10-2020
, 22:08
Re: [CS:GO] Getting team name
|
#12
|
Quote:
Originally Posted by lingzhidiyu
PHP Code:
public void OnPluginStart() {
RegConsoleCmd("sm_ptm", Command_PrintTeamName, "This is a command", ADMFLAG_ROOT);
}
public Action Command_PrintTeamName(int client, int args) {
int teamIndex_T = -1, teamIndex_CT = -1;
int index = -1;
while ((index = FindEntityByClassname(index, "cs_team_manager")) != -1) {
int teamNum = GetEntProp(index, Prop_Send, "m_iTeamNum");
if (teamNum == CS_TEAM_T) {
teamIndex_T = index;
} else if (teamNum == CS_TEAM_CT) {
teamIndex_CT = index;
}
}
if (teamIndex_T == -1 || teamIndex_CT == -1) {
PrintToChatAll("404 not found");
return;
}
char teamName_T[32];
GetEntPropString(teamIndex_T, Prop_Send, "m_szClanTeamname", teamName_T, 32);
char teamName_CT[32];
GetEntPropString(teamIndex_CT, Prop_Send, "m_szClanTeamname", teamName_CT, 32);
PrintToChatAll("T: %s", teamName_T);
PrintToChatAll("CT: %s", teamName_CT);
PrintToChatAll(" \x04Done");
}
|
I can't comile ... can you post .sp file pls?
__________________
|
|
|
|