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

Monster Mod


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-26-2009 , 14:47   Re: Monster Mod
Reply With Quote #31

Try :

Code:
#include <amxmodx> #include <amxmisc> #include <fakemeta> #include <engine> #include <xs> 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") } public plugin_init() {     register_plugin( "HL Monster Hunt", "0.1", "Solano" );     register_concmd( "amx_monster", "ConsoleCommand_SpawnZombie", ADMIN_SLAY, "<Name/UserID/>" ); } public ConsoleCommand_SpawnZombie( const id, const level, const cid ) {     if ( !cmd_access( id, level, cid, 2 ) )     {         return PLUGIN_HANDLED;     }         new Target[ 32 ];     read_argv( 1, Target, charsmax( Target ) );         new TargetIndex = cmd_target( id, Target, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE );         if ( !TargetIndex )     {         return PLUGIN_HANDLED;     }         new Float:Angles [ 3 ];     new Float:Origin [ 3 ];     new Float:Forward[ 3 ];     pev( TargetIndex, pev_origin, Origin );     pev( TargetIndex , pev_v_angle, Angles );     angle_vector( Angles, ANGLEVECTOR_FORWARD, Forward );     xs_vec_mul_scalar( Forward, 150.0, Forward );     xs_vec_add( Origin, Forward, Origin );     new Zombie = create_entity( "monster_zombie" );     set_pev( Zombie, pev_origin, Origin );     DispatchSpawn( Zombie );     drop_to_floor( Zombie );         return PLUGIN_HANDLED; }
__________________

Last edited by Arkshine; 11-26-2009 at 15:50.
Arkshine is offline
solano
Member
Join Date: Nov 2009
Old 11-26-2009 , 15:12   Re: Monster Mod
Reply With Quote #32

still not working i dont know why
public ConsoleCommand_SpawnZombie( const id, const level, const cid )
whre does it get id,level,cid from
i removed the immunity and tryed spawning on my self
solano is offline
solano
Member
Join Date: Nov 2009
Old 11-26-2009 , 15:23   Re: Monster Mod
Reply With Quote #33

i added this code out of randomness
Code:
 //create a basic entity
    new entid = create_entity("info_target")
    //set its classname
    entity_set_string(entid, EV_SZ_classname, "some_guy")
    //set its model
    entity_set_model(entid, "models/w_suit.mdl")
    new Float:Vec[3] = {0.0,0.0,0.0}
    //set its origin 
    entity_set_origin(entid, Vec)
    //set some basic properties
    entity_set_int(entid, EV_INT_solid, 1)
    entity_set_int(entid, EV_INT_movetype, 6)
    //create the weapon - thanks to pimp_daddy!
    new entWeapon = create_entity("info_target")
    new weapString[255]
    entity_set_string(entWeapon, EV_SZ_classname, weapString)
    //set to follow
    entity_set_int(entWeapon, EV_INT_movetype, MOVETYPE_FOLLOW)
    entity_set_int(entWeapon, EV_INT_solid, SOLID_NOT)
    entity_set_edict(entWeapon, EV_ENT_aiment, entid)
    entity_set_model(entWeapon, "models/w_gausst.mdl")
and it worked but its in the middle of the map
solano is offline
solano
Member
Join Date: Nov 2009
Old 11-26-2009 , 15:33   Re: Monster Mod
Reply With Quote #34

Code:
//create a basic entity
    new entid = create_entity("info_target")
    //set its classname
    entity_set_string(entid, EV_SZ_classname, "some_guy")
    //set its model
    entity_set_model(entid, "models/w_suit.mdl")
    new Float:Vec[3]
    pev( TargetIndex , pev_origin, Vec );   
    //set its origin 
    entity_set_origin(entid, Vec)
    //set some basic properties
    entity_set_int(entid, EV_INT_solid, 1)
    entity_set_int(entid, EV_INT_movetype, 6)
    //create the weapon - thanks to pimp_daddy!
    new entWeapon = create_entity("info_target")
    new weapString[255]
    entity_set_string(entWeapon, EV_SZ_classname, weapString)
    //set to follow
    entity_set_int(entWeapon, EV_INT_movetype, MOVETYPE_FOLLOW)
    entity_set_int(entWeapon, EV_INT_solid, SOLID_NOT)
    entity_set_edict(entWeapon, EV_ENT_aiment, entid)
    entity_set_model(entWeapon, "models/w_gausst.mdl")
OK WHAT THE FUCK
THAT WORKS and spawns it right on top of me
solano is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-26-2009 , 15:52   Re: Monster Mod
Reply With Quote #35

Please stop trying random things like that. The code you have create a dummy entity where you configure it manually. Nothing to do with your problem.

I've tested myself ; the problem was you need to allow monster in multiplayer. You have to set to 1 : mp_allowmonsters

About the flag (cmd_target) I wanted to use CMDTARGET_ALLOW_SELF, it's fixed.

So, now it works as it should.
__________________
Arkshine is offline
solano
Member
Join Date: Nov 2009
Old 11-27-2009 , 03:55   Re: Monster Mod
Reply With Quote #36

yeah it work perfectly except it spawns on top of my head.
and i want to ask could i spawn weapons on the map and can the players take them and use them?
solano is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-27-2009 , 05:25   Re: Monster Mod
Reply With Quote #37

No, it spawns in front of you ( 150 units ), I've tested myself but try again my code, I remember that there was another typo.

For weapon, same ways, probably. weapon_* entities.
__________________
Arkshine is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 11-27-2009 , 06:07   Re: Monster Mod
Reply With Quote #38

Quote:
Originally Posted by Arkshine View Post
No, it spawns in front of you ( 150 units ), I've tested myself but try again my code, I remember that there was another typo.

For weapon, same ways, probably. weapon_* entities.

with all my respect sir arkshine, plugin doesn't work

look at this

Code:
] amx_monster  tuty
L 11/27/2009 - 13:04:25: [FAKEMETA] Invalid entity
L 11/27/2009 - 13:04:25: [AMXX] Displaying debug trace (plugin "monster.amxx")
L 11/27/2009 - 13:04:25: [AMXX] Run time error 10: native error (native "set_pev")
L 11/27/2009 - 13:04:25: [AMXX]    [0] monster.sma::ConsoleCommand_SpawnZombie (line 70)
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-27-2009 , 06:13   Re: Monster Mod
Reply With Quote #39

Plugin works and it's for Half-Life.
__________________
Arkshine is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 11-27-2009 , 07:09   Re: Monster Mod
Reply With Quote #40

Quote:
Originally Posted by Arkshine View Post
Plugin works and it's for Half-Life.
lol i tested it on cs.. my bad -.-
__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Reply



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 19:30.


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