Raised This Month: $ Target: $400
 0% 

[Snippet] ForcePlayerSuicide workaround for OrangeBox games


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
IceMatrix
New Member
Join Date: Sep 2007
Location: Germany
Old 04-18-2009 , 15:42   [Snippet] ForcePlayerSuicide workaround for OrangeBox games
Reply With Quote #1

As the normal slay using ForceClientSuicide() isn't working for players inside the spawn area in OrangeBox games like DOD:S, I looked for a workaround. But there wasn't a good one.
Mine uses DukeHacks extension and has exactly the same effect as ForcePlayerSuicide().


PHP Code:
#include <sdktools>
#include <dukehacks>

stock SuicideClient(client)
{
    
ForcePlayerSuicide(client);
    if (
IsPlayerAlive(client))
    {    
/* Inside spawn area */
    
        
SetEntityHealth(client0);
        
dhTakeDamage(clientclientclient0.0DMG_PREVENT_PHYSICS_FORCE DMG_NEVERGIB);
    }


Last edited by IceMatrix; 04-18-2009 at 15:45.
IceMatrix is offline
koshmel
Member
Join Date: Nov 2008
Old 04-19-2009 , 05:57   Re: [Snippet] ForcePlayerSuicide workaround for OrangeBox games
Reply With Quote #2

try use FakeClientCommand "kill" "explode" for client
koshmel is offline
IceMatrix
New Member
Join Date: Sep 2007
Location: Germany
Old 04-19-2009 , 09:12   Re: [Snippet] ForcePlayerSuicide workaround for OrangeBox games
Reply With Quote #3

kill has no effect while in spawn area. it's hardcoded into a function called CDODPlayer::ShouldInstantRespawn(). It checks if the player is inside a spawn area and returns TRUE if so.. this prevents CDODPlayer::CommitSuicide() from further processing.
IceMatrix is offline
MikeJS
Senior Member
Join Date: Nov 2008
Old 04-19-2009 , 11:47   Re: [Snippet] ForcePlayerSuicide workaround for OrangeBox games
Reply With Quote #4

Quote:
Originally Posted by IceMatrix View Post
kill has no effect while in spawn area. it's hardcoded into a function called CDODPlayer::ShouldInstantRespawn(). It checks if the player is inside a spawn area and returns TRUE if so.. this prevents CDODPlayer::CommitSuicide() from further processing.
Actually it seems to not let them suicide for a few seconds after spawning. It doesn't matter if they're actually in spawn or not.
__________________
MikeJS 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 18:09.


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