AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can't remove dead body (ClCorpse) (https://forums.alliedmods.net/showthread.php?t=189958)

analogg 07-13-2012 01:29

Can't remove dead body (ClCorpse)
 
Hello!

I tried remove dead body via:
PHP Code:

set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET); 

but that method doesn't works! Can't understand why!

Can anyone help me?

Thanx!

<VeCo> 07-13-2012 06:54

Re: Can't remove dead body (ClCorpse)
 
That should work fine.
Another method is setting pev_deadflag to DEAD_DISCARDBODY when the player dies.

Doc-Holiday 07-13-2012 11:40

Re: Can't remove dead body (ClCorpse)
 
it works fine on my server and in testing

analogg 07-13-2012 15:37

Re: Can't remove dead body (ClCorpse)
 
Hmm...strange. When I kill the player, or kill himself, die animation still play.
With DEAD_DISCARDBODY the same!

Edit: Maybe problem in server build? I'm using 4554 build.

hleV 07-13-2012 16:36

Re: Can't remove dead body (ClCorpse)
 
You wan't the player to disappear once killed? If so, just make him invisible upon death.
PHP Code:

#include <amxmodx>
#include <fun>
#include <hamsandwich>

public plugin_init()
{
    
RegisterHam(Ham_Killed"player""OnPlayerKilled"1);
    
RegisterHam(Ham_Spawn"player""OnPlayerSpawn");

    
// Not sure if this is needed since we make the player invisible anyway
    
set_msg_block(get_user_msgid("ClCorpse"), BLOCK_SET);
}

public 
OnPlayerKilled(client)
    
set_user_rendering(clientkRenderFxGlowShell000kRenderTransAlpha0);

public 
OnPlayerSpawn(client)
    
set_user_rendering(client); // Make visible before spawning 


analogg 07-13-2012 16:44

Re: Can't remove dead body (ClCorpse)
 
I have made this before start this topic (invisible die animation)!
But I need that the player after his death not watching his body (I mean the death animation).

How can I do that?
------------------------
I mean, when player die, his camera looks on his invisible dead body. Maybe anybody knows method to solve it?!

Lolz0r 07-13-2012 18:17

Re: Can't remove dead body (ClCorpse)
 
Try this :

Code:
#include <amxmodx> #include <fakemeta> #include <hamsandwich> public plugin_init() {         register_plugin( "Remove Corpse", "1.0", "Sylwester" )         set_msg_block( get_user_msgid( "ClCorpse" ), BLOCK_SET )         RegisterHam( Ham_Killed, "player", "player_killed", 1 ) } public player_killed( id ) {         set_pev( id, pev_effects, EF_NODRAW ) }

or this :

Code:
#include <amxmodx> #include <hamsandwich> #include <engine> #include <fakemeta> const m_pActiveItem = 373 public plugin_init()   {     RegisterHam( Ham_Killed, "player", "Ham_CBasePlayer_Killed_Post", 1 )     }   public Ham_CBasePlayer_Killed_Post( id, iKiller ) {     set_pev( id, pev_effects, pev( id, pev_effects ) | EF_NODRAW )     if( is_user_alive( iKiller ) )     {         new iActiveItem = get_pdata_cbase( iKiller, m_pActiveItem )         if( iActiveItem > 3 )         {             engfunc( EngFunc_SetView, id, iActiveItem )         }     } }

Doc-Holiday 07-14-2012 03:37

Not sure if you guys understand him. In cs when you die a death anim is played. The player who died gets to watch himself die. He wants to remove the anim and instantly go to spectate

<VeCo> 07-14-2012 06:26

Re: Can't remove dead body (ClCorpse)
 
Quote:

Originally Posted by Doc-Holiday (Post 1749997)
Not sure if you guys understand him. In cs when you die a death anim is played. The player who died gets to watch himself die. He wants to remove the anim and instantly go to spectate

The code with EF_NODRAW should work like this.

Doc-Holiday 07-14-2012 11:37

Re: Can't remove dead body (ClCorpse)
 
Quote:

Originally Posted by <VeCo> (Post 1750065)
The code with EF_NODRAW should work like this.

Should... I cant see code from my phone when i sent the message it just shows empty message.


All times are GMT -4. The time now is 15:23.

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