Hello people need help i have problem with simon plugin when i die the skin dont go away
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < colorchat >
#include < fun >
public g_isimon;
new const g_szprefix[ ] = "^04[jailbreak]:^01";
public plugin_init()
{
register_plugin( "simon", "1.0", "wizz" );
register_event( "deathmsg", "event_deathmsg", "a" );
register_clcmd( "say /simon", "cmdsimon" );
register_clcmd( "say /vaheta", "cmdchange" );
register_logevent( "event_roundevent", 3, "1=round_start", "2=round_end" );
set_task( 1.0, "hudsimon", .flags="b" );
}
public plugin_precache()
{
precache_model("models/player/6ikss/6ikss.mdl")
}
public event_roundevent()
{
new players[32], num, playerss;
get_players( players, num, "a" );
for( new i = 0; i < num; i++ )
{
playerss = players[i]
cs_reset_user_model(playerss)
}
g_isimon = 0;
}
public plugin_natives() register_native ("get_simon", "_get_simon",0)
public _get_simon(iplugin, iparams) return g_isimon;
public cmdchange( id )
{
if( id != g_isimon )
{
colorchat( id, normal, "%s sa pead olema ^03simon ^01", g_szprefix );
return plugin_handled;
}
new hmenu = menu_create( "new simon:", "changemenu_handler" );
new szname[ 32 ], szdata[ 6 ];
new iplayers[ 32 ], inum;
get_players( iplayers, inum, "ae", "ct" );
for( new i = 0, iplayer; i < inum; i++ )
{
iplayer = iplayers[ i ];
get_user_name( iplayer, szname, charsmax( szname ) );
num_to_str( iplayer, szdata, charsmax( szdata ) );
menu_additem( hmenu, szname, szdata );
}
menu_display( id, hmenu, 0 );
return plugin_handled;
}
public changemenu_handler( id, hmenu, iitem )
{
if( iitem == menu_exit )
{
menu_destroy( hmenu );
return plugin_handled;
}
new iaccess, hcallback, szdata[ 6 ], szname[ 32 ];
menu_item_getinfo( hmenu, iitem, iaccess, szdata, charsmax( szdata ), szname, charsmax( szname ), hcallback );
new iplayer = str_to_num( szdata );
if( !is_user_alive( iplayer ) )
{
colorchat( id, normal, "%s pole enam ^03simon^01.", g_szprefix );
return plugin_handled;
}
set_user_rendering(id, krenderfxnone, 0, 0, 0, krendernormal, 0)
cs_reset_user_model(id)
g_isimon = iplayer;
set_user_rendering(iplayer, krenderfxglowshell, 0, 50, 200, krendernormal, 16)
cs_set_user_model(iplayer, "6ikss")
colorchat( 0, normal, "%s ^03%s ^01on uus ^03simon^01.", g_szprefix, szname );
return plugin_handled;
}
public cmdsimon( id )
{
if( cs_get_user_team( id ) != cs_team_ct )
{
colorchat( id, normal, "%s ^01sa pead olema ^03valvur ^01et olla simon.", g_szprefix );
return plugin_handled;
}
else if( g_isimon == id )
{
colorchat( id, normal, "%s ^01sa oled juba ^04simon^01!", g_szprefix );
return plugin_handled;
}
else if( is_user_alive( g_isimon ) )
{
colorchat( id, normal, "%s ^01keegi teine on juba simon.", g_szprefix );
return plugin_handled;
}
g_isimon = id;
set_user_rendering(id, krenderfxglowshell, 0, 50, 200, krendernormal, 16)
cs_set_user_model(id, "6ikss")
new name[32];
get_user_name( id, name, 31 );
colorchat( 0, normal, "%s ^03%s ^01 on simon.", g_szprefix, name );
return plugin_continue;
}
public hudsimon()
{
set_hudmessage( 0, 100, 255, 1.0, 0.05, 0, 0.1, 1.0, 0.1, 0.1, 4 );
if( !is_user_alive( g_isimon ) )
{
g_isimon = 0;
show_hudmessage( 0, "" );
return plugin_handled;
}
new name[32];
get_user_name( g_isimon, name, 31 );
show_hudmessage( 0, "%s on simon", name );
return plugin_handled;
}
public client_disconnect( id )
{
if( g_isimon == id )
{
g_isimon = 0;
colorchat( 0, normal, "%s ^01praegune simon lahkus mängust.", g_szprefix );
return plugin_handled;
}
return plugin_handled;
}
public event_deathmsg()
{
new victim = read_data( 2 );
if( !is_user_connected( victim ) )
return plugin_handled;
if( victim == g_isimon )
{
colorchat( 0, normal, "%s ^01praegune simon suri.", g_szprefix );
g_isimon = 0;
return plugin_handled;
}
return plugin_handled;
}