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-23-2009 , 16:30   Re: Monster Mod
Reply With Quote #11

i didnt know you needed fun for set_user_frags()
EDIT:
ok this didnt work
register_event( "DeathMsg", "Monster_Killed", "a", "1>0" )

public Monster_Killed ()
{
new Killer = read_data( 1 );
new Victim = read_data( 2 );

if ( is_user_alive( Killer ) && pev( Victim, pev_flags ) & FL_MONSTER ) )
{
set_user_frags( Attacker, get_user_frags( Attacker ) + 1 );
}
}

i will try the other way
edit2:
ok i compiled it now testing...
second one is not working either

Last edited by solano; 11-23-2009 at 16:43.
solano is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-23-2009 , 16:32   Re: Monster Mod
Reply With Quote #12

You can see most of functions using this wiki : http://www.amxmodx.org/funcwiki.php
__________________
Arkshine is offline
solano
Member
Join Date: Nov 2009
Old 11-23-2009 , 16:44   Re: Monster Mod
Reply With Quote #13

thank you
ok have to go to bed now will write tomorrow with the result
solano is offline
solano
Member
Join Date: Nov 2009
Old 11-24-2009 , 04:18   Re: Monster Mod
Reply With Quote #14

huh...another problem
Code:
#include <amxmodx> 
#include <amxmisc> 
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <engine>

#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>")
    return PLUGIN_CONTINUE 
}
public plugin_precache()
{
    precache_model("models/zombie.mdl")
    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 entid
    entid = create_entity("zombie")
    entity_set_string(entid, EV_SZ_classname, "monster")
    entity_set_model(entid, "models/zombie.mdl")
    new Float:Vec[3] = {50.0,50.0,5.0}
    entity_set_origin(entid, Vec)
    entity_set_int(entid, EV_INT_solid, 1)
    entity_set_int(entid, EV_INT_movetype, 6)
    return PLUGIN_HANDLED
}
i have this code and when i execute it(dont mind that some arguments in the function are not used this is only a test) all of the bullets and rockets and everything goes through walls and the lazor on the bazooka disapears
EDIT:ah yeah and i cant reload
EDIT2: i fixed it
Code:
#include <amxmodx> 
#include <amxmisc> 
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <engine>

#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>")
    return PLUGIN_CONTINUE 
}
public plugin_precache()
{
    precache_model("models/zombie.mdl")
    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 entid
    entid = create_entity("zombie")
    if (entid<1)
    {
        console_print(0,"GODDAMN SHIIIIIIIIIIIT!")
        return PLUGIN_HANDLED
    }
    entity_set_string(entid, EV_SZ_classname, "monster")
    entity_set_model(entid, "models/zombie.mdl")
    new Float:Vec[3] = {50.0,50.0,5.0}
    entity_set_origin(entid, Vec)
    entity_set_int(entid, EV_INT_solid, 1)
    entity_set_int(entid, EV_INT_movetype, 6)
    return PLUGIN_HANDLED
}
but no zombie is spawning

Last edited by solano; 11-24-2009 at 04:39.
solano is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-24-2009 , 04:32   Re: Monster Mod
Reply With Quote #15

Again, it's not "zombie" but "monster_zombie" ; see the link I've provided above. Also, you don't need to set the models and suchs, spawn it with DispatchSpawn( entid ). All you need to start is to spawn it at a specific origin. ( don't use a random one.. )
__________________
Arkshine is offline
solano
Member
Join Date: Nov 2009
Old 11-24-2009 , 04:45   Re: Monster Mod
Reply With Quote #16

yeah i just saw that its working now
but i want to ask something
entity_set_int(entid, EV_INT_movetype, 6)
EV_INT_movetype(what other types are there)
and what is 6 for
solano is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-24-2009 , 04:49   Re: Monster Mod
Reply With Quote #17

See hlsdk_cons.inc file ; but you don't need them.
__________________
Arkshine is offline
solano
Member
Join Date: Nov 2009
Old 11-24-2009 , 05:01   Re: Monster Mod
Reply With Quote #18

what about new Float:Vec[3] = {50.0,50.0,10.0}
i noticed that that is the middle of the map.
whenever i change the values the zombie goes somewhere and i cant find it

and another thing i need this
register_think ( "zombie", "think_zombie" )
for ai right and then
public think_zombie()
{
//code
}
could you please explain (simple explanation) what actions does the ai need to perform and some functions(if you arent lazy to help me a little)

Last edited by solano; 11-24-2009 at 05:17.
solano is offline
solano
Member
Join Date: Nov 2009
Old 11-24-2009 , 05:21   Re: Monster Mod
Reply With Quote #19

Description
DispatchSpawn - This is the same as call_think. Syntax
DispatchSpawn ( entity )

are you sure its dispatchspawn
solano is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-24-2009 , 05:21   Re: Monster Mod
Reply With Quote #20

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 );
__________________
Arkshine 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 08:37.


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