Announcement

Collapse
No announcement yet.

GetPlayerTeam (Works for ALL Mods & AmxModX Plugins)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • GetPlayerTeam (Works for ALL Mods & AmxModX Plugins)

    I created this function to get a player's Team, is simple, faster, and works for ALL HL1 Mods, also, in CS if a AmxModX plugins change a Player's model, you need to add that model name here, according to his team.

    Code:
    int GetPlayerTeam ( cl_entity_t* ent )
    {
    static char HLMod[16];
    memcpy ( HLMod, gEngfuncs.pfnGetGameDirectory ( ), sizeof ( HLMod ) );
    
    hud_player_info_t PlayerInfo;
    gEngfuncs.pfnGetPlayerInfo ( ent->curstate.number, &PlayerInfo );
    
    if ( !strcmp ( HLMod, "cstrike" ) || !strcmp ( HLMod, "czero" ) )
    {
    if ( strstr ( PlayerInfo.model, "arctic" ) || strstr ( PlayerInfo.model, "guerilla" ) || strstr ( PlayerInfo.model, "leet" ) || strstr ( PlayerInfo.model, "terror" ) || strstr ( PlayerInfo.model, "militia" ) )
    return 1;
    else if ( strstr ( PlayerInfo.model, "zombie_source" ) || strstr ( PlayerInfo.model, "zombie_swarm" ) || strstr ( PlayerInfo.model, "zombieme" ) )
    return 1;
    else if ( strstr ( PlayerInfo.model, "gign" ) || strstr ( PlayerInfo.model, "gsg9" ) || strstr ( PlayerInfo.model, "sas" ) || strstr ( PlayerInfo.model, "urban" ) || strstr ( PlayerInfo.model, "vip" ) || strstr ( PlayerInfo.model, "spetsnaz" ) )
    return 2;
    }
    
    else if ( !strcmp ( HLMod, "vs" ) )
    {
    if ( strstr ( PlayerInfo.model, "eightball" ) || strstr ( PlayerInfo.model, "fatherd" ) || strstr ( PlayerInfo.model, "molly" ) )
    return 1;
    else if ( strstr ( PlayerInfo.model, "edgar" ) || strstr ( PlayerInfo.model, "louis" ) || strstr ( PlayerInfo.model, "nina" ) )
    return 2;
    }
    
    return ent->curstate.team;
    }
Working...
X