I´m on it. I´ve had to get rid of the GibMonster(); part because each time the monster attacks me it blows into pieces!!, gorish.... XD
Aniway, your method doesen´t work for me, suerely my fault.
Here´s the code I used:
[quote][blue]void CTrolley :: GiveAmmo ( void )
{
Vector vecGunPos;
Vector vecGunAngles;
CBaseEntity *pGun;
GetAttachment( 0, vecGunPos, vecGunAngles );
{
pGun = DropItem( "ammo", vecGunPos, vecGunAngles );
}
if ( pGun )
{
pGun->pev->velocity = Vector (RANDOM_FLOAT(-100,100), RANDOM_FLOAT(-100,100), RANDOM_FLOAT(200,300));
pGun->pev->avelocity = Vector ( 0, RANDOM_FLOAT( 200, 400 ), 0 );
}
}[/blue][/quote]
And I put the GiveAmmo() function inside the Attac part
[quote][blue]//=========================================================
// HandleAnimEvent - catches the monster-specific messages
// that occur when tagged animation frames are played.
//=========================================================
void CTrolley :: HandleAnimEvent( MonsterEvent_t *pEvent )
{
switch( pEvent->event )
{
case TROLL_AE_ATTACK_RIGHT:
{
//ALERT( at_console, "Drone slashes with right claw!!\n" );
CBaseEntity *pHurt = CheckTraceHullAttack( 0, gSkillData.zombieDmgOneSlash, DMG_SLASH );
if ( pHurt )
{
EMIT_SOUND_DYN ( ENT(pev), CHAN_WEAPON, pAttackHitSounds[ RANDOM_LONG(0,ARRAYSIZE(pAttackHitSounds)-1) ], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG(-5,5) );
}
else // Play a random attack miss sound
EMIT_SOUND_DYN ( ENT(pev), CHAN_WEAPON, pAttackMissSounds[ RANDOM_LONG(0,ARRAYSIZE(pAttackMissSounds)-1) ], 1.0, ATTN_NORM, 0, 100 + RANDOM_LONG(-5,5) );
if (RANDOM_LONG(0,1))
AttackSounds();
pev->nextthink = gpGlobals->time + 10;//¿chuta? Esto es para que tras atacar no vuelva a recargar en diez segunos ¡¡¡¡¡¡¡SIIIIII!!!!! ¡¡¡¡¡¡Chutaaaarrrrrrl el 7-7-2015 San-fer-mín!!!!!
GiveAmmo();// A ver si chuta....
}
break;
default:
CBaseMonster::HandleAnimEvent( pEvent );
break;
}
}[/blue][/quote]
Of course I´ve declared all functions adn put the right attachment to the Trolley monster. But... no luck.
Did I something wrong? :/