Advertisement
crywolfy

player_models.sma

Dec 29th, 2014
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.24 KB | None | 0 0
  1. /*
  2.     (c) Player Models
  3.     2014 by CryWolf
  4.         eXtreamCS Dev Team
  5. */
  6.  
  7. #include < amxmodx >
  8. #include < cstrike >
  9. #include < hamsandwich >
  10.  
  11.  
  12. new const
  13.     PLUGIN_NAME [ ] = "Player Models",
  14.     PLUGIN_VERSION  [ ] = "0.0.1",
  15.     PLUGIN_AUTHOR   [ ] = "CryWolf";
  16.  
  17. // Model CT
  18. new ct_model [ ] =
  19. {
  20.     "models/player/modelct/modelct.mdl"
  21. };
  22.  
  23. // Model Terro
  24. new te_model [ ] =
  25. {
  26.     "models/player/modelte/modelte.mdl"
  27. };
  28.  
  29. #pragma semicolon 1
  30.  
  31.  
  32. public plugin_precache ( )
  33. {
  34.     precache_model ( ct_model );
  35.     precache_model ( te_model );
  36. }
  37.  
  38. public plugin_init ( )
  39. {
  40.     register_plugin ( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR );
  41.     RegisterHam ( Ham_Spawn, "player", "FunC_HamSpawn", true );
  42. }
  43.  
  44. public FunC_HamSpawn ( iPlayer )
  45. {
  46.     if ( is_user_alive ( iPlayer ) )
  47.         set_task ( random_float ( 1.0, 4.2 ), "FunC_SetModel", iPlayer );
  48. }
  49.  
  50. public FunC_SetModel ( iPlayer )
  51. {
  52.     if ( !is_user_alive ( iPlayer ) )
  53.         return HAM_SUPERCEDE;
  54.    
  55.     client_cmd ( iPlayer, "cl_minmodels 0" );
  56.    
  57.     switch ( cs_get_user_team ( iPlayer ) )
  58.     {
  59.         case CS_TEAM_CT:
  60.         {
  61.             cs_set_user_model ( iPlayer, "modelct" );
  62.         }
  63.         case CS_TEAM_T:
  64.         {
  65.             cs_set_user_model ( iPlayer, "modelte" );
  66.         }
  67.        
  68.         default: return HAM_IGNORED;
  69.        
  70.     }
  71.     return HAM_IGNORED;
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement