Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <hamsandwich>
  5. #include <fun>
  6.  
  7. #define PLUGIN "Spec"
  8. #define AUTHOR "kramesa"
  9. #define VERSION "v1.0"
  10.  
  11. new bool:TerroristTeam[33];
  12.  
  13. public plugin_init()
  14. {
  15. register_plugin(PLUGIN, VERSION, AUTHOR);
  16.  
  17. register_clcmd("/spec", "Spec");
  18. register_clcmd("/back", "Back");
  19.  
  20. register_clcmd("say /spec", "Spec");
  21. register_clcmd("say /back", "Back");
  22. }
  23.  
  24. public Spec(id)
  25. {
  26. if(get_user_flags(id) & ADMIN_KICK)
  27. {
  28. if(cs_get_user_team(id) == CS_TEAM_T)
  29. {
  30. TerroristTeam[id] = true;
  31. }
  32. else
  33. {
  34. TerroristTeam[id] = false;
  35. }
  36.  
  37. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  38. {
  39. client_print(id, print_chat, "You already in SPEC.");
  40. return PLUGIN_HANDLED;
  41. }
  42. else
  43. {
  44. cs_set_user_team(id, CS_TEAM_SPECTATOR)
  45. user_kill(id, 1);
  46. client_print(id, print_chat, "You going to SPEC.");
  47. return PLUGIN_HANDLED;
  48. }
  49. }
  50. return PLUGIN_HANDLED;
  51. }
  52.  
  53. public Back(id)
  54. {
  55. if(get_user_flags(id) & ADMIN_KICK)
  56. {
  57. if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
  58. {
  59. if(cs_get_user_team(id) == CS_TEAM_CT && CS_TEAM_T)
  60. {
  61. client_print(id, print_chat, "You already in CT/T.");
  62. return PLUGIN_HANDLED;
  63. }
  64.  
  65. if(TerroristTeam[id] == true)
  66. {
  67. cs_set_user_team(id, CS_TEAM_T);
  68. client_print(id, print_chat, "You going to T.");
  69. return PLUGIN_HANDLED;
  70. }
  71.  
  72. if(TerroristTeam[id] == false)
  73. {
  74. cs_set_user_team(id, CS_TEAM_CT);
  75. client_print(id, print_chat, "You going to CT.");
  76. return PLUGIN_HANDLED;
  77. }
  78. }
  79. }
  80. return PLUGIN_HANDLED;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement