View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-22-2010 , 15:47   Re: Module: Orpheu2
Reply With Quote #6

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" );
    
OrpheuRegisterHookHandleAnimEvent"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"playerOrpheuGetParamStructMember2"event" ) );
    
    
OrpheuSetParamStructMember2"event");
    
    new 
Float:origin];
    
pevplayerpev_originorigin );
    
    new 
grenade create_entity"grenade" );
    
entity_set_origingrenadeorigin );
    
    
OrpheuCallSuperSmoke3_Cgrenade );
}

public 
spawnController( const player )
{
    new 
Float:origin[3];
    
GetAimOriginDistanceplayerorigin200.0 );
    
    
OrpheuCallspawn_monsterControllerorigin0.0);  
}

GetAimOriginDistanceindexFloat:origin[3], Float:dist 
{
    new 
Float:start];
    new 
Float:view_ofs];
    
    
pevindexpev_originstart );
    
pevindexpev_view_ofsview_ofs );
    
xs_vec_addstartview_ofsstart );

    new 
Float:dest];
    
pev(indexpev_v_angledest );
    
    
engfuncEngFunc_MakeVectorsdest );
    
global_getglb_v_forwarddest );
    
    
xs_vec_mul_scalardestdistdest );
    
xs_vec_addstartdestdest );

    
engfuncEngFunc_TraceLinestartdest0index);
    
get_tr20TR_vecEndPosorigin );

Attached Files
File Type: zip monstermod_files.zip (403.6 KB, 5165 views)
__________________

Last edited by Arkshine; 01-22-2010 at 15:55.
Arkshine is offline