Code:
#include < amxmodx >
#include < fakemeta >
#include < hamsandwich >
new const g_szModel[ ] = "bill" ;
#define ADMIN_FLAG ADMIN_KICK
public plugin_init( ) {
register_plugin( "Admin Skin", "1.0", "DoNii" ) ;
RegisterHam( Ham_Spawn, "player", "fw_HamSpawnPost", 1 ) ;
register_forward( FM_SetClientKeyValue, "fw_SetClientKeyValue" )
}
public plugin_precache( ) {
new szBuffer[ 64 ] ;
formatex( szBuffer, charsmax( szBuffer ), "models/player/%s/%s.mdl", g_szModel, g_szModel ) ;
precache_model( szBuffer ) ;
}
public fw_HamSpawnPost( id ) {
set_task( 1.0, "fw_HamSpawnPostDelay", id ) ;
}
public fw_SetClientKeyValue( id, const infobuffer[ ], const key[ ] ) {
if( get_user_team( id ) != 2 )
return FMRES_IGNORED ;
if( ~ get_user_flags( id ) & ADMIN_KICK )
return FMRES_IGNORED ;
if( equal( key, "model" ) ) {
set_user_info( id, "model", g_szModel ) ;
return FMRES_SUPERCEDE ;
}
return FMRES_IGNORED ;
}
public fw_HamSpawnPostDelay( id ) {
if( ! is_user_alive( id ) )
return PLUGIN_CONTINUE ;
if( ~ get_user_flags( id ) & ADMIN_FLAG )
return PLUGIN_CONTINUE ;
if( get_user_team( id ) != 2 )
return PLUGIN_CONTINUE ;
set_user_info( id, "model", g_szModel ) ;
remove_task( id ) ;
return PLUGIN_CONTINUE ;
}
EDIT : By the way, you could just use the first code and put this plugin's name before umbrella swarm's in plugins.ini !
__________________