Raised This Month: $12 Target: $400
 3% 

Monster Mod


Post New Thread Reply   
 
Thread Tools Display Modes
solano
Member
Join Date: Nov 2009
Old 11-24-2009 , 05:25   Re: Monster Mod
Reply With Quote #21

what do i need to include for
xs_vec_mul_scalar
solano is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-24-2009 , 05:29   Re: Monster Mod
Reply With Quote #22

<xs>
__________________
Arkshine is offline
solano
Member
Join Date: Nov 2009
Old 11-24-2009 , 05:35   Re: Monster Mod
Reply With Quote #23

Code:
 public plugin_precache()
{
    precache_model("models/zombie.mdl") 
    precache_sound("sounds/zombie/claw_strike1.wav")
    precache_sound("sounds/zombie/claw_strike2.wav")
    precache_sound("sounds/zombie/claw_strike3.wav")
    return PLUGIN_CONTINUE
server fatal error:
Host_Error: PF_Precache_Sound_l: 'zombie/classtrike1.wav' Precache can only be done in spawn function
but if i move the before
entid = create_entity( "monster_zombie" );
set_pev( entid, pev_origin, Origin );
DispatchSpawn( entid );
return PLUGIN_HANDLED
then when i type amx_monster in the console it says unknown function

Last edited by solano; 11-24-2009 at 05:40.
solano is offline
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
solano
Member
Join Date: Nov 2009
Old 11-24-2009 , 14:24   Re: Monster Mod
Reply With Quote #25

Quote:
Originally Posted by Arkshine View Post
Again, don't use a random value.

You should specify to test your origin as reference + some units forward. It will spawn a zombie where you aim 150 units forward you.

Code:
new Float:Angles [ 3 ];
new Float:Origin [ 3 ];
new Float:Forward[ 3 ];

pev( Player, pev_origin, Origin );
pev( Player, pev_v_angle, Angles );

angle_vector( Angles, ANGLEVECTOR_FORWARD, Forward );

xs_vec_mul_scalar( Forward, 150.0, Angles );
xs_vec_add( Origin, Forward, Origin );

new Zombie = create_entity( "monster_zombie" );
set_pev( Zombie, pev_origin, Origin );
DispatchSpawn( Zombie );

it didnt work
and i tried
Code:
new origin[3]
get_user_origin(id,origin)
origin[1]=origin[1]+10
new Zombie=create_entity("monster_zombie");
entity_set_origin(zombie,origin,0)

but it didnt work because entity_set_origin wants
Code:
float:origin[3]

i tried using 1 for id then wrote my name still nothing
solano is offline
solano
Member
Join Date: Nov 2009
Old 11-24-2009 , 15:17   Re: Monster Mod
Reply With Quote #26

before float:vec{50.0,50.0,5.0} made it spawn in the middle of the map.now when i use it it doesnt
Code:
entid = create_entity( "monster_zombie" );
    if(entid<1)
    {
        console_print(0,"Error creating monster")
        return PLUGIN_HANDLED
    }
    entity_set_origin(entid,Vec)
    DispatchSpawn( entid );
and why
Code:
get_user_origin(id, origin, 0)
origin[0]=origin[0]+10
set_user_origin(id,origin)
moves me but
Code:
console_print(0,"[BEFORE MOVE]x: %f y: %f z: %f",origin[0],origin[1],origin[2])
produces [BEFORE MOVE]x: 0.000000 y: 0.000000 z:0.000000
and set_pev(entid, pev_origin, origin)
gives this error: "Got a NaN origin on monster_zombie" ?

Last edited by solano; 11-24-2009 at 15:37.
solano is offline
solano
Member
Join Date: Nov 2009
Old 11-26-2009 , 13:42   Re: Monster Mod
Reply With Quote #27

ok why doesnt this work
Code:
pev(id,pev_origin,pOrigin,2); 
    
    
    entid = create_entity( "monster_zombie" )
    if(entid<1)
    {
        console_print(0,"Error creating monster")
        return PLUGIN_HANDLED
    }
    set_pev(entid,pev_origin,pOrigin);
    DispatchSpawn(entid)
and whats this origin shit cant i just say spawn monster_zombie at x10 and y 16
solano is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-26-2009 , 13:43   Re: Monster Mod
Reply With Quote #28

pev(id,pev_origin,pOrigin,2);

->

pev(id,pev_origin,pOrigin);


I'm not sure if you read the posts below, I gave you the right syntax and code example to spawn a zombie in front of you.
__________________
Arkshine is offline
solano
Member
Join Date: Nov 2009
Old 11-26-2009 , 14:25   Re: Monster Mod
Reply With Quote #29

yes i read it how i sad it didnt work
Code:
    #include <amxmodx> 
#include <amxmisc> 
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <engine>
#include <xs>

#define INTERVAL 0.3

public plugin_init() 
{ 
    
    register_plugin("HL Monster Hunt","0.1","Solano") 
    register_concmd("amx_monster","admin_monster",ADMIN_SLAY,"<name/id/authid/@CT/@TERRORIST/ * (all)> <monster> <number>")
    register_concmd("amx_users","admin_get_users",ADMIN_SLAY,"wtf are you retarded?!?!?!?")
    return PLUGIN_CONTINUE 
}
public plugin_precache()
{
    precache_model("models/zombie.mdl")
    precache_sound("zombie/claw_strike1.wav")
    precache_sound("zombie/claw_strike2.wav")
    precache_sound("zombie/claw_strike3.wav")

    precache_sound("zombie/claw_miss1.wav")
    precache_sound("zombie/claw_miss2.wav")

    precache_sound("zombie/zo_attack1.wav")
    precache_sound("zombie/zo_attack2.wav")

    precache_sound("zombie/zo_idle1.wav")
    precache_sound("zombie/zo_idle2.wav")
    precache_sound("zombie/zo_idle3.wav")
    precache_sound("zombie/zo_idle4.wav")

    precache_sound("zombie/zo_pain1.wav")
    precache_sound("zombie/zo_pain2.wav")

    precache_sound("zombie/zo_alert10.wav")
    precache_sound("zombie/zo_alert20.wav")
    precache_sound("zombie/zo_alert30.wav")

    


    return PLUGIN_CONTINUE
}

public admin_monster(id,level,cid)
{
    if (!cmd_access(id,level,cid,4))
    {
        return PLUGIN_HANDLED 
    }
    new arg1[32],monster[32],arg3[9]
    read_argv(1,arg1,31) 
    read_argv(2,monster,31)
    read_argv(3,arg3,8)
    new num_monsters
    num_monsters = str_to_num(arg3)
    if(num_monsters<1){
        num_monsters=1;}
        
    new Float:Angles [ 3 ];
    new Float:Origin [ 3 ];
    new Float:Forward[ 3 ];

    pev( get_user_index(arg1), pev_origin, Origin );
    pev(get_user_index(arg1) , pev_v_angle, Angles );

    angle_vector( Angles, ANGLEVECTOR_FORWARD, Forward );

    xs_vec_mul_scalar( Forward, 150.0, Angles );
    xs_vec_add( Origin, Forward, Origin );

    new Zombie = create_entity( "monster_zombie" );
    set_pev( Zombie, pev_origin, Origin,2 );
    DispatchSpawn( Zombie );
    return PLUGIN_HANDLED


}

Last edited by solano; 11-26-2009 at 14:42.
solano is offline
solano
Member
Join Date: Nov 2009
Old 11-26-2009 , 14:43   Re: Monster Mod
Reply With Quote #30

set_pev(Zombie,pev_origin,Origin,2)
what the 2 for(and even with the 2 still not working)
solano is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:12.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode