Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include < amxmodx >
- #include < hamsandwich >
- #include < fakemeta >
- #define VIP_FLAG read_flags("muie")
- new const g_szVipModelT[ ] = "vip_model_t" ;
- new const g_szVipModelCT[ ] = "vip_model_ct" ;
- public plugin_init( ) {
- register_plugin( "VIP Model", "1.1", "iFenomenal" ) ;
- register_forward( FM_SetClientKeyValue, "fw_FMSetClientKeyValuePre", 0 ) ;
- RegisterHam( Ham_Spawn, "player", "fw_HamSpawnPost", 1 ) ;
- }
- public plugin_precache( ) {
- new szModelT[ 64 ], szModelCT[ 64 ] ;
- formatex( szModelT, charsmax( szModelT ), "models/player/%s/%s.mdl", g_szVipModelT, g_szVipModelT ) ;
- precache_model( szModelT ) ;
- formatex( szModelCT, charsmax( szModelCT ), "models/player/%s/%s.mdl", g_szVipModelCT, g_szVipModelCT ) ;
- precache_model( szModelCT ) ;
- }
- public fw_HamSpawnPost( id ) {
- if( ! is_user_alive( id ) )
- return HAM_IGNORED ;
- if( ~ get_user_flags( id ) & VIP_FLAG )
- return HAM_IGNORED ;
- switch( get_user_team( id ) ) {
- case 1: {
- set_user_info( id, "model", g_szVipModelT ) ;
- }
- case 2: {
- set_user_info( id, "model", g_szVipModelCT ) ;
- }
- }
- return HAM_IGNORED ;
- }
- public fw_FMSetClientKeyValuePre( iPlayer, const szBuffer[ ], const szKey[ ] ) {
- if( equal( szKey, "model" ) ) {
- if( get_user_flags( iPlayer ) & VIP_FLAG ) {
- switch( get_user_team( iPlayer ) ) {
- case 1: {
- set_user_info( iPlayer, "model", g_szVipModelT ) ;
- return FMRES_SUPERCEDE ;
- }
- case 2: {
- set_user_info( iPlayer, "model", g_szVipModelCT ) ;
- return FMRES_SUPERCEDE ;
- }
- }
- }
- }
- return FMRES_IGNORED ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement