Code:
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar("Savior_version", VERSION, FCVAR_SERVER|FCVAR_SPONLY)
register_event("DeathMsg", "death_event", "a")
}
public plugin_precache()
{
if( get_pcvar_num(qigong_enable) == 1 )
{
precache_model("models/player/goku/goku.mdl")
}
}
public death_event()
{
new cts[32], ts[32], ctsnum = 0, tsnum = 0
new iPlayers[32], iNum, id, playername[32];
new origin[3], srco[3];
get_players(iPlayers, iNum);
for (new i = 0; i < iNum; i++)
{
id = iPlayers[i];
if (!is_user_connected(id) || !is_user_alive(id))
continue
g_UsingPower[id] = false;
switch (cs_get_user_team(id))
{
case TEAM_T: ts[tsnum++] = id
case TEAM_CT: cts[ctsnum++] = id
default:
{
return PLUGIN_CONTINUE
}
}
if (tsnum > 1 || ctsnum > 1)
{
return PLUGIN_CONTINUE
}
}
if (ctsnum != 1 || tsnum != 1)
{
return PLUGIN_CONTINUE
}
g_Savior = cts[0]
if( get_pcvar_num(model_enable) == 1 )
{
cs_set_user_model(g_Savior, "goku");
}
client_print(0, print_chat, "model changed");
}
else
{
g_Savior = 0
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
When I was the last CT, and I kill a T, the client_print worked, but my model didn`t change. I want to change my model to goku when I kill someone
Thanks
__________________