Пользователь
- Сообщения
- 3
- Реакции
- 0
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Есть два плагина, OnlyHS и NoScroll, можно ли как-то реализовать в них работу на определённых картах? Названия которых будут хранится по данному пути: cstrike/addons/amxmodx/configs/hsns.cfg
То бишь если в данном файле есть карта "de_dust2" : OnlyHS и NoScroll работает, и на оборот.
Исходники Only HS и NoScroll:
То бишь если в данном файле есть карта "de_dust2" : OnlyHS и NoScroll работает, и на оборот.
Исходники Only HS и NoScroll:
#include <amxmodx>
#include <fakemeta>
new last_stand[33],Float:duck_start_time[33],Float:last_origin[33][3]
public plugin_init() {
register_plugin("Anti DD Scroll", "1.0", "Empower")
register_forward(FM_CmdStart, "pfw_CmdStart", 1)
register_cvar("adds_version", "1.0", FCVAR_SERVER | FCVAR_SPONLY)
}
public pfw_CmdStart(id, pUC, seed)
{
new iButtons = get_uc(pUC, UC_Buttons)
// just ducked
if(iButtons & IN_DUCK)
{
if(last_stand[id])
{
pev(id,pev_origin,last_origin[id])
duck_start_time[id] = get_gametime()
last_stand[id] = false;
}
}
// just got up
else
{
if(!last_stand[id])
{
new Float:fGameTime = get_gametime()
// So low time, this is scroll for sure, block duck.
if((fGameTime-duck_start_time[id])<0.02)
{
engfunc(EngFunc_SetOrigin, id, last_origin[id])
set_pev(id, pev_bInDuck, false);
}
}
last_stand[id] = true;
}
}
#include <fakemeta>
new last_stand[33],Float:duck_start_time[33],Float:last_origin[33][3]
public plugin_init() {
register_plugin("Anti DD Scroll", "1.0", "Empower")
register_forward(FM_CmdStart, "pfw_CmdStart", 1)
register_cvar("adds_version", "1.0", FCVAR_SERVER | FCVAR_SPONLY)
}
public pfw_CmdStart(id, pUC, seed)
{
new iButtons = get_uc(pUC, UC_Buttons)
// just ducked
if(iButtons & IN_DUCK)
{
if(last_stand[id])
{
pev(id,pev_origin,last_origin[id])
duck_start_time[id] = get_gametime()
last_stand[id] = false;
}
}
// just got up
else
{
if(!last_stand[id])
{
new Float:fGameTime = get_gametime()
// So low time, this is scroll for sure, block duck.
if((fGameTime-duck_start_time[id])<0.02)
{
engfunc(EngFunc_SetOrigin, id, last_origin[id])
set_pev(id, pev_bInDuck, false);
}
}
last_stand[id] = true;
}
}
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "HeadShot Only"
#define VERSION "1.2a"
#define AUTHOR "Dores"
#define USAGE " 1 (on) or 0 (off)"
new HamHook:fw_TraceAttack;
new g_iMaxPlayers;
new p_knife, p_team[3];
_Un_RegisterHamForwards(on = 0)
{
on ? EnableHamForward(fw_TraceAttack) : DisableHamForward(fw_TraceAttack);
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
fw_TraceAttack = RegisterHam(Ham_TraceAttack, "player", "Forward_TraceAttack");
register_clcmd("amx_hsonly", "Cmd_ToggleHS", ADMIN_RCON, USAGE);
g_iMaxPlayers = get_maxplayers();
p_knife = register_cvar("hsonly_knife", "0");
p_team[1] = register_cvar("hsonly_t", "1");
p_team[2] = register_cvar("hsonly_ct", "1");
}
public Forward_TraceAttack(id, attacker, Float:dmg, Float:dir[3], tr, dmgbit)
{
if(id != attacker && get_tr2(tr, TR_iHitgroup) != HIT_HEAD && get_pcvar_num(p_team[get_user_team(id)]))
{
if(1 <= attacker <= g_iMaxPlayers)
{
if(!get_pcvar_num(p_knife) && get_user_weapon(attacker) == CSW_KNIFE)
{
return HAM_IGNORED;
}
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED;
}
public Cmd_ToggleHS(id)
{
if(read_argc() < 2)
{
console_print(id, USAGE);
return PLUGIN_HANDLED;
}
static arg[2] ; read_argv(1, arg, charsmax(arg));
static val ; val = str_to_num(arg);
_Un_RegisterHamForwards(val);
client_print(0, print_chat, "[AMXX] HeadShot Only mode is %s!", val ? "ON" : "OFF");
return PLUGIN_HANDLED;
}
public client_putinserver(id)
{
set_hudmessage(42, 255, 42, 0.11, 0.22, 0, 6.0, 12.0);
show_hudmessage(id, "This server is using the HS Only plugin^nVersion %s", VERSION);
}
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "HeadShot Only"
#define VERSION "1.2a"
#define AUTHOR "Dores"
#define USAGE " 1 (on) or 0 (off)"
new HamHook:fw_TraceAttack;
new g_iMaxPlayers;
new p_knife, p_team[3];
_Un_RegisterHamForwards(on = 0)
{
on ? EnableHamForward(fw_TraceAttack) : DisableHamForward(fw_TraceAttack);
}
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
fw_TraceAttack = RegisterHam(Ham_TraceAttack, "player", "Forward_TraceAttack");
register_clcmd("amx_hsonly", "Cmd_ToggleHS", ADMIN_RCON, USAGE);
g_iMaxPlayers = get_maxplayers();
p_knife = register_cvar("hsonly_knife", "0");
p_team[1] = register_cvar("hsonly_t", "1");
p_team[2] = register_cvar("hsonly_ct", "1");
}
public Forward_TraceAttack(id, attacker, Float:dmg, Float:dir[3], tr, dmgbit)
{
if(id != attacker && get_tr2(tr, TR_iHitgroup) != HIT_HEAD && get_pcvar_num(p_team[get_user_team(id)]))
{
if(1 <= attacker <= g_iMaxPlayers)
{
if(!get_pcvar_num(p_knife) && get_user_weapon(attacker) == CSW_KNIFE)
{
return HAM_IGNORED;
}
return HAM_SUPERCEDE;
}
}
return HAM_IGNORED;
}
public Cmd_ToggleHS(id)
{
if(read_argc() < 2)
{
console_print(id, USAGE);
return PLUGIN_HANDLED;
}
static arg[2] ; read_argv(1, arg, charsmax(arg));
static val ; val = str_to_num(arg);
_Un_RegisterHamForwards(val);
client_print(0, print_chat, "[AMXX] HeadShot Only mode is %s!", val ? "ON" : "OFF");
return PLUGIN_HANDLED;
}
public client_putinserver(id)
{
set_hudmessage(42, 255, 42, 0.11, 0.22, 0, 6.0, 12.0);
show_hudmessage(id, "This server is using the HS Only plugin^nVersion %s", VERSION);
}