Advertisement
GaMeRFoReVeR

Modeli Igraca

Dec 16th, 2014
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.47 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4. #include <hamsandwich>
  5. #include <cstrike>
  6. #include <fakemeta>
  7.  
  8. #define PLUGIN "Player Model"
  9. #define VERSION "1.0"
  10. #define AUTHOR "GaMeR FoReVeR"
  11.  
  12. new const modeli[][] =
  13. {
  14.     "ctmodel",
  15.     "ttmodel"
  16. };
  17.  
  18. new model_igraca[33][64];
  19.  
  20. public plugin_init()
  21. {
  22.     register_plugin(PLUGIN, VERSION, AUTHOR);
  23.    
  24.     RegisterHam(Ham_Spawn, "player", "ham_Spawn", .Post = true);
  25.    
  26.     register_forward(FM_SetClientKeyValue, "fw_SetKeyValue");
  27.    
  28.     register_message(get_user_msgid("ClCorpse"), "msg_ClCorpse");
  29. }
  30.  
  31. public plugin_precache()
  32. {
  33.     precache_model("models/player/ctmodel/ctmodel.mdl");
  34.     precache_model("models/player/ttmodel/ttmodel.mdl");
  35. }
  36.  
  37. public client_putinserver(id)
  38. {
  39.     model_igraca[id][0] = EOS;
  40. }
  41.  
  42. public ham_Spawn(id)
  43. {
  44.     if(is_user_alive(id))
  45.     {
  46.         new CsTeams:iTeam = cs_get_user_team(id);
  47.        
  48.         if(iTeam == CS_TEAM_CT || iTeam == CS_TEAM_T)
  49.         {
  50.             copy(model_igraca[ id ], charsmax(model_igraca[]), modeli[_:iTeam - 1]);
  51.             set_user_info(id, "model", model_igraca[id]);
  52.         }
  53.     }
  54. }
  55.  
  56. public fw_SetKeyValue(id, const _szInfoBuffer[], const _szKey[], const _szValue[])
  57. {
  58.     if(model_igraca[id][0] && equal(_szKey, "model") && !equal(_szValue, model_igraca[id]))
  59.     {
  60.         set_user_info(id, "model", model_igraca[id]);
  61.         return FMRES_SUPERCEDE;
  62.     }
  63.     return FMRES_IGNORED;
  64. }
  65.  
  66. public msg_ClCorpse()
  67. {
  68.     new id = get_msg_arg_int(12);
  69.    
  70.     if(model_igraca[id][0])
  71.         set_msg_arg_string(1, model_igraca[id]);
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement