Raised This Month: $ Target: $400
 0% 

Help about solid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 05-08-2012 , 11:41   Help about solid
Reply With Quote #1

I create a npc then i set solid slidebox and test. But when i shoot the npc it didn't takedamage

See Video: http://www.youtube.com/watch?v=AaS-NMVQ2f8
in 0:23

as you can see, sometime i can't shoot the npc, how to solve that problem ?. just like player, shoot anywhere in player's body still can take damage. but can't in NPC

Here is code
PHP Code:
public create_revenant()
{
    new 
ent create_entity("info_target")
    
g_ent ent
    
    
static Float:Origin[3]
    
Origin[0] = g_official_origin[0]
    
Origin[1] = g_official_origin[1]
    
Origin[2] = g_official_origin[2]
    
    
entity_set_origin(entOrigin)
    
    
//entity_set_vector(ent, EV_VEC_angles, MyAngles)
    
    //MyAngles[0] -= MyAngles[0] * 2
    
    //entity_set_vector(ent, EV_VEC_v_angle, MyAngles)
    
    
entity_set_float(entEV_FL_takedamage1.0)
    
entity_set_float(entEV_FL_healthREVENANT_HEALTH 1000.0)
    
    
entity_set_string(entEV_SZ_classname"npc_revenant")
    
entity_set_model(entrevenant_model)
    
entity_set_int(entEV_INT_solidSOLID_BBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_PUSHSTEP)
    
    
entity_set_int(entEV_INT_gamestate1)
    
    new 
Float:maxs[3] = {25.050.0200.0}
    new 
Float:mins[3] = {-25.0, -50.0, -35.0}
    
entity_set_size(entminsmaxs)
    
entity_set_int(entEV_INT_modelindexrevenant_model_id)
    
    
set_entity_anim(ent1)
    
set_task(14.0"set_start_revenant"ent+TASK_STARTING)
    
    if(!
g_reg)
    {
        
g_reg 1
        RegisterHamFromEntity
(Ham_TakeDamageent"fw_revenant_takedamage"1)
    }
    
    
g_mahadashing 0
    g_time_doing 
0
    
    emit_sound
(entCHAN_BODYrevenant_sound[7], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Make Healthbar
    
healthbar create_entity("env_sprite")
    
    
set_pev(healthbarpev_scale1.0)
    
set_pev(healthbarpev_ownerent)
    
engfunc(EngFunc_SetModelhealthbarhealthbar_spr)    
    
    
set_task(0.1"recheck_boss"ent+TASK_RECHECK__"b")
    
set_task(random_float(7.015.0), "do_skill_now"TASK_SKILL)
    
    
drop_to_floor(ent)


Last edited by dias; 05-08-2012 at 19:24.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 05-08-2012 , 16:39   Re: Help about solid
Reply With Quote #2

entity_set_int(ent, EV_INT_gamestate, 1) or set_pev(ent,pev_gamestate,1)
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 05-08-2012 , 18:59   Re: Help about solid
Reply With Quote #3

still can't. Here is code

PHP Code:
public create_revenant()
{
    new 
ent create_entity("info_target")
    
g_ent ent
    
    
static Float:Origin[3]
    
Origin[0] = g_official_origin[0]
    
Origin[1] = g_official_origin[1]
    
Origin[2] = g_official_origin[2]
    
    
entity_set_origin(entOrigin)
    
    
//entity_set_vector(ent, EV_VEC_angles, MyAngles)
    
    //MyAngles[0] -= MyAngles[0] * 2
    
    //entity_set_vector(ent, EV_VEC_v_angle, MyAngles)
    
    
entity_set_float(entEV_FL_takedamage1.0)
    
entity_set_float(entEV_FL_healthREVENANT_HEALTH 1000.0)
    
    
entity_set_string(entEV_SZ_classname"npc_revenant")
    
entity_set_model(entrevenant_model)
    
entity_set_int(entEV_INT_solidSOLID_BBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_PUSHSTEP)
    
    
entity_set_int(entEV_INT_gamestate1)
    
    new 
Float:maxs[3] = {25.050.0200.0}
    new 
Float:mins[3] = {-25.0, -50.0, -35.0}
    
entity_set_size(entminsmaxs)
    
entity_set_int(entEV_INT_modelindexrevenant_model_id)
    
    
set_entity_anim(ent1)
    
set_task(14.0"set_start_revenant"ent+TASK_STARTING)
    
    if(!
g_reg)
    {
        
g_reg 1
        RegisterHamFromEntity
(Ham_TakeDamageent"fw_revenant_takedamage"1)
    }
    
    
g_mahadashing 0
    g_time_doing 
0
    
    emit_sound
(entCHAN_BODYrevenant_sound[7], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Make Healthbar
    
healthbar create_entity("env_sprite")
    
    
set_pev(healthbarpev_scale1.0)
    
set_pev(healthbarpev_ownerent)
    
engfunc(EngFunc_SetModelhealthbarhealthbar_spr)    
    
    
set_task(0.1"recheck_boss"ent+TASK_RECHECK__"b")
    
set_task(random_float(7.015.0), "do_skill_now"TASK_SKILL)
    
    
drop_to_floor(ent)


Last edited by dias; 05-08-2012 at 19:24.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 05-08-2012 , 19:08   Re: Help about solid
Reply With Quote #4

show how you create the entity
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 05-08-2012 , 19:27   Re: Help about solid
Reply With Quote #5

Here is the code. This is other npc but still get same problem, i hope you know how to solve it

PHP Code:
public create_revenant()
{
    new 
ent create_entity("info_target")
    
g_ent ent
    
    
static Float:Origin[3]
    
Origin[0] = g_official_origin[0]
    
Origin[1] = g_official_origin[1]
    
Origin[2] = g_official_origin[2]
    
    
entity_set_origin(entOrigin)
    
    
//entity_set_vector(ent, EV_VEC_angles, MyAngles)
    
    //MyAngles[0] -= MyAngles[0] * 2
    
    //entity_set_vector(ent, EV_VEC_v_angle, MyAngles)
    
    
entity_set_float(entEV_FL_takedamage1.0)
    
entity_set_float(entEV_FL_healthREVENANT_HEALTH 1000.0)
    
    
entity_set_string(entEV_SZ_classname"npc_revenant")
    
entity_set_model(entrevenant_model)
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_PUSHSTEP)
    
    
entity_set_int(entEV_INT_gamestate1)
    
    new 
Float:maxs[3] = {25.050.0200.0}
    new 
Float:mins[3] = {-25.0, -50.0, -35.0}
    
entity_set_size(entminsmaxs)
    
entity_set_int(entEV_INT_modelindexrevenant_model_id)
    
    
set_entity_anim(ent1)
    
set_task(14.0"set_start_revenant"ent+TASK_STARTING)
    
    if(!
g_reg)
    {
        
g_reg 1
        RegisterHamFromEntity
(Ham_TakeDamageent"fw_revenant_takedamage"1)
    }
    
    
g_mahadashing 0
    g_time_doing 
0
    
    emit_sound
(entCHAN_BODYrevenant_sound[7], 1.0ATTN_NORM0PITCH_NORM)
    
    
// Make Healthbar
    
healthbar create_entity("env_sprite")
    
    
set_pev(healthbarpev_scale1.0)
    
set_pev(healthbarpev_ownerent)
    
engfunc(EngFunc_SetModelhealthbarhealthbar_spr)    
    
    
set_task(0.1"recheck_boss"ent+TASK_RECHECK__"b")
    
set_task(random_float(7.015.0), "do_skill_now"TASK_SKILL)
    
    
drop_to_floor(ent)


Last edited by dias; 05-08-2012 at 19:27.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 05-08-2012 , 19:59   Re: Help about solid
Reply With Quote #6

i test this and work fine :S

PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "[R]ak"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say t""Test")
}

public 
Test(id) {
    
    new 
ent create_entity("info_target")
    
    new 
Origin[3], Float:flOrigin[3]
    
    
get_user_origin(idOrigin)
    
IVecFVec(OriginflOrigin)
    
    
flOrigin[0] += 50.0
    flOrigin
[1] += 50.0
    
    entity_set_origin
(entflOrigin)
    
    
entity_set_float(entEV_FL_takedamage1.0)
    
entity_set_float(entEV_FL_health1000.0)
    
    
entity_set_string(entEV_SZ_classname"npc_revenant")
    
entity_set_model(ent"models/player/vip/vip.mdl")
    
entity_set_int(entEV_INT_solidSOLID_SLIDEBOX)
    
entity_set_int(entEV_INT_movetypeMOVETYPE_PUSHSTEP)
    
    
entity_set_int(entEV_INT_gamestate1)
    
    new 
Float:maxs[3] = { 16.016.036.0 
    new 
Float:mins[3] = { -16.0, -16.0, -36.0 }
    
entity_set_size(entminsmaxs)
    
drop_to_floor(ent)    

__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 05-09-2012 , 05:03   Re: Help about solid
Reply With Quote #7

I dont want to sound stupid, but what does pev_gamestate do?
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 05-09-2012 , 05:46   Re: Help about solid
Reply With Quote #8

^
- In Pev research, that is cs default shield

@rak:
- well it work well. but sometime i use big boss and the error still appear

Last edited by dias; 05-09-2012 at 05:52.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 05-09-2012 , 07:10   Re: Help about solid
Reply With Quote #9

maybe when you change the sequance o something like this... the gamestate put in 0; or maybe is other entity
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
dias
BANNED
Join Date: Jul 2009
Location: South Vietnam
Old 05-09-2012 , 08:46   Re: Help about solid
Reply With Quote #10

Thank All. It work great now...
Well. i have a new problem. may be you can help
http://forums.alliedmods.net/showthr...95#post1705595

Last edited by dias; 05-09-2012 at 10:37.
dias is offline
Send a message via Yahoo to dias Send a message via Skype™ to dias
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 00:19.


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