Raised This Month: $ Target: $400
 0% 

[Solved] Only specific players can see player's message


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OxidedMaze
Junior Member
Join Date: Jul 2013
Old 07-11-2013 , 06:37   [Solved] Only specific players can see player's message
Reply With Quote #1

Hi everyone , is it possible that when players enter a message , only players within a specific distance from that player can see the message , and blocks other players from seeing the message?

Last edited by OxidedMaze; 07-11-2013 at 09:11.
OxidedMaze is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 07-11-2013 , 06:45   Re: Only specific players can see player's message
Reply With Quote #2

Get all alive players using get_players with the proper flags and loop through them checking the distance between you and the player using get_distance or get_distance_f. When a player is in range, send him the message via client_print, colorchat or however you want.

Last edited by SpeeDeeR; 07-11-2013 at 06:48.
SpeeDeeR is offline
OxidedMaze
Junior Member
Join Date: Jul 2013
Old 07-11-2013 , 07:22   Re: Only specific players can see player's message
Reply With Quote #3

Quote:
Originally Posted by SpeeDeeR View Post
Get all alive players using get_players with the proper flags and loop through them checking the distance between you and the player using get_distance or get_distance_f. When a player is in range, send him the message via client_print, colorchat or however you want.
thx for reply , but still 1 problem unsolved
what I mean is , when player uses "Say" to say messages , all players can see the message , but I want to block the message from being sent to other players out of range , is it possible?
OxidedMaze is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 07-11-2013 , 07:37   Re: Only specific players can see player's message
Reply With Quote #4

A way that could work is to hook SayText using register_message and check the distance between sender and receiver and if they are not i range return plugin_handled.
SpeeDeeR is offline
OxidedMaze
Junior Member
Join Date: Jul 2013
Old 07-11-2013 , 09:08   Re: Only specific players can see player's message
Reply With Quote #5

Quote:
Originally Posted by SpeeDeeR View Post
A way that could work is to hook SayText using register_message and check the distance between sender and receiver and if they are not i range return plugin_handled.
Solved , thank you very much
OxidedMaze 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 06:30.


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