Hello people i have problem.. when i type /simon im simon and i get simon skin + glowing but if i dont die then im nextround simon to (ITS OKAY) but my simon skin and glowing is gone (ITS NOT OKAY) :S :S
PHP Code:
#include < amxmodx >
#include < cstrike >
#include < colorchat >
#include < fun >
#include < hamsandwich >
#define IS_VIP ADMIN_SLAY
new 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" );
RegisterHam(Ham_Spawn, "player", "player_spawn", 1)
set_task( 1.0, "HudSimon", .flags="b" );
}
public plugin_precache()
{
precache_model("models/player/6ikss/6ikss.mdl")
precache_model("models/player/oika_v/oika_v.mdl")
precache_model("models/player/oika_te/oika_te.mdl")
}
public player_spawn(id)
{
modelcheck(id)
}
public modelcheck(id)
{
if(get_user_flags(id) & IS_VIP)
{
switch(cs_get_user_team(id))
{
case CS_TEAM_T:
{
cs_set_user_model(id, "oika_te")
}
case CS_TEAM_CT:
{
cs_set_user_model(id, "oika_v")
}
}
}
else
{
cs_reset_user_model(id)
}
set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderNormal, 0)
}
public Event_RoundEvent()
{
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;
}
modelcheck(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;
}