#include <amxmodx>
#include <cstrike>
#include <cs_player_models_api>
#include <hamsandwich>
new const gNazwaPluginu[] = "JailBreak - Modele";
new const gWersjaPluginu[] = "1";
new const gAutorPluginu[] = "noFear";
new const gModelAdminCT[] = "jb_mafiozoct";
new const gModelAdminCTPobieranie[] = "models/player/jailbreak_mafiozoct/jb_mafiozoct.mdl";
new const gModelAdminTT[] = "jb_mafiozott";
new const gModelAdminTTPobieranie[] = "models/player/jailbreak_mafiozott/jb_mafiozott.mdl";
public plugin_init()
{
register_plugin(gNazwaPluginu, gWersjaPluginu, gAutorPluginu);
RegisterHam(Ham_Spawn, "player", "fwSpawn", 1);
}
public plugin_precache()
{
precache_model(gModelAdminCTPobieranie);
precache_model(gModelAdminTTPobieranie);
}
public Spawn(id)
{
if (!is_user_alive(id))
return HAM_IGNORED;
new CsTeams:userTeam = cs_get_user_team(id);
if(get_user_flags(id) & ADMIN_LEVEL_G)
{
if (userTeam == CS_TEAM_T)
{
cs_set_player_model(id, gModelAdminTT);
}
else if(userTeam == CS_TEAM_CT)
{
cs_set_player_model(id, gModelAdminCT);
}
else
{
cs_reset_player_model(id);
}
}
return HAM_IGNORED;
}