Raised This Month: $ Target: $400
 0% 

blocking event death msgs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
dstopgunner
Senior Member
Join Date: Oct 2007
Old 06-02-2009 , 22:03   blocking event death msgs
Reply With Quote #1

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?
dstopgunner is offline
padilha007
Senior Member
Join Date: Jul 2008
Old 06-02-2009 , 22:39   Re: blocking event death msgs
Reply With Quote #2

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)

__________________

padilha007 is offline
dstopgunner
Senior Member
Join Date: Oct 2007
Old 06-02-2009 , 22:52   Re: blocking event death msgs
Reply With Quote #3

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
dstopgunner is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-02-2009 , 23:18   Re: blocking event death msgs
Reply With Quote #4

Declare and set that variable with get_user_msgid("DeathMsg"). Don't take things in a code excerpt (example) literally.
__________________

Last edited by fysiks; 06-02-2009 at 23:21.
fysiks is offline
dstopgunner
Senior Member
Join Date: Oct 2007
Old 06-02-2009 , 23:27   Re: blocking event death msgs
Reply With Quote #5

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...
dstopgunner is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-03-2009 , 00:16   Re: blocking event death msgs
Reply With Quote #6

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.
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-03-2009 , 00:53   Re: blocking event death msgs
Reply With Quote #7

Put this in plugin_init :

set_msg_block(get_user_msgid("DeathMsg"), BLOCK_SET)
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 13:53.


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