Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <cstrike>
- #include <csdm>
- new bool:g_StopRespawn[33]
- new g_PrevTeam[33] = -1
- public csdm_Init(const version[])
- {
- if (version[0] == 0)
- {
- set_fail_state("CSDM failed to load.")
- return
- }
- }
- public plugin_init()
- {
- register_plugin("DM Spec", "1.0", "cxas")
- register_clcmd("amx_spec", "spec_start", ADMIN_LEVEL_G, "Stop/Start Spec")
- }
- public csdm_PostDeath(killer, victim, headshot, const weapon[])
- {
- if(g_StopRespawn[victim])
- return PLUGIN_HANDLED
- return PLUGIN_CONTINUE
- }
- public spec_start(id,lvl,cid)
- {
- if(!cmd_access(id,lvl,cid,1))
- return PLUGIN_HANDLED
- new teamid = get_user_team(id)
- if(teamid == _TEAM_T || teamid == _TEAM_CT)
- {
- if(g_StopRespawn[id])
- {
- g_StopRespawn[id] = false
- csdm_respawn(id)
- teamid = g_PrevTeam[id]
- if(teamid != -1)
- {
- cs_set_user_team(id, teamid == _TEAM_T ? CS_TEAM_T : CS_TEAM_CT)
- g_PrevTeam[id] = -1
- }
- console_print(id, "Sada mozes preci u spectators!")
- return PLUGIN_HANDLED
- }
- else
- {
- g_PrevTeam[id] = teamid
- g_StopRespawn[id] = true
- user_silentkill(id)
- console_print(id, "Sada vise ne mozes preci u spectators!")
- return PLUGIN_HANDLED
- }
- }
- return PLUGIN_CONTINUE
- }
- public client_connect(id)
- {
- g_StopRespawn[id] = false
- g_PrevTeam[id] = -1
- }
Add Comment
Please, Sign In to add comment