Raised This Month: $ Target: $400
 0% 

change message entiny


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-13-2009 , 09:54   change message entiny
Reply With Quote #1

I hooked message like this with register_message:
PHP Code:
    message_begin(MSG_ONE,g_msgStatusIcon,_,id);
    
write_byte(1);
    
write_string("c4");
    
write_byte(0);
    
write_byte(160);
    
write_byte(0);
    
message_end(); 
I know how to change 1st parameter second and so on..

But is that possible to change who is it send to? (in this case it's ID..)



Or the only way is to block this message and send another one? bcz when I'm doing that i have my server crash with error:
"MESSAGE_END called, but message buffer from .dll had overfollowed"

here is the code:
PHP Code:
public plugin_init()
{
    
g_msgStatusIcon  get_user_msgid("StatusIcon")
    
register_message(g_msgStatusIcon,"Message_StatusIcon")
}
public 
Message_StatusIcon(msg_id,msg_dest,msg_entity)
{
    if(
g_BombStatus==BOMB_NOT || g_BombStatus==BOMB_DROPPED ||
    !
g_NewRoundRespawn)
        return 
PLUGIN_CONTINUE;

    
server_print("Message_StatusIcon")
    
    
emessage_begin(MSG_ONE,g_msgStatusIcon,_,g_BombCarrier);
    
ewrite_byte(1);
    
ewrite_string("c4");
    
ewrite_byte(0); // colour Red
    
ewrite_byte(160); // colour Green
    
ewrite_byte(0); // colour Blue
    
emessage_end();
    
    
can_plant(g_BombCarrier,1)
    
can_plant(msg_entity,0)
    
    return 
PLUGIN_HANDLED;


Last edited by Empowers; 04-13-2009 at 10:02.
Empowers is offline
Send a message via ICQ to Empowers
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-13-2009 , 09:58   Re: change message entiny
Reply With Quote #2

See the code i gave you in previous thread, cs_set_user_plant send such a message.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-13-2009 , 10:05   Re: change message entiny
Reply With Quote #3

there is only score attribute code and set user plant skill
But I need to disable c4 Icon on PLayer1 screen.. And To Enable It on Player2 screen
Empowers is offline
Send a message via ICQ to Empowers
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-13-2009 , 10:10   Re: change message entiny
Reply With Quote #4

So the main question:
Is that possible to change message entity?

Any Suggestions?
Empowers is offline
Send a message via ICQ to Empowers
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-13-2009 , 10:38   Re: change message entiny
Reply With Quote #5

set_user_plant(id, 0) disable the icon i guess.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-13-2009 , 12:03   Re: change message entiny
Reply With Quote #6

Ok ;)

what about this :
Is that possible to change message entity?
Empowers is offline
Send a message via ICQ to Empowers
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-13-2009 , 12:04   Re: change message entiny
Reply With Quote #7

Not possible.
And it's not recommanded so send a new message during a message hook (register_message callback), so it would be better to use register_event.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Empowers
BANNED
Join Date: Feb 2009
Location: Ukraine
Old 04-13-2009 , 12:07   Re: change message entiny
Reply With Quote #8

ok thx
Empowers is offline
Send a message via ICQ to Empowers
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 02:19.


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