This file includes a specially compiled MonsterMod for windows and linux and it's recommend to use if you want to use orpheu with MonsterMod.
Here a basic example of spawning a CMController, making it always being powering up, and having smoke.
Just to show us another example.
Use the command "spawnController" in game.
PHP Code:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <xs>
#include <orpheu>
enum _:Monster
{
Grunt,
Apache,
Barney,
BigMomma,
Bullsquid,
Controller,
HAssassin,
HeadCrab,
HGrunt,
Houndeye,
ISlave,
Scientist,
SqueakGrenade,
Zombie
};
new OrpheuFunction:spawn_monster;
new OrpheuFunction:Smoke3_C;
public plugin_precache()
{
new OrpheuFunction:HandleAnimEvent = OrpheuGetFunction( "HandleAnimEvent", "CMController" );
OrpheuRegisterHook( HandleAnimEvent, "OnHandleAnimEvent" );
spawn_monster = OrpheuGetFunction( "spawn_monster" );
Smoke3_C = OrpheuGetFunction( "Smoke3_C", "CGrenade" );
register_clcmd( "spawnController", "spawnController" );
}
public plugin_init ()
{
register_plugin( "Orpheu Example", "1.0.0", "Orpheu" );
}
public OnHandleAnimEvent ( const player, const event )
{
server_print( "Controller %d - Anim Event %d", player, OrpheuGetParamStructMember( 2, "event" ) );
OrpheuSetParamStructMember( 2, "event", 4 );
new Float:origin[ 3 ];
pev( player, pev_origin, origin );
new grenade = create_entity( "grenade" );
entity_set_origin( grenade, origin );
OrpheuCallSuper( Smoke3_C, grenade );
}
public spawnController( const player )
{
new Float:origin[3];
GetAimOriginDistance( player, origin, 200.0 );
OrpheuCall( spawn_monster, Controller, origin, 0.0, 0 );
}
GetAimOriginDistance( index, Float:origin[3], Float:dist )
{
new Float:start[ 3 ];
new Float:view_ofs[ 3 ];
pev( index, pev_origin, start );
pev( index, pev_view_ofs, view_ofs );
xs_vec_add( start, view_ofs, start );
new Float:dest[ 3 ];
pev(index, pev_v_angle, dest );
engfunc( EngFunc_MakeVectors, dest );
global_get( glb_v_forward, dest );
xs_vec_mul_scalar( dest, dist, dest );
xs_vec_add( start, dest, dest );
engfunc( EngFunc_TraceLine, start, dest, 0, index, 0 );
get_tr2( 0, TR_vecEndPos, origin );
}