Raised This Month: $ Target: $400
 0% 

detect when pev_body changes


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-09-2015 , 09:24   detect when pev_body changes
Reply With Quote #1

Hello. I have a question.
Is there anyway to know when pev_body changes without tasks?
Can i get it with fakemeta/engine? Or maybe a new module, or with orpheu/rage if possible. Or is it impossible?
__________________
Jhob94 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-09-2015 , 09:51   Re: detect when pev_body changes
Reply With Quote #2

You can either:

- Hooking AddToFullPack, which is probably a bad idea
- Hooking specific functions where pev->body is used, which sounds like a pain in the ass
- Explaining what you want really to do, avoiding a XY problem, which sounds the most reasonable with high chance to have a better solution.
__________________

Last edited by Arkshine; 01-09-2015 at 09:51.
Arkshine is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-09-2015 , 10:05   Re: detect when pev_body changes
Reply With Quote #3

Somehow it seems that the game resets pev_body in some moments of the game. Not sure if is spawning, end round. Idk when, so i should hook something when pev_body changes. A note that must be said is that i tested the plugin in a server that changes teams on end round. So maybe it resets when the team changes. But model change is blocked so i really dont see why this is happening. I need this so i can know when pev_body is being reseted.
__________________
Jhob94 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-09-2015 , 10:29   Re: detect when pev_body changes
Reply With Quote #4

So you're talking player's pev->body. Because it's used by others entities.

From game:

- Set to 1:
when you buy defuser kit (BuyItem)
when C4 is given (CHalfLifeMultiplay::GiveC4)
when you grab the c4 on the ground (CWeaponBox::Touch)
when you get defuser kit on the ground (CItemThighPack::MyTouch)
when you spawn and you have already a defuser kit (CBasePlayer::Spawn)
- Set to 0:
when you choose appereance (HandleMenu_ChooseAppearance)
when all items are removed and you have whatever c4/defuser (RemoveAllItems)
when you are killed and you have a defuser kit (CBasePlayer::Killed)
when you become VIP (CBasePlayer::MakeVIP)
when VIP has touched the safe zone, when you disappears and if you have defuser kit (CBasePlayer::Disappear)
when you spawn and you don't have defuser kit (CBasePlayer::Spawn)
when you drop C4 (CBasePlayer::DropPlayerItem)
when you switch team and you have the defuser kit (CBasePlayer::SwitchTeam)
when you plant the bomb (CC4::PrimaryAttack)
You still don't explain what are you trying to do.
__________________

Last edited by Arkshine; 01-09-2015 at 10:33.
Arkshine is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-09-2015 , 10:38   Re: detect when pev_body changes
Reply With Quote #5

I am trying to block all the sets by the default game. But hooking all of that seems huge. Is it all necessary or i can do something else with some module like orpheu (or a new module)?

Edit: If is possible with orpheu/rage/okapi, dont do it by your own. Just give me some tips of what i must do
__________________

Last edited by Jhob94; 01-09-2015 at 10:53.
Jhob94 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-09-2015 , 10:56   Re: detect when pev_body changes
Reply With Quote #6

XY problem. Could you stop that please, and explaining what are you trying to do, not what you think the solution is.
__________________
Arkshine is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-09-2015 , 11:37   Re: detect when pev_body changes
Reply With Quote #7

I am trying to use player models with sub-models so i can use unlimited player models and only 1 model will be precached. But since pev_body is changed, i must block game from changing it so the plugin will be the only thing able to modify it. I can use a bool to allow changing when plugin calls and turn the bool false after change the pev.
__________________
Jhob94 is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 01-09-2015 , 12:26   Re: detect when pev_body changes
Reply With Quote #8

When exactly did this happen?
If you absolutely sure it happened when change team, you can hook spawn post with ham and reset to your desire submodel.
Also, you can try to follow conditions given by Arkshine and change to your sub accordingly.
I myself have never seen something like what you have described
RateX is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 01-09-2015 , 12:30   Re: detect when pev_body changes
Reply With Quote #9

Well idk when, and yes, i change in ham spawn. But the game gives a bomb itself, so i guess it's normal this is happening, since the bomb is given after the spawn event.
__________________
Jhob94 is offline
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 01-09-2015 , 13:24   Re: detect when pev_body changes
Reply With Quote #10

Then hook weapon pickup message->change to your sub again
RateX is offline
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 15:28.


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