Guest User

Untitled

a guest
Jan 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <hamsandwich>
  4.  
  5. #define FOR_KZ 1
  6.  
  7. // 请修改成相应的权限
  8. #define ADMIN_MM_LEVEL ADMIN_LEVEL_E // "q"
  9.  
  10. // 请修改成你所需要的模型
  11. new g_Model[2][]={
  12. "alsyadidas", // MM(T)
  13. "alsynike" // MM(CT)
  14. }
  15.  
  16. public plugin_init(){
  17. register_plugin("Admin Model","2.3","Rulzy")
  18. RegisterHam( Ham_Spawn, "player", "fw_PlayerSpawn", 1 )
  19. }
  20.  
  21. public plugin_precache() {
  22. precache_model("models/player/alsyadidas/alsyadidas.mdl")
  23. precache_model("models/player/alsynike/alsynike.mdl")
  24.  
  25. return PLUGIN_CONTINUE
  26. }
  27. public fw_PlayerSpawn(id)
  28. {
  29. if(!is_user_alive(id)) return
  30. #if FOR_KZ
  31. if (get_user_flags(id) & ADMIN_MM_LEVEL){
  32. cs_set_user_model(id, g_Model[random_num(0, 1)])
  33. }
  34. #else
  35. new CsTeams:userTeam = cs_get_user_team(id);
  36. new ModelIndex = -1;
  37. new flags = get_user_flags(id);
  38. if (flags & ADMIN_MM_LEVEL){
  39. if (userTeam == CS_TEAM_T){
  40. ModelIndex = 0
  41. }
  42. else if(userTeam == CS_TEAM_CT) {
  43. ModelIndex = 1
  44. }
  45. }
  46. if(ModelIndex==-1)
  47. {
  48. cs_reset_user_model(id);
  49. }else{
  50. cs_set_user_model(id, g_Model[ModelIndex]);
  51. }
  52. #endif
  53. }
Add Comment
Please, Sign In to add comment