Guest User

Untitled

a guest
Jun 24th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. #include <amxmodx>
  2. #include <amxmisc>
  3. #include <cstrike>
  4. #include <csdm>
  5.  
  6. new bool:g_StopRespawn[33]
  7. new g_PrevTeam[33] = -1
  8.  
  9. public csdm_Init(const version[])
  10. {
  11. if (version[0] == 0)
  12. {
  13. set_fail_state("CSDM failed to load.")
  14. return
  15. }
  16. }
  17.  
  18. public plugin_init()
  19. {
  20. register_plugin("DM Spec", "1.0", "cxas")
  21. register_clcmd("amx_spec", "spec_start", ADMIN_LEVEL_G, "Stop/Start Spec")
  22. }
  23.  
  24. public csdm_PostDeath(killer, victim, headshot, const weapon[])
  25. {
  26. if(g_StopRespawn[victim])
  27. return PLUGIN_HANDLED
  28.  
  29. return PLUGIN_CONTINUE
  30. }
  31.  
  32. public spec_start(id,lvl,cid)
  33. {
  34. if(!cmd_access(id,lvl,cid,1))
  35. return PLUGIN_HANDLED
  36.  
  37. new teamid = get_user_team(id)
  38. if(teamid == _TEAM_T || teamid == _TEAM_CT)
  39. {
  40. if(g_StopRespawn[id])
  41. {
  42. g_StopRespawn[id] = false
  43. csdm_respawn(id)
  44.  
  45. teamid = g_PrevTeam[id]
  46. if(teamid != -1)
  47. {
  48. cs_set_user_team(id, teamid == _TEAM_T ? CS_TEAM_T : CS_TEAM_CT)
  49. g_PrevTeam[id] = -1
  50. }
  51.  
  52. console_print(id, "Sada mozes preci u spectators!")
  53. return PLUGIN_HANDLED
  54. }
  55. else
  56. {
  57. g_PrevTeam[id] = teamid
  58.  
  59. g_StopRespawn[id] = true
  60. user_silentkill(id)
  61.  
  62. console_print(id, "Sada vise ne mozes preci u spectators!")
  63. return PLUGIN_HANDLED
  64. }
  65. }
  66. return PLUGIN_CONTINUE
  67. }
  68.  
  69. public client_connect(id)
  70. {
  71. g_StopRespawn[id] = false
  72. g_PrevTeam[id] = -1
  73. }
Add Comment
Please, Sign In to add comment