Raised This Month: $51 Target: $400
 12% 

[CS:S] Dead body player does have an entity index ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zack771
Senior Member
Join Date: Apr 2012
Old 06-13-2014 , 10:25   [CS:S] Dead body player does have an entity index ?
Reply With Quote #1

Hi,

I'd like to know if dead body player got an entity index, in order to make it move or something other with the dead body ?

Thanks by advance.
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 06-13-2014 , 10:45   Re: [CS:S] Dead body player does have an entity index ?
Reply With Quote #2

You mean a ragdoll?
This code works in CS:GO, i assume it is the same for CS:S.
You can get it in "player_death" event.
PHP Code:
new ragdoll GetEntPropEnt(clientProp_Send"m_hRagdoll"); 
ragdoll - your entity index.
xf117 is offline
Send a message via ICQ to xf117
Mitchell
~lick~
Join Date: Mar 2010
Old 06-13-2014 , 15:10   Re: [CS:S] Dead body player does have an entity index ?
Reply With Quote #3

clients render the player ragdolls differently, as in not server side, however most clientside predictions will work (parenting was proven to work also.
Mitchell is offline
Zack771
Senior Member
Join Date: Apr 2012
Old 06-13-2014 , 18:24   Re: [CS:S] Dead body player does have an entity index ?
Reply With Quote #4

Quote:
Originally Posted by xf117 View Post
You mean a ragdoll?
This code works in CS:GO, i assume it is the same for CS:S.
You can get it in "player_death" event.
PHP Code:
new ragdoll GetEntPropEnt(clientProp_Send"m_hRagdoll"); 
ragdoll - your entity index.
Yeah a ragdoll. Thanks i'm gonna try that.

And do you think i can make it move ? Like the puppet mod
Quote:
Originally Posted by Mitchell View Post
clients render the player ragdolls differently, as in not server side, however most clientside predictions will work (parenting was proven to work also.
What is clientside predictions please ?
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 06-13-2014 , 18:44   Re: [CS:S] Dead body player does have an entity index ?
Reply With Quote #5

It basically means ragdoll's behavior may vary for different players.
And no, the way puppet mod works, you cannot apply it to a dead body. You can try to create a bot and control it.
xf117 is offline
Send a message via ICQ to xf117
Zack771
Senior Member
Join Date: Apr 2012
Old 06-16-2014 , 05:33   Re: [CS:S] Dead body player does have an entity index ?
Reply With Quote #6

Quote:
Originally Posted by xf117 View Post
It basically means ragdoll's behavior may vary for different players.
What do you mean by "ragdoll's behavior" ?

Quote:
Originally Posted by xf117 View Post
And no, the way puppet mod works, you cannot apply it to a dead body. You can try to create a bot and control it.
Don't think to the bot, i keep it in mind. Thanks ^^
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
xf117
Senior Member
Join Date: Mar 2010
Location: Russia
Old 06-16-2014 , 05:55   Re: [CS:S] Dead body player does have an entity index ?
Reply With Quote #7

On your side, corpse might be thrown away by explosion, but another player might see him falling in the hole or something. They are not synced between players. Usual entities like barrels are handled server side (if not specified manually), all players will see the same barrel in the same position, and if you kick it, all players will see it. But with these ragdolls you can't guarantee that all players will see the same picture.
xf117 is offline
Send a message via ICQ to xf117
Mitchell
~lick~
Join Date: Mar 2010
Old 06-16-2014 , 09:27   Re: [CS:S] Dead body player does have an entity index ?
Reply With Quote #8

Quote:
Originally Posted by Zack771 View Post
What do you mean by "ragdoll's behavior" ?
As in most players have custom mods installed that make the ragdolls fly around, etc. Or if you join the server late, it will just create ragdolls where the player died, and give it no animation or velocity.
85% of the time a player sees the ragdoll in a different position then everyone else does. How ever you could attach a prop_ragdoll to the client, just wouldn't be recommended since it uses a lot of server resources to broadcast ragdoll positions etc.

Last edited by Mitchell; 06-16-2014 at 09:28.
Mitchell is offline
Zack771
Senior Member
Join Date: Apr 2012
Old 06-17-2014 , 13:22   Re: [CS:S] Dead body player does have an entity index ?
Reply With Quote #9

Quote:
Originally Posted by xf117 View Post
On your side, corpse might be thrown away by explosion, but another player might see him falling in the hole or something. They are not synced between players. Usual entities like barrels are handled server side (if not specified manually), all players will see the same barrel in the same position, and if you kick it, all players will see it. But with these ragdolls you can't guarantee that all players will see the same picture.
Quote:
Originally Posted by Mitchell View Post
As in most players have custom mods installed that make the ragdolls fly around, etc. Or if you join the server late, it will just create ragdolls where the player died, and give it no animation or velocity.
85% of the time a player sees the ragdoll in a different position then everyone else does. How ever you could attach a prop_ragdoll to the client, just wouldn't be recommended since it uses a lot of server resources to broadcast ragdoll positions etc.
Oh ok i perfectly understand now thanks.
I do not know that, so if i see a ragdoll in a position, another player can see it in another position ? Interesting.

Ok so i think i'm gonna control a bot like you suggest ^^

So subject is closed. Thanks a lot for your help =)
__________________
"Embrace your dreams, and whatever happend protect your honor"
Zack Fair
Zack771 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-17-2014 , 17:40   Re: [CS:S] Dead body player does have an entity index ?
Reply With Quote #10

Quote:
Originally Posted by Mitchell View Post
As in most players have custom mods installed that make the ragdolls fly around, etc. Or if you join the server late, it will just create ragdolls where the player died, and give it no animation or velocity.
85% of the time a player sees the ragdoll in a different position then everyone else does. How ever you could attach a prop_ragdoll to the client, just wouldn't be recommended since it uses a lot of server resources to broadcast ragdoll positions etc.
It's possible to force ragdolls to be done on the server side... I think. At least there's a DataMap for it: m_bForceServerRagdoll.

Edit: This datamap may only exist on things decended from CAI_BaseNPC, though.

Edit2: Nope, it's on the CTFPlayer class in TF2 as well, so it's likely part of CBaseCombatCharacter.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-17-2014 at 17:44.
Powerlord 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 08:19.


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