[Help] Remove Models viewer
Hello .. Good evening. How can I remove the skins only from the "view" of those who disabled them, eg:
An admin entered the server and received his custom skin, but a player does not like this type of customization, and uses a command, which is for example "/ models", at this time the adm that previously had a custom skin has again the default CS skin (but only for this player that disabled them) for everyone else the model should continue ...
This is the plugin I'm currently using.
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
enum _:ModelsInfo
{
Flag,
CTModel[32],
TModel[32]
}
new bool:bMatch[33]
new const g_eModels[][ModelsInfo] =
{
{ ADMIN_IMMUNITY, "owner_ct", "owner_t" }
{ ADMIN_LEVEL_B, "admin_ct", "admin_t" }
}
new bool:g_bHasCustomSkin[33]
public plugin_init()
{
register_plugin("Multiple Player Models", "1.0", "OciXCrom")
RegisterHam(Ham_Spawn, "player", "OnPlayerSpawn", 1)
register_clcmd("say /models", "ResetModels")
}
public plugin_precache()
{
for(new i; i < sizeof(g_eModels); i++)
{
precache_player_model(g_eModels[i][CTModel])
precache_player_model(g_eModels[i][TModel])
}
}
public client_putinserver(id)
g_bHasCustomSkin[id] = false
public OnPlayerSpawn(id)
{
if(is_user_alive(id))
{
for(new iFlags = get_user_flags(id), i; i < sizeof(g_eModels); i++)
{
if(iFlags & g_eModels[i][Flag])
{
switch(cs_get_user_team(id))
{
case CS_TEAM_CT: set_model(id, g_eModels[i][CTModel])
case CS_TEAM_T: set_model(id, g_eModels[i][TModel])
}
bMatch[id] = true
break
}
}
if(!bMatch[id] && g_bHasCustomSkin[id])
{
g_bHasCustomSkin[id] = false
cs_reset_user_model(id)
}
}
}
set_model(const id, const szModel[])
{
cs_set_user_model(id, szModel)
g_bHasCustomSkin[id] = true
}
|