AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Get and set m_IdealMonsterState? (https://forums.alliedmods.net/showthread.php?t=241342)

Rirre 06-01-2014 18:43

Get and set m_IdealMonsterState?
 
Is there anyway to get and set m_IdealMonsterState to entities? If so, can you provide an example?

Bos93 06-01-2014 21:56

Re: Get and set m_IdealMonsterState?
 
from cstrike_pdatas:

stock const m_MonsterState = 79;
stock const m_IdealMonsterState = 80;

Rirre 06-02-2014 06:33

Re: Get and set m_IdealMonsterState?
 
Yea I know, but when I do this:
Code:
client_print(owner, print_chat, "m_idealMonsterState = %i", get_pdata_int(ent, m_IdealMonsterState))
It prints either this:
Code:

m_IdealMonsterState = 0
or this:
Code:

m_IdealMonsterState = 19464576
No matter if it is alive or dead.
Mostly prints '0' of the time. But there is a small chance it prints 19464576 also.

EDIT: If it helps, I'm using it with this:
Code:
public M203_Nade_Touch(pToucher, pTouched) {     new szClassName[32]     entity_get_string(pToucher, EV_SZ_classname, szClassName, 31)     if(equal(szClassName, "m203_nade"))     {         if(!pTouched && 0)             return         new dmgradius = get_cvar_num("amx_m203rad")         new maxdamage = get_cvar_num("amx_m203dmg")         new Float:fl_vExplodeAt[3]         entity_get_vector(pToucher, EV_VEC_origin, fl_vExplodeAt)         new vExplodeAt[3]         vExplodeAt[0] = floatround(fl_vExplodeAt[0])         vExplodeAt[1] = floatround(fl_vExplodeAt[1])         vExplodeAt[2] = floatround(fl_vExplodeAt[2])         new owner = entity_get_edict(pToucher, EV_ENT_owner)         new Float:origin[3], Float:dist, Float:dRatio, damage         new ent = -1         while((ent = find_ent_by_class(ent, "func_wall")))         {             pev(ent, pev_origin, origin)             dist = get_distance_f(origin, fl_vExplodeAt)             if(dist <= dmgradius)             {                 dRatio = dist / float(dmgradius)                 damage = maxdamage - floatround(float(maxdamage) * dRatio)                 if( pev(ent, pev_flags) & FL_MONSTER && can_see_fm(pToucher, ent) )                 {                     // get monster's health                     new Float:health                     pev(ent, pev_health, health)                     health -= damage                     if( pev(ent, pev_takedamage) == DAMAGE_NO )                     {                         damage = 0                     }                     // react to the damage                     set_pev(ent, pev_dmg_inflictor, owner)                     // do the damage                     set_pev(ent, pev_health, health)                     client_print(owner, print_chat, "m_IdealMonsterState = %i", get_pdata_int(ent, m_IdealMonsterState))                     // It's dead, get frag & deal damage to the corpse to gib it                     if(health <= 0 && get_pdata_int(ent, m_IdealMonsterState) == 8)                     {                         kill_monster(ent, owner)                     }                 }             }         }         remove_entity(pToucher)     } }

Arkshine 06-02-2014 06:39

Re: Get and set m_IdealMonsterState?
 
If you want these offsets working, you have to use an entity which is derived of CBaseMonster.

Rirre 06-02-2014 06:45

Re: Get and set m_IdealMonsterState?
 
Quote:

Originally Posted by Arkshine (Post 2145680)
If you want these offsets working, you have to use an entity which is derived of CBaseMonster.

Alright, seems like I'm screwed then.

Arkshine 06-02-2014 06:50

Re: Get and set m_IdealMonsterState?
 
If don't say bullshit: "player", "grenade", "func_guntarget", "monster_hevsuit_dead", "hostage" , "env_explosion", "cycler", "cycler_wreckage".

.Dare Devil. 06-02-2014 12:56

Re: Get and set m_IdealMonsterState?
 
what does m_IdealMonsterState do?


All times are GMT -4. The time now is 09:41.

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