Advertisement
iXdoctor

Admin Models

Oct 7th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.04 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4. #include < hamsandwich >
  5. #include < cstrike >
  6.  
  7. enum _: gData {     mModel[ 33 ],   mACCESS     }
  8.  
  9. new const szDatas [ ] [ gData ] =
  10. {
  11.     { "regular_model", ADMIN_ALL },
  12.     { "vip_model", ADMIN_KICK },
  13.     { "admin_model", ADMIN_MAP },
  14.     { "superadmin_model", ADMIN_BAN },
  15.     { "manager_model", ADMIN_RESERVATION },
  16.     { "owner_model", ADMIN_IMMUNITY }
  17. }
  18.    
  19. public plugin_init()
  20. {
  21.     register_plugin( "Admins Models", "1.0", "Cookie Monster" )
  22.    
  23.     RegisterHam( Ham_Spawn, "player", "FwClientSpawn_Post" );
  24. }
  25.  
  26. public plugin_precache()
  27. {
  28.     for( new i, szModel[ 128 ]; i < sizeof( szDatas ); i++ )
  29.     {
  30.         formatex( szModel, charsmax( szModel ), "models/player/%s/%s.mdl", szDatas[ i ][ mModel ], szDatas[ i ][ mModel ] );
  31.        
  32.         precache_model( szModel );
  33.     }
  34. }
  35.    
  36. public FwClientSpawn_Post( client )
  37. {
  38.     for( new i; i < sizeof( szDatas ); i++ )
  39.     {
  40.         if( get_user_flags( client ) & szDatas[ i ][ mACCESS ] )
  41.         {
  42.             cs_set_user_model( client, szDatas[ i ][ mModel ] );
  43.            
  44.             break;
  45.         }
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement