Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #define MAX_PLAYERS 32
- #define AUTHOR "CML & aSior & Pawel"
- new bool:g_hs_mode
- new bool:g_RestartAttempt[MAX_PLAYERS+1]
- new g_fwid
- public plugin_init()
- {
- register_plugin("Only HS MOD", "2.0", AUTHOR)
- register_event("TextMsg", "eRestartAttempt", "a", "2=#Game_will_restart_in")
- register_concmd("amx_hs_mode", "switchCmd", ADMIN_IMMUNITY, "- <0|1> : Only HS MOD = Wylaczony|Wlaczony")
- register_clcmd("clcmd_fullupdate", "fullupdateCmd")
- register_forward(FM_TraceLine, "forward_traceline", 1);
- }
- public fullupdateCmd()
- {
- return PLUGIN_HANDLED_MAIN
- }
- public eRestartAttempt()
- {
- new players[MAX_PLAYERS], num
- get_players(players, num, "a")
- for (new i; i < num; ++i)
- g_RestartAttempt[players[i]] = true
- }
- public switchCmd(id, level, cid)
- {
- if(!cmd_access(id, level, cid, 2))
- return PLUGIN_HANDLED
- new arg[2]
- read_argv(1, arg, 1)
- new temp = str_to_num(arg)
- switch(temp)
- {
- case 0:
- {
- if(!g_hs_mode)
- {
- unregister_forward(FM_TraceLine, g_fwid, 1)
- g_hs_mode = false
- }
- }
- case 1:
- {
- if(g_hs_mode)
- {
- g_fwid = register_forward(FM_TraceLine, "forward_traceline", 1)
- g_hs_mode = true
- }
- }
- }
- return PLUGIN_HANDLED
- }
- public forward_traceline(Float:v1[3], Float:v2[3], noMonsters, pentToSkip)
- {
- if(!is_user_alive(pentToSkip))
- return FMRES_IGNORED
- static entity2 ; entity2 = get_tr(TR_pHit)
- if(0 > entity2 > 32 || !is_user_alive(entity2))
- return FMRES_IGNORED
- if(pentToSkip == entity2)
- return FMRES_IGNORED
- if(get_tr(TR_iHitgroup) != 1)
- {
- set_tr(TR_flFraction,1.0)
- return FMRES_SUPERCEDE
- }
- return FMRES_IGNORED
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement