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

How to easy check Survivor Ragdoll?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FuzzOne
Member
Join Date: Nov 2009
Location: Brazil
Old 01-06-2010 , 08:20   How to easy check Survivor Ragdoll?
Reply With Quote #1

I need to check if a player using this plugin are looking to a dead survivor body. No need to check the "owner of the body".


I'm using:


Code:
index = GetClientAimTarget (client, false);

GetEdictClassname(index, Classname, sizeof(Classname));

    if(!StrEqual(Classname, "prop_ragdoll"))  //C_ClientRagdoll
    {
        return Plugin_Handled;        
    }
What more to check? Model? Skin? Another better away?

Last edited by FuzzOne; 01-06-2010 at 09:17. Reason: sintax error
FuzzOne is offline
Send a message via MSN to FuzzOne
FuzzOne
Member
Join Date: Nov 2009
Location: Brazil
Old 01-07-2010 , 17:35   Re: How to easy check Survivor Ragdoll?
Reply With Quote #2

i'm geting this error... Any clue of how make this work?

L 01/07/2010 - 15:063: [SM] Displaying call stack trace for plugin "Classes.smx":

L 01/07/2010 - 15:063: [SM] [1] Line 1652, Classes.sp::Event_DebibBegin()

L 01/07/2010 - 15:065: [SM] Native "RemoveEdict" reported: Edict -1 (-1) is not a valid edict
FuzzOne is offline
Send a message via MSN to FuzzOne
Dragonshadow
BANNED
Join Date: Jun 2008
Old 01-07-2010 , 19:32   Re: How to easy check Survivor Ragdoll?
Reply With Quote #3

http://docs.sourcemod.net/api/index....oad=show&id=59
Dragonshadow is offline
FuzzOne
Member
Join Date: Nov 2009
Location: Brazil
Old 01-08-2010 , 12:11   Re: How to easy check Survivor Ragdoll?
Reply With Quote #4

Code:
public Action:MiniGunDelete(client)
{
    new String:Classname[128];
    new index;
    
    index = GetClientAimTarget (client, false);
    if (index == -1)
    {
        return Plugin_Handled;
    }
    
    if (!IsValidEntity (index))
    {
        return Plugin_Handled;
    }
    GetEdictClassname(index, Classname, sizeof(Classname));
    if(!StrEqual(Classname, "prop_minigun"))
    {
        return Plugin_Handled;        
    }
    
    RemoveEdict (index);
    
    return Plugin_Handled;
}

Its what i'm using to delete "minigun". But im failing to remove a ragdoll in the upper code.
FuzzOne is offline
Send a message via MSN to FuzzOne
Dragonshadow
BANNED
Join Date: Jun 2008
Old 01-08-2010 , 12:53   Re: How to easy check Survivor Ragdoll?
Reply With Quote #5

http://docs.sourcemod.net/api/index....oad=show&id=50&

its returning -1 because it thinks you aren't aiming at anything.

IIRC ragdolls are clientside?
Dragonshadow is offline
FuzzOne
Member
Join Date: Nov 2009
Location: Brazil
Old 01-08-2010 , 17:23   Re: How to easy check Survivor Ragdoll?
Reply With Quote #6

Tnx a lot man! I saw that i as a little confused on the begin.

I'm searching a way to get the the id/ent/anything of a survivor corpse on the ground, without searching the client that died.

After that revive a random player and remove the corpse to dont be used again...

Need this couse hookevent player death dont get always get the right client on a server with more than 4 players (same with revive/desfibhooks)

Got some scripts of how to remove a ragdoll, just cant detect the body... =/

Last edited by FuzzOne; 01-08-2010 at 17:30.
FuzzOne is offline
Send a message via MSN to FuzzOne
Wazz
SourceMod Donor
Join Date: Mar 2009
Old 01-09-2010 , 20:53   Re: How to easy check Survivor Ragdoll?
Reply With Quote #7

PHP Code:
new ragdoll GetEntPropEnt(victimProp_Send"m_hRagdoll"); 
Or something similar should get the victim's (aka dead client's) ragdoll.
Wazz 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:12.


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