Member
|
07-28-2013
, 19:49
Re: Ayuda con FM_AddToFullPack
|
#11
|
Quote:
Originally Posted by r0ma
Lo mejor que pude hacer es esto para mi es una negrada:
PHP Code:
#include < amxmodx >
#include < hamsandwich >
#include < fakemeta >
#include < xs >
#define PLUGIN "Test"
#define VERSION "1.0.0"
#define AUTHOR "r0ma'"
new const model[ ] = "models/box.mdl";
new g_ent;
public plugin_precache( ) {
precache_model( model );
}
public plugin_init( ) {
register_plugin( PLUGIN, VERSION, AUTHOR );
register_forward( FM_AddToFullPack, "fw_AddToFullPack" );
register_forward( FM_AddToFullPack, "fw_AddToFullPack", 1 );
RegisterHam( Ham_Touch, "info_target", "fw_Touch" );
//register_forward( FM_Touch, "fw_Touch" );
register_clcmd( "test", "clcmd_test" );
g_ent = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString, "info_target" ) );
set_pev( g_ent, pev_classname, "test_ent" );
set_pev( g_ent, pev_solid, SOLID_NOT );
engfunc( EngFunc_SetModel, g_ent, model );
engfunc( EngFunc_SetSize, g_ent, Float:{ -16.7, -16.7, 0.0 }, Float:{ 16.7, 16.7, 33.4 } );
}
public clcmd_test( id ) {
new Float:Origin[ 3 ];
pev( id, pev_origin, Origin );
Origin[ 1 ] += 64.0;
engfunc( EngFunc_SetOrigin, g_ent, Origin );
return PLUGIN_HANDLED;
}
public fw_AddToFullPack( es, e, ent, host, hostflag, player, pSet ) {
if( ent == g_ent && is_user_alive( host ) && get_user_team( host ) == 1 ) {
set_es( es, ES_Solid, SOLID_BBOX );
ExecuteHamB( Ham_Touch, ent, host );
}
}
public fw_Touch( ent, id ) {
static Float:Origin[ 3 ], Float:Origin2[ 3 ];
pev( ent, pev_origin, Origin );
pev( id, pev_origin, Origin2 );
if( ent == g_ent && get_distance_f( Origin, Origin2 ) <= 25.0 ) {
// Esto lo saque del sma de una bubble
new Float:Origin[ 3 ];
new Float:Center[ 3 ];
new Float:Direction[ 3 ];
pev( id, pev_origin, Origin );
pev( ent, pev_origin, Center );
xs_vec_sub( Origin, Center, Direction );
xs_vec_mul_scalar( Direction, 2.5, Direction );
set_pev( id, pev_velocity, Direction );
}
}
Es solo en ejemplo de una entidad "solida" para los TT y no solida para los CT.
|
Disculpa , parercera estúpida mi pregunta, pero nunca etendi esto
PHP Code:
engfunc( EngFunc_SetSize, g_ent, Float:{ -16.7, -16.7, 0.0 }, Float:{ 16.7, 16.7, 33.4 } );
Como puedo saber cuanto es el min y max del model? o esos valores lo tiras al azar? jajaja
Last edited by UnrealT; 07-28-2013 at 19:52.
|
|