Raised This Month: $ Target: $400
 0% 

Restricting player voice


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-12-2004 , 20:06   Restricting player voice
Reply With Quote #1

Hello.

I'm trying to get it so that only people within a certain distance of you can hear you. This is the code I have...

Code:
 public client_PreThink(id) {
  new origin[3];
  get_user_origin(id,origin);

  new players[32], num;
  get_players(players,num);

  for(new i=0;i<num;i++) {
   new player = players[i], porigin[3];
   get_user_origin(player,porigin);

   if(get_distance(origin,porigin) <= speakdistance) {
    set_client_listen(player,id,1);
   }
   else {
    set_client_listen(player,id,0);
   }
  }
 }
Obviously, however, since it is ran with client_PreThink, it is clunky and causes lag. Ideas?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
 


Thread Tools
Display Modes

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 17:26.


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