|
Poprawienie pluginu MPZ.amxx
bigmuta - 01.06.2008 18:35
Poprawienie pluginu MPZ.amxx
Chcialem ogromnie prosic aby Ktos(Seba lub makel9) zedytowal plugin MPZ tak aby linia toru kuli pokazywala sie temu co zginol. Probowalem cos sam poustawiac, ale cos nie wychodzi xD Kod po przerobce -->
Kod:
#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>
#define PLUGIN "Max Payne Zoom"
#define AUTHOR "genesis"
#define VERSION "1.2"
#define CNAME "MPZ"
new lastweap[33]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_cvar(CNAME, VERSION, FCVAR_SERVER)
register_forward(FM_PlayerPreThink, "forward_playerprethink")
register_event("DeathMsg","MPZ_eventDeath","a")
register_event("CurWeapon","handle_gun","be","1=1")
register_cvar("MPZ_velocity", "2000") // recommend setting around 6000 set sv_maxvelocity to 6000 as well
register_cvar("MPZ_active", "1") // set to zero = no zooming at all(supercedes all others)
register_cvar("MPZ_zoomOnHS", "1") // set to one = only zoom on hs's
register_cvar("MPZ_awp", "1")
register_cvar("MPZ_scout", "1")
register_cvar("MPZ_m4", "1")
register_cvar("MPZ_ak", "1")
register_cvar("MPZ_usp", "1")
register_cvar("MPZ_glock", "1")
register_cvar("MPZ_mp5", "1")
register_cvar("MPZ_galil", "1")
register_cvar("MPZ_famas", "1")
register_cvar("MPZ_dgl", "1")
}
public plugin_precache()
{
precache_model("models/shell.mdl")
}
public MPZ_eventDeath()
{
new id = read_data(1)
new theKiller = read_data(1)
new headshot = read_data(3)
if(!theKiller) return PLUGIN_CONTINUE
if(lastweap[theKiller] == CSW_AWP && get_cvar_num("MPZ_awp"))
{
}
else if(lastweap[theKiller] == CSW_SCOUT && get_cvar_num("MPZ_scout"))
{
}
else if(lastweap[theKiller] == CSW_AK47 && get_cvar_num("MPZ_ak"))
{
}
else if(lastweap[theKiller] == CSW_M4A1 && get_cvar_num("MPZ_m4"))
{
}
else if(lastweap[theKiller] == CSW_USP && get_cvar_num("MPZ_usp"))
{
}
else if(lastweap[theKiller] == CSW_GLOCK18 && get_cvar_num("MPZ_glock"))
{
}
else if(lastweap[theKiller] == CSW_MP5NAVY && get_cvar_num("MPZ_mp5"))
{
}
else if(lastweap[theKiller] == CSW_GALIL && get_cvar_num("MPZ_galil"))
{
}
else if(lastweap[theKiller] == CSW_DEAGLE && get_cvar_num("MPZ_dgl"))
{
}
else if(lastweap[theKiller] == CSW_FAMAS && get_cvar_num("MPZ_famas"))
{
}
else
{
return PLUGIN_CONTINUE
}
if(!get_cvar_num("MPZ_active")) return PLUGIN_CONTINUE
if(get_cvar_num("MPZ_zoomOnHS"))
{
if(!headshot) 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 FMRES_IGNORED
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
}
public client_disconnect(id)
{
lastweap[id] = 0
}
public handle_gun(id)
{
new clip, ammo
new weap = get_user_weapon(id,clip,ammo)
if(lastweap[id] == weap)
return PLUGIN_CONTINUE
else
lastweap[id] = weap
return PLUGIN_CONTINUE
}
!~* eMo SeBu$ *~! - 01.06.2008 18:39
Cytat:
linia toru kuli pokazywala sie temu co zginol.
a teraz jak jest ?
bigmuta - 01.06.2008 18:41
jak zabije z HS to mi sie pokazuje ten zoom, a nie jak ja zostane zabity i idzie to za szybko, nie zawsze dziala
!~* eMo SeBu$ *~! - 01.06.2008 21:01
Cytat:
jak zabije z HS to mi sie pokazuje ten zoom, a nie jak ja zostane zabity i idzie to za szybko, nie zawsze dziala
Nie czaje. Napisz co ten plugin docelowo ma robić.
bigmuta - 03.06.2008 14:07
chodzi mi o to ze jak np Ty mnie zabijesz to pokazuje mi sie linia toru kuli a w podstawowej wersju pluga pokazywala sie ziomkowi ktory zabil
zanotowane.pldoc.pisz.plpdf.pisz.plqup.pev.pl
|