Thread: Monster Mod
View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-24-2009 , 05:39   Re: Monster Mod
Reply With Quote #24

Forget to say you need to precache the zombie ressources in plugin_precache() since the zombie is not created at map start. When you will have your plugin which spawn the monster_ entities at map start ( plugin_precache ) ; precaching the ressources will be not needed.

But since it's for test, precache them. Here from the HLSDK to show us the ressources used :

Code:
const char *CZombie::pAttackHitSounds[] = {     "zombie/claw_strike1.wav",     "zombie/claw_strike2.wav",     "zombie/claw_strike3.wav", }; const char *CZombie::pAttackMissSounds[] = {     "zombie/claw_miss1.wav",     "zombie/claw_miss2.wav", }; const char *CZombie::pAttackSounds[] = {     "zombie/zo_attack1.wav",     "zombie/zo_attack2.wav", }; const char *CZombie::pIdleSounds[] = {     "zombie/zo_idle1.wav",     "zombie/zo_idle2.wav",     "zombie/zo_idle3.wav",     "zombie/zo_idle4.wav", }; const char *CZombie::pAlertSounds[] = {     "zombie/zo_alert10.wav",     "zombie/zo_alert20.wav",     "zombie/zo_alert30.wav", }; const char *CZombie::pPainSounds[] = {     "zombie/zo_pain1.wav",     "zombie/zo_pain2.wav", };

Code:
void CZombie :: Precache() {     int i;     PRECACHE_MODEL("models/zombie.mdl");     for ( i = 0; i < ARRAYSIZE( pAttackHitSounds ); i++ )         PRECACHE_SOUND((char *)pAttackHitSounds[i]);     for ( i = 0; i < ARRAYSIZE( pAttackMissSounds ); i++ )         PRECACHE_SOUND((char *)pAttackMissSounds[i]);     for ( i = 0; i < ARRAYSIZE( pAttackSounds ); i++ )         PRECACHE_SOUND((char *)pAttackSounds[i]);     for ( i = 0; i < ARRAYSIZE( pIdleSounds ); i++ )         PRECACHE_SOUND((char *)pIdleSounds[i]);     for ( i = 0; i < ARRAYSIZE( pAlertSounds ); i++ )         PRECACHE_SOUND((char *)pAlertSounds[i]);     for ( i = 0; i < ARRAYSIZE( pPainSounds ); i++ )         PRECACHE_SOUND((char *)pPainSounds[i]); }

Adapt for amxx, it will be easy.
__________________

Last edited by Arkshine; 11-24-2009 at 05:43.
Arkshine is offline