AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   change message entiny (https://forums.alliedmods.net/showthread.php?t=90045)

Empowers 04-13-2009 09:54

change message entiny
 
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;



ConnorMcLeod 04-13-2009 09:58

Re: change message entiny
 
See the code i gave you in previous thread, cs_set_user_plant send such a message.

Empowers 04-13-2009 10:05

Re: change message entiny
 
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 04-13-2009 10:10

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

Any Suggestions?

ConnorMcLeod 04-13-2009 10:38

Re: change message entiny
 
set_user_plant(id, 0) disable the icon i guess.

Empowers 04-13-2009 12:03

Re: change message entiny
 
Ok ;)

what about this:) :
Is that possible to change message entity?

ConnorMcLeod 04-13-2009 12:04

Re: change message entiny
 
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.

Empowers 04-13-2009 12:07

Re: change message entiny
 
ok thx :)


All times are GMT -4. The time now is 02:19.

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