Tak, wiem, zapomniałem poprawić.
Kod php:
#include <amxmodx>
#include <engine>
#define PLUGIN "Max Payne Zoom"
#define AUTHOR "genesis"
#define VERSION "1.2"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","MPZ_eventDeath","a")
register_cvar("MPZ_velocity", "2000") // recommend setting around 6000 set sv_maxvelocity to 6000 as well
}
public plugin_precache()
{
precache_model("models/shell.mdl")
}
public MPZ_eventDeath()
{
new theKiller = read_data(1)
if(!theKiller || !read_data(3)) return PLUGIN_CONTINUE
new Float: Origin[3], Float: Velocity[3], Float: vAngle[3], Ent
entity_get_vector(theKiller, EV_VEC_origin , Origin)
entity_get_vector(theKiller, EV_VEC_v_angle, vAngle)
Ent = create_entity("info_target")
if(!is_valid_ent(Ent))
return PLUGIN_CONTINUE
entity_set_string(Ent, EV_SZ_classname, "MPZ_chaser")
entity_set_model(Ent, "models/shell.mdl")
new Float:MinBox[3] = {-1.0, -1.0, -1.0}
new Float:MaxBox[3] = {1.0, 1.0, 1.0}
entity_set_vector(Ent, EV_VEC_mins, MinBox)
entity_set_vector(Ent, EV_VEC_maxs, MaxBox)
entity_set_float(Ent, EV_FL_gravity, 0.01)
entity_set_origin(Ent, Origin)
entity_set_vector(Ent, EV_VEC_angles, vAngle)
entity_set_int(Ent, EV_INT_effects, 2)
entity_set_int(Ent, EV_INT_solid, 1)
entity_set_int(Ent, EV_INT_movetype, 10)
entity_set_edict(Ent, EV_ENT_owner, theKiller)
VelocityByAim(theKiller, get_cvar_num("MPZ_velocity"), Velocity)
entity_set_vector(Ent, EV_VEC_velocity ,Velocity)
attach_view(theKiller, Ent)
return PLUGIN_CONTINUE
}
public vexd_pfntouch(pToucher, pTouched)
{
new szClassName[32]
if ( pToucher > 0)
{
if(!is_valid_ent(pToucher))
return PLUGIN_CONTINUE
entity_get_string(pToucher, EV_SZ_classname, szClassName, 31)
}
if(equal(szClassName, "MPZ_chaser"))
{
new oid = entity_get_edict(pToucher, EV_ENT_owner)
attach_view(oid, oid)
remove_entity(pToucher)
}
return PLUGIN_CONTINUE
}