Quote:
Originally Posted by Leon M.
Hi, that means you must specify the client who get this messages. (Allowed Numbers 1 - 32)
You could add check is_user_connected(id). If you want to send a message to all clients use message_begin(MSG_BROADCAST, msgid).
Greetz
Leon
|
Thanks for you quick reply

I have specifed the client who get this messages.
For example:
Code:
new g_msgScreenFade
public plugin_init()
{
register_logevent("RoundStart", 2, "1=Round_Start")
g_msgScreenFade = get_user_msgid("ScreenFade")
}
public RoundStart()
{
new iPlayers[32], iNum, id, iRandom[32], iRandomNum;
new origin[3], srco[3];
new playername[32];
get_players(iPlayers, iNum);
for ( new i = 0 ; i < iNum ; i++ )
{
id = iPlayers[i];
if ( cs_get_user_team(id) == CS_TEAM_CT )
{
iRandom[ iRandomNum++ ] = id;
g_mark = iRandom[ random( iRandomNum ) ];
}
}
if( !is_user_connected(g_mark) )
{
g_mark = 0
return
}
get_user_origin(g_mark , origin) //the plugin know who is the g_mark here, it can get the origin of the g_mark
origin[2] -= 26
srco[0] = origin[0] + 150
srco[1] = origin[1] + 150
srco[2] = origin[2] + 800
lightning_appear(srco, origin)//the plugin know who is the g_mark here, it can run the function of "lightning_appear" to the g_mark
cs_set_user_model(g_mark, "vip"))//the plugin also know who is the g_mark here, it can change the model of the g_mark to "vip"
flash_screen(g_mark) // But, when run the flash_screen which start with "message_begin", the plugin seems like lost the g_mark, it doesn`t run flash_screen to g_mark
get_user_name(g_mark, playername, 31)
client_print(0, print_chat, "some word"); //the code under the function "flash_screen", also doesn`t run ,it seem like, the code here still lost the g_mark
client_print(0, print_chat, "some word", playername);
}
stock flash_screen(id)
{
if( !is_user_connected(id) ) return
message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, id)
write_short(3000) // duration
write_short(1000) // hold time
write_short(0) // flags
write_byte(0) // red
write_byte(255) // green
write_byte(0) // blue
write_byte(100) // alpha
message_end();
}
why ?
__________________