AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Show public message to one team (https://forums.alliedmods.net/showthread.php?t=63067)

hlstriker 11-11-2007 01:18

Show public message to one team
 
I'm trying to show a hostage death to CT only. The code I tried using will show it to both terrorist and counter-terrorist so I guess if you send the message to one player it will auto send it to all players.

I also tried to block the message but it seems you can't block messages you create in the plugin?

Here is my code:
PHP Code:

new playerCountiplayers[32], team;
get_players(playersplayerCount"ach");
for(
i=0i<playerCounti++)
{
    
team get_pdata_int(players[i], 1145);
    if(
team == 2)
    {
        
message_begin(MSG_ALLget_user_msgid("HostagePos"), {0,0,0}, players[i]);
        
write_byte(1);
        
write_byte(1);
        
write_coord(floatround(entOrigin[0]));
        
write_coord(floatround(entOrigin[1]));
        
write_coord(floatround(entOrigin[2]));
        
message_end();
        
        
message_begin(MSG_ALLget_user_msgid("HostageK"), {0,0,0}, players[i]);
        
write_byte(1);
        
message_end();
    }



Alka 11-11-2007 05:22

Re: Show public message to one team
 
Remove the 3rd param from get_pdata_int(...)
Code:

get_pdata_int(players[i], 114);

ConnorMcLeod 11-11-2007 05:51

Re: Show public message to one team
 
Try to use MSG_ONE or MSG_ONE_UNRELIABLE

hlstriker 11-11-2007 13:19

Re: Show public message to one team
 
Quote:

Originally Posted by Alka (Post 551668)
Remove the 3rd param from get_pdata_int(...)
Code:

get_pdata_int(players[i], 114);

Alright, but why is that?

Quote:

Originally Posted by connorr (Post 551673)
Try to use MSG_ONE or MSG_ONE_UNRELIABLE

Wow... I must have really been tired last night for me to not see that I used MSG_ALL o.O


All times are GMT -4. The time now is 01:17.

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