HLMOD.HU Forrás Megtekintés
- www.hlmod.hu#include <amxmodx>
#include <fakemeta>
#define PLUGIN "DoNotShootTheHostages"
#define VERSION "0.2"
#define AUTHOR "regalis"
new const hostageclass[] = "hostage_entity";
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_cvar(PLUGIN, VERSION, FCVAR_SPONLY|FCVAR_SERVER);
register_forward(FM_TraceLine,"fw_traceline",1);
register_forward(FM_TraceHull,"fw_tracehull",1);
}
public fw_traceline(Float:start[3], Float:end[3], noMonsters, id, trace)
{
if(!is_user_alive(id)) return FMRES_IGNORED;
static victim;
victim = get_tr(TR_pHit);
if(pev_valid(victim))
{
static classname[32];
pev(victim, pev_classname, classname, 31);
if(equal(classname, hostageclass)) set_tr(TR_flFraction, 1.0);
}
return FMRES_IGNORED;
}
public fw_tracehull(Float:v1[3], Float:v2[3], noMonsters, hull, id, ptr)
{
if(!is_user_alive(id)) return FMRES_IGNORED;
static victim;
victim = get_tr(TR_pHit);
if(pev_valid(victim))
{
static classname[32];
pev(victim, pev_classname, classname, 31);
if(equal(classname, hostageclass)) set_tr(TR_flFraction, 1.0);
}
return FMRES_IGNORED;
}