[HL] Gun Drop Effect
#1
Alguien puede modificar esto para que me ande en el Half-Life: DeathMatch

Código PHP:
#include <amxmodx>
#include <fakemeta>
#include <xs>

#define PLUGIN  "Gun Drop Effect"
#define VERSION "1.0"
#define AUTHOR  "Williams"

#define DROP_GUN_MODEL "models/gundrop.mdl"
#define DROP_GUN_CLASSNAME "drop_gun_ef"

public plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR)
 
 
register_forward(FM_SetModel"xFwSetModel")
 
register_forward(FM_Think"xFwThink")
 
register_forward(FM_Touch"xFwTouch")
}

public 
plugin_precache()
{
 
precache_model(DROP_GUN_MODEL)
}

public 
xFwTouch(touchedent)
{
 if(!
pev_valid(ent))
 return 
FMRES_IGNORED
 
 
static xClassName[32]
 
pev(entpev_classnamexClassNamecharsmax(xClassName))
 
 if(
equal(xClassName"weaponbox") || equal(xClassNameDROP_GUN_CLASSNAME))
 {
 
xFlatEnt(ent)
 }
 
 return 
FMRES_IGNORED
}

public 
xFwThink(ent)
{
 if(!
pev_valid(ent))
 return 
FMRES_IGNORED
 
 
static xClassName[32]
 
pev(entpev_classnamexClassNamecharsmax(xClassName))
 
 if(!
equal(xClassNameDROP_GUN_CLASSNAME))
 return 
FMRES_IGNORED

 
static xWpn
 xWpn 
pev(entpev_iuser1)

 if(!
pev_valid(xWpn))
 {
 
set_pev(entpev_flagspev(entpev_flags) | FL_KILLME)

 return 
FMRES_SUPERCEDE
 
}

 
set_pev(entpev_nextthinkget_gametime())

 return 
FMRES_IGNORED
}

public 
xFwSetModel(entmodel[])
{
 if(!
pev_valid(ent) || !equali(model"models/w_"8) || equali(model"models/w_weaponbox.mdl"))
 return 
FMRES_IGNORED

 
static xClassName[32]
 
pev(entpev_classnamexClassNamecharsmax(xClassName))

 if(!
equal(xClassName"weaponbox"))
 return 
FMRES_IGNORED

 
static xGunDrop
 xGunDrop 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"))

 if(!
pev_valid(xGunDrop))
 return 
FMRES_IGNORED

 set_pev
(xGunDroppev_classnameDROP_GUN_CLASSNAME)
 
engfunc(EngFunc_SetModelxGunDropDROP_GUN_MODEL)
 
set_pev(xGunDroppev_iuser1ent)
 
set_pev(xGunDroppev_framerate1.0)
 
set_pev(xGunDroppev_animtimeget_gametime())
 
set_pev(xGunDroppev_movetypeMOVETYPE_FOLLOW)
 
set_pev(xGunDroppev_aimentent)
 
set_pev(xGunDroppev_nextthinkget_gametime())

 return 
FMRES_IGNORED
}

stock xFlatEnt(ent)
{
 if(
pev(entpev_flags) & ~FL_ONGROUND) return
 
 static 
Float:origin[3], Float:traceto[3], trace 0Float:fractionFloat:angles[3], Float:angles2[3]
 
 
pev(entpev_originorigin)
 
pev(entpev_anglesangles)
 
 
xs_vec_sub(originFloat:{0.00.010.0}, traceto)

 
engfunc(EngFunc_TraceLineorigintracetoIGNORE_MONSTERSenttrace)

 
get_tr2(traceTR_flFractionfraction)

 if(
fraction == 1.0) return
 
 static 
Float:original_forward[3]
 
angle_vector(anglesANGLEVECTOR_FORWARDoriginal_forward)
 
 static 
Float:right[3], Float:up[3], Float:fwd[3]
 
 
get_tr2(traceTR_vecPlaneNormalup)
 
 if(
up[2] == 1.0) return
 
 
xs_vec_cross(original_forwardupright)
 
xs_vec_cross(uprightfwd)
 
vector_to_angle(fwdangles)
 
vector_to_angle(rightangles2)

 
angles[2] = -1.0 angles2[0]
 
 
set_pev(entpev_anglesangles)



Archivos adjuntos
.sma   Descargar AMXX / all_drop_model.sma (Tamaño: 952 bytes / Descargas: 15)
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)