AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   remove dead body/ghost(don't know how to call it)? (https://forums.alliedmods.net/showthread.php?t=45646)

jim_yang 10-08-2006 01:40

remove dead body/ghost(don't know how to call it)?
 
when someone has a net problem then he is out, but his float body remain in game. what is this body? is it still an entity? and when next round start, it's gone. but now i run csdm with no round end. so there are so many this XX remaining in game. how to remove them? thanks a lot and +kamma

teame06 10-08-2006 02:02

Re: remove dead body/ghost(don't know how to call it)?
 
By blocking the ClCorpse Event. There two ways you can block it. This code is setup for when CSDM is active. This should work with 2.1 not sure about 2.0

It not an entity either. Think it a brush or a temp entity or something.


PS. Not sure if this will block the ghost body for net problem but this will block the one left by player dying on a longer respawn time then 0.5 secs

Code:
#include <amxmodx> #include <csdm> #define OneWay new ClCorpse; public plugin_init() {     register_plugin("Corpses", "1.0", "What");     ClCorpse = get_user_msgid("ClCorpse");     #if !defined OneWay     register_message(ClCorpse, "Corpse");     #endif } #if defined OneWay public csdm_StateChange(csdm_state) {     switch(csdm_state)     {         case CSDM_ENABLE:             set_msg_block(ClCorpse, BLOCK_SET);         case CSDM_DISABLE:             set_msg_block(ClCorpse, BLOCK_NOT);     } } #else public Corpse() {     if(csdm_active())         return PLUGIN_HANDLED;     return PLUGIN_CONTINUE; } #endif

jim_yang 10-09-2006 03:02

Re: remove dead body/ghost(don't know how to call it)?
 
thank you! tested it for two days, it's excellent!

bibu 01-31-2013 08:37

Re: remove dead body/ghost(don't know how to call it)?
 
How to make this for individual players? I tried to get the player id and block it, seems like it doesn't work for me:

PHP Code:

enum
{    
    
ClCorpse_ModelName 1// string
    
ClCorpse_CoordX // long
    
ClCorpse_CoordY// long
    
ClCorpse_CoordZ// long
    
ClCorpse_Angle0 // coord
    
ClCorpse_Angle1// coord
    
ClCorpse_Angle2// coord
    
ClCorpse_Delay// long
    
ClCorpse_Sequence // byte
    
ClCorpse_ClassID// byte
    
ClCorpse_TeamID// byte
    
ClCorpse_PlayerID// byte
}

new 
g_MsgClCorpse

public plugin_init()
{
    
g_MsgClCorpse get_user_msgid("ClCorpse")
    
register_message(g_MsgClCorpse"Message_ClCorpse")
}

public 
Message_ClCorpse()
{    
    new 
id read_data(ClCorpse_PlayerID)
    
    if(
g_bBlockBody[id]) //this is for sure setted true
    
{
        
client_print(0print_chat"blocked corpse")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE



ConnorMcLeod 01-31-2013 11:31

Re: remove dead body/ghost(don't know how to call it)?
 
If enum is ok, code is ok

bibu 01-31-2013 11:37

Re: remove dead body/ghost(don't know how to call it)?
 
Could you also test it please?

ConnorMcLeod 01-31-2013 14:14

Re: remove dead body/ghost(don't know how to call it)?
 
lol no, already used such code and was working.

bibu 02-01-2013 06:40

Re: remove dead body/ghost(don't know how to call it)?
 
I changed if(g_bBlockBody[id]) to if(is_user_connected(id)) and it still spawns the corpse.

Is there anyone else to test this beside arrogant connor?

ConnorMcLeod 02-01-2013 06:43

Re: remove dead body/ghost(don't know how to call it)?
 
I'm not arrogant, just telling you that the player id passed in the message is really the player id, so prevent corpse from being sent with index filter does work.

bibu 02-01-2013 06:56

Re: remove dead body/ghost(don't know how to call it)?
 
Tell me where my fault is then? I could only test this on pod bots.

EDIT: Tested also on me, and I see myself in free look. Btw, I even made a debug message before getting the id.


All times are GMT -4. The time now is 04:50.

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