AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help about solid (https://forums.alliedmods.net/showthread.php?t=184736)

dias 05-08-2012 11:41

Help about solid
 
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)



rak 05-08-2012 16:39

Re: Help about solid
 
entity_set_int(ent, EV_INT_gamestate, 1) or set_pev(ent,pev_gamestate,1)

dias 05-08-2012 18:59

Re: Help about solid
 
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)



rak 05-08-2012 19:08

Re: Help about solid
 
show how you create the entity

dias 05-08-2012 19:27

Re: Help about solid
 
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)



rak 05-08-2012 19:59

Re: Help about solid
 
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)    



NiHiLaNTh 05-09-2012 05:03

Re: Help about solid
 
I dont want to sound stupid, but what does pev_gamestate do? :?

dias 05-09-2012 05:46

Re: Help about solid
 
^
- In Pev research, that is cs default shield

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

rak 05-09-2012 07:10

Re: Help about solid
 
maybe when you change the sequance o something like this... the gamestate put in 0; or maybe is other entity

dias 05-09-2012 08:46

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


All times are GMT -4. The time now is 00:19.

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