AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   blocking event death msgs (https://forums.alliedmods.net/showthread.php?t=93819)

dstopgunner 06-02-2009 22:03

blocking event death msgs
 
Hello all I want to block message of people dying.
My code.

PHP Code:

register_event("DeathMsg","event_death","a"
public 
event_death() 
{    
 new 
id read_data(2)
 
set_msg_block(get_user_msgid("DeathMsg"),BLOCK_ONCE)


Weridly ,when I use this some players still show death messages while some dont.

I want 100% of them not showing deathmessages ,is there another way?

padilha007 06-02-2009 22:39

Re: blocking event death msgs
 
From [ZP] Round Draw Blast.

PHP Code:

{
    
// Blast sound
    
client_cmd(0"spk %s"sound_blast)
    
    static 
iddeathmsg_block
    
    
// Get current blocking state of the deathmsg
    
deathmsg_block get_msg_block(g_msgDeathMsg)
    
    
// Set it to blocked
    
set_msg_block(g_msgDeathMsgBLOCK_SET)
    
    
// "Eliminate" players
    
for (id 1id <= 32id++)
        if (
is_user_alive(id))
            
user_kill(idget_pcvar_num(cvar_keepfrags))
    
    
// Set the previous blocking state
    
set_msg_block(g_msgDeathMsgdeathmsg_block)



dstopgunner 06-02-2009 22:52

Re: blocking event death msgs
 
in event death i do...
PHP Code:

static iddeathmsg_block
   deathmsg_block 
get_msg_block(g_msgDeathMsg)
   
set_msg_block(g_msgDeathMsgBLOCK_SET)
   
set_msg_block(g_msgDeathMsgdeathmsg_block

Correct?

You didnt tell me g_msgdeathmsg..

Error: Undefined symbol "g_msgDeathMsg" on line 2064

fysiks 06-02-2009 23:18

Re: blocking event death msgs
 
Declare and set that variable with get_user_msgid("DeathMsg"). Don't take things in a code excerpt (example) literally.

dstopgunner 06-02-2009 23:27

Re: blocking event death msgs
 
so the is g_msgDeathMsg a float or num? or is it a id

PHP Code:

static iddeathmsg_block
   deathmsg_block 
get_msg_block(id)
   
set_msg_block(g_msgDeathMsgBLOCK_SET)
   
set_msg_block(g_msgDeathMsgdeathmsg_block

I just realised that static id isnt used at all.. so I guess g_msgDeathMsg is a id.
Ok Im confused , I too think that g_msgDeathMsg is something else...

fysiks 06-03-2009 00:16

Re: blocking event death msgs
 
It's an integer. "id" doesn't really mean anything, it's just what many use to represent a player's unique entity number in the game.

ConnorMcLeod 06-03-2009 00:53

Re: blocking event death msgs
 
Put this in plugin_init :

set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)


All times are GMT -4. The time now is 13:53.

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