Raised This Month: $ Target: $400
 0% 

Get and set m_IdealMonsterState?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-01-2014 , 18:43   Get and set m_IdealMonsterState?
Reply With Quote #1

Is there anyway to get and set m_IdealMonsterState to entities? If so, can you provide an example?
Rirre is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 06-01-2014 , 21:56   Re: Get and set m_IdealMonsterState?
Reply With Quote #2

from cstrike_pdatas:

stock const m_MonsterState = 79;
stock const m_IdealMonsterState = 80;
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-02-2014 , 06:33   Re: Get and set m_IdealMonsterState?
Reply With Quote #3

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)     } }

Last edited by Rirre; 06-02-2014 at 06:46.
Rirre is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-02-2014 , 06:39   Re: Get and set m_IdealMonsterState?
Reply With Quote #4

If you want these offsets working, you have to use an entity which is derived of CBaseMonster.
__________________
Arkshine is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 06-02-2014 , 06:45   Re: Get and set m_IdealMonsterState?
Reply With Quote #5

Quote:
Originally Posted by Arkshine View Post
If you want these offsets working, you have to use an entity which is derived of CBaseMonster.
Alright, seems like I'm screwed then.

Last edited by Rirre; 06-02-2014 at 06:46.
Rirre is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-02-2014 , 06:50   Re: Get and set m_IdealMonsterState?
Reply With Quote #6

If don't say bullshit: "player", "grenade", "func_guntarget", "monster_hevsuit_dead", "hostage" , "env_explosion", "cycler", "cycler_wreckage".
__________________
Arkshine is offline
.Dare Devil.
Veteran Member
Join Date: Sep 2010
Old 06-02-2014 , 12:56   Re: Get and set m_IdealMonsterState?
Reply With Quote #7

what does m_IdealMonsterState do?
.Dare Devil. 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 09:41.


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