Raised This Month: $ Target: $400
 0% 

[L4D2] Removing dead survivor bodies


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Oshroth
Senior Member
Join Date: Dec 2009
Old 04-21-2010 , 10:29   [L4D2] Removing dead survivor bodies
Reply With Quote #1

In one of the plugins I'm working on, I'm trying to remove the dead body of a survivor after a certain criteria is met; However I've hit a dead end, there doesn't seem to be much info about removing bodies in Left 4 Dead.

I've tried teleporting them to an off the map area, I've tried using ragdoll removal code and the dissolver code; but none of them worked.

This is the ragdoll remove code I've been using. I don't think it works with L4D2.
PHP Code:
//Declare:
    
decl BodyRagdoll;
    
decl String:Classname[64];
    
    
//Initialize:
    
BodyRagdoll GetEntPropEnt(clientProp_Send"m_hRagdoll");
    if(
IsValidEdict(BodyRagdoll))
    {
        
        
//Find:
        
GetEdictClassname(BodyRagdollClassnamesizeof(Classname)); 
        
        
//Remove:
        
if(StrEqual(Classname"cs_ragdoll"false)) RemoveEdict(BodyRagdoll);
    } 
__________________

Last edited by Oshroth; 04-21-2010 at 10:32.
Oshroth is offline
Frus
Senior Member
Join Date: Aug 2009
Old 04-21-2010 , 10:59   Re: [L4D2] Removing dead survivor bodies
Reply With Quote #2

I don't think l4d2's dead bodies are ragdolls...

I'd honestly be very surprised if they were classed as such, even moreso if the classname is 'cs_ragdoll'.
Frus is offline
CanadaRox
Member
Join Date: Dec 2009
Old 04-21-2010 , 13:09   Re: [L4D2] Removing dead survivor bodies
Reply With Quote #3

You could probably use dead_survivor_visible to find the entindex of the dead body, and then use that to find its classname then using that class name, find the entindex of each body and store it in an array.
CanadaRox is offline
alexip121093
Senior Member
Join Date: Dec 2009
Location: Hong Kong
Old 04-22-2010 , 05:58   Re: [L4D2] Removing dead survivor bodies
Reply With Quote #4

decl String:name[64],
for(new i = 0; i < GetMaxEntities(); i++)
{
if(IsValidEntity(i))
{
GetEdictClassname(i, name, sizeof(name));
if (StrEqual(name, "survivor_death_model", false) || StrEqual(name, "physics_prop_ragdoll", false))
{
RemoveEdict(i);
}
}
}
alexip121093 is offline
Send a message via MSN to alexip121093
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 16:09.


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