Raised This Month: $ Target: $400
 0% 

Ragdoll of a specific player


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CoolPeter
Member
Join Date: Nov 2005
Old 05-09-2006 , 05:18   Ragdoll of a specific player
Reply With Quote #1

Is there a way to get the ragdoll of a specific player?
I want to get the ragdoll of a player when he dies and the player_death event fire.

I loop through the global entity list and search for all cs_ragdoll.
But i can't find out from which player the ragdoll is.

I tried GetOwnerEntity, GetParent, ... but that all returns 0

Can anyone help me please?
CoolPeter is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 05-09-2006 , 09:47  
Reply With Quote #2

The "parent" is the entity to which a physics object is attached for game physics calculations. I've only seen "owner" used on weapons and viewmodels, although it is probably used for other things too.

You need to get the player's m_hRagdoll.

Be aware that ragdolls are simulated client side. BecomeRagdollOnClient( const Vector &force ) is called when a player dies, and each client uses that force to determine how the ragdoll will behave. Adding velocity or teleporting a ragdoll will not change the ragdoll on the clients because each client sees the ragdoll in a different place. Getting the ragdolls origin on the server will return the point where it was created (not where it came to rest since this is different for each client).

If the ragdoll is removed on the server, it will be removed on the client. That's about the only thing I found that is updated to the clients.
L. Duke is offline
CoolPeter
Member
Join Date: Nov 2005
Old 05-09-2006 , 10:07  
Reply With Quote #3

Do you know how to get the players m_hRagdoll?

I saw that c0ldfyr3 removes the ragdolls in his goremod plugin when a player gets killed by a hegrenade.
Or does he remove all ragdolls?
CoolPeter is offline
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 05-09-2006 , 10:34  
Reply With Quote #4

The easiest method of doing this is to use an array, a CUTLVector would do nicely.

Then, everytime someone dies, search for cs_ragdolls.

If your not going to remove it during this tick, add the newly found one(s) to the list.

If you want to remove it this tick, and if it isnt already in your list it must be a new one so you can remove it.

Understand?
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
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 12:42.


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