Raised This Month: $ Target: $400
 0% 

Show public message to one team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 11-11-2007 , 01:18   Show public message to one team
Reply With Quote #1

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();
    }

hlstriker is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 11-11-2007 , 05:22   Re: Show public message to one team
Reply With Quote #2

Remove the 3rd param from get_pdata_int(...)
Code:
get_pdata_int(players[i], 114);
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-11-2007 , 05:51   Re: Show public message to one team
Reply With Quote #3

Try to use MSG_ONE or MSG_ONE_UNRELIABLE
ConnorMcLeod is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 11-11-2007 , 13:19   Re: Show public message to one team
Reply With Quote #4

Quote:
Originally Posted by Alka View Post
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 View Post
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
hlstriker 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 01:17.


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