Raised This Month: $ Target: $400
 0% 

Restricting player voice


Post New Thread Reply   
 
Thread Tools Display Modes
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
BAILOPAN
Join Date: Jan 2004
Old 10-12-2004 , 20:18  
Reply With Quote #2

maybe it's possible to use fakemeta module to hook when a player starts speaking... not sure.

but on a 32player server this will execute 900 loops every frame or something, probably not a good idea ;]

you could restrict this by finding out who is currently using the mic (somehow)
__________________
egg
BAILOPAN is offline
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 10-12-2004 , 22:51  
Reply With Quote #3

You could also try to hook when the icon is being placed on the hud or over someones head.
EKS is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-12-2004 , 23:31  
Reply With Quote #4

Never thought of that. Any ideas on how to hook the sprite icons?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 10-12-2004 , 23:49  
Reply With Quote #5

proberbly via 1 of these events:
Quote:
StatusValue 105 -1
StatusText 106 -1
StatusIcon 107 -1
EKS is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-08-2005 , 10:51  
Reply With Quote #6

EKS: nope, unfortunately mic icon != status icon

I tried:
1) catch event
2) catch client command
3) register voice forwards (fakemeta)

No one can catch voice...

PS: Its so hard as catching equiping a shield!
VEN is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 10-08-2005 , 10:59  
Reply With Quote #7

HOLY SHIT!

Way to bump a 1-year-old post..
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Anthraxnz
Senior Member
Join Date: May 2005
Location: New Zealand
Old 10-08-2005 , 11:06  
Reply With Quote #8

lol.

wots wif the ;'s
__________________
Dont know how to add admins?

use my program
http://www.amxmodx.org/forums/viewto...=129092#129092

it does the work for you ... sort of
Anthraxnz is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 10-08-2005 , 13:51  
Reply With Quote #9

v3x:
I just tryinig to help people who have the same problem of catching voicerecord
I'm sure there are some of them
I made some researches and just report about results
I leave previous post just in hope it would be useful to people who trying to find a way of solve this task

Is it restricted to post in "old" topics? Nothing agains u vex. If i was wrong with something, please PM me. Thanks.
To man who decrease my karma: please PM me why u do it
VEN is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 10-08-2005 , 15:21  
Reply With Quote #10

Quote:
Originally Posted by VEN
To man who decrease my karma: please PM me why u do it
I'm not sure who did it, but I'm pretty sure the point of it is to be anonymous, otherwise you would be able to view a list of who has affected your karma.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 17:26.


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