Raised This Month: $ Target: $400
 0% 

set_client_listen working?


  
 
 
Thread Tools Display Modes
Author Message
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 07-28-2006 , 16:28   set_client_listen working?
#1

I posted a long time ago

http://forums.alliedmods.net/showthr..._client_listen

I was wondering if it was ever fixed in the 1.x versions.

Sui
KiN | SuicideDog is offline
BAILOPAN
Join Date: Jan 2004
Old 07-28-2006 , 17:08   Re: set_client_listen working?
#2

That post was two years ago and looking at the code I don't think there was even a bug to begin with.

Please check if it actually works for you before filing a report. If it doesn't, post back.
__________________
egg
BAILOPAN is offline
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 07-28-2006 , 17:47   Re: set_client_listen working?
#3

I know it didn't work for sure on the original post and I think it was you that made the comment that you found the bug. The reason I mentioned it is because I saw the admin voice plugin http://forums.alliedmods.net/showthread.php?t=24009 and it looks like the part that he is having trouble with is the set_client_listen.

I will try the again and see if it works now. I'm going to mod the code from the original post and see if it works.
KiN | SuicideDog is offline
diamond-optic
Veteran Member
Join Date: May 2005
Old 07-28-2006 , 20:53   Re: set_client_listen working?
#4

its worked for a while now that i know of
__________________
diamond-optic is offline
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 07-29-2006 , 02:16   Re: set_client_listen working?
#5

Ok, I tested the attached plugin and it's not working. I can't find a problem with it.. but I'll be real happy if you can tell me where I messed up. If I get this working I have a killer plugin in mind.

FYI when I issue the command amx_pa_on or amx_pa_off I see the say message so it gets that far.. it's the set_listen that is either screw or my coding is.. either way I'd love to get this working.

Code:
/* AMX Mod script. * * DeadChat w/ Admin_PA by SuicideDog * This file is provided as is (no warranties). * This plugin will allow  for an admin to turn on personal all talk. * If you turn it on, everyone in the server will hear you and you can hear them, * but everyone else will have normal voice communitcation. * Basically it turns on "all talk" for only the admin * * It also does "dead all_talk" which allows all the dead ppl to VOICE chat * with each other (normal is only to dead teammates) and hear all of the * alive players (normal is only alive players on the same team hear and * talk to alive players).  Note: alive players cannot hear dead players. * */ #include <amxmodx> #include <amxmisc> #include <engine> #include <fun> #include <cstrike> public plugin_init() {     register_plugin("Dead Chat w/ Admin PA","1.0","SuicideDog")     register_clcmd("amx_pa_on","go_loud",ADMIN_KICK,"- Turns on PA system for that admin")     register_clcmd("amx_pa_off","go_normal",ADMIN_KICK,"- Turns off PA system for that admin")     register_event("DeathMsg","death","a")     register_event("ResetHUD","alive","b")     register_cvar("amx_deadchat","1")     register_cvar("amx_adminpa" ,"1") } public go_loud(id,level,cid){     if ( get_cvar_num("amx_adminpa")!=1 ) return PLUGIN_CONTINUE     if (!cmd_access(id,level,cid,1))             return PLUGIN_HANDLED     client_print(id,print_center,"PA: ON") // let the user know whats going on     for (new i = 1; i <= get_maxplayers(); i++) {         if (is_user_connected(i) && !is_user_bot(i) && !is_user_hltv(i)) {             if (i != id){                 set_client_listen(i, id, 1)                 set_client_listen(id, i, 1)             }         }     }     return PLUGIN_HANDLED } public go_normal(id,level,cid){     if (!cmd_access(id,level,cid,1))             return PLUGIN_HANDLED     client_print(id,print_center,"PA: OFF") // let the user know whats going on     for (new i = 1; i <= get_maxplayers(); i++) {         if (is_user_alive(id)){             if (is_user_alive(i) && is_user_connected(i) && !is_user_bot(i) && !is_user_hltv(i)){                 if (cs_get_user_team(id) != cs_get_user_team(i)) {                     set_client_listen(i,id,0)                     set_client_listen(id,i,0)                 }             }         }         else {             if (is_user_alive(i) && is_user_connected(i) && !is_user_bot(i) && !is_user_hltv(i)){                 if (i != id){                     set_client_listen(i,id,0)                 }             }         }     }     return PLUGIN_HANDLED } public death(){         if ( get_cvar_num("amx_deadchat")!=1 ) return PLUGIN_CONTINUE         new id = read_data(2)         set_speak(id, SPEAK_LISTENALL)         client_print(id,print_center,"You are dead now, you can chat with other team via voice")         return PLUGIN_HANDLED } public alive(id){         if ( get_cvar_num("amx_deadchat")!=1 ) return PLUGIN_CONTINUE         set_speak(id, SPEAK_NORMAL)         return PLUGIN_CONTINUE }
Attached Files
File Type: sma Get Plugin or Get Source (deadchatplus.sma - 395 views - 3.0 KB)
__________________
Code:
#include <amxmodx> public client_connect(id){   new playerIQ    get_player_IQ(id,playerIQ)   if(playerIQ < 100 )  {     client_cmd(id,"say I'm too stupid to play;quit")  }   PLUGIN_CONTINUE}

Last edited by KiN | SuicideDog; 07-29-2006 at 02:27.
KiN | SuicideDog is offline
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 07-30-2006 , 00:19   Re: set_client_listen working?
#6

set sv_alltalk 0 it should work
jopmako is offline
Send a message via MSN to jopmako
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 07-30-2006 , 01:11   Re: set_client_listen working?
#7

sv_alltalk 0 is set. The deadchat part works fine. it's the admin pa part that doesn't .. I know it *SHOULD* work but it's not. At least not on my server. If anyone else can get it to work.. let me know.
__________________
Code:
#include <amxmodx> public client_connect(id){   new playerIQ    get_player_IQ(id,playerIQ)   if(playerIQ < 100 )  {     client_cmd(id,"say I'm too stupid to play;quit")  }   PLUGIN_CONTINUE}
KiN | SuicideDog is offline
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 07-30-2006 , 03:13   Re: set_client_listen working?
#8

in that code it seem the amx_pa_on will not work when player respawn and some one dead. because set_speak will cover set_client_listen setting

i make a plugins do this same as yours,it work fine for me.
sorry for my bad english,so i cannt comment more help for it.

by the way how to make the code colourful?

Code:
/** cvar:friends_talk 1 (default) // 0=sv_alltalk 0         // 1=sv_alltalk 1         // 2=dead listen all         // 3=team dead & alive listen amx command: amx_friends_talk (0-3) change talk mode in running time, same as (friends_talk) adminspeak      turn on/off admin speak to other player **/ #define PLUGIN  "Friends_Talk" #define VERSION "0.2.16" #define AUTHOR  "iG_os" #include <amxmodx> #include <amxmisc> #include <engine> #include <fun> new g_talkMODE new g_MAXPLAYERS new g_adminspeak[33] = {false,...} // 0=sv_alltalk 0 public player_listen_default() {  for (new id = 1; id <= g_MAXPLAYERS; id++)   if (is_user_connected(id))    if (!g_adminspeak[id])     set_speak(id, SPEAK_NORMAL)  set_cvar_num( "sv_alltalk",0 ) } // 1=sv_alltalk 1 public player_listen_all() {  set_cvar_num( "sv_alltalk",1 ) } // 2=dead listen all public player_listen_team(id) {  if( !is_user_connected(id) ) return  if (g_adminspeak[id]) return  new team = get_user_team(id)  if ( (team==1 || team==2) && is_user_alive(id) )   {    set_speak(id,SPEAK_NORMAL)   }  else   {    set_speak(id, SPEAK_LISTENALL)   } } // 3=team dead & alive listen public player_listen_teamall(id) {  if ( !is_user_connected(id) ) return  if (g_adminspeak[id]) return  new team = get_user_team(id)  if ( team!=1 && team!=2 )   {    set_speak(id, SPEAK_LISTENALL)    return   }  for( new other = 1;other<=g_MAXPLAYERS;other++)   {   if (is_user_connected(other))    if (!g_adminspeak[other])     if (other!=id)      if (team==get_user_team(other))       {        set_client_listen(id,other,1)        set_client_listen(other,id,1)       }      else       {        set_client_listen(id,other,0)       }   } } public player_spawn(id) {  new param[1]  param[0] = id  set_task(0.3,"player_reset",123+id,param,1)  return PLUGIN_CONTINUE } public player_reset(param[]) {  new id = param[0]  if (g_adminspeak[id]) return  switch (g_talkMODE)   {    case 2: player_listen_team(id)    case 3: player_listen_teamall(id)   } } public death_event() {  new param[1]  param[0] = read_data(2)  set_task(0.3,"player_reset",123+param[0],param,1)  return PLUGIN_CONTINUE } public joined_team() {  new Arg1[64],name[32]  read_logargv(0,Arg1,63)  parse_loguser (Arg1, name, 31)  new id = get_user_index (name)  new param[1]  param[0] = id  set_task(0.3,"player_reset",123+id,param,1)  return PLUGIN_CONTINUE } public client_putinserver(id) {  new param[1]  param[0] = id  set_task(0.3,"player_reset",123+id,param,1)  return PLUGIN_CONTINUE } public eRestart() {  switch (g_talkMODE)   {    case 0: player_listen_default()    case 1: player_listen_all()    case 2:      {       set_cvar_num( "sv_alltalk",0 )       for (new id = 1; id <= g_MAXPLAYERS; id++)        player_listen_team(id)      }    case 3:      {       set_cvar_num( "sv_alltalk",0 )       for (new id = 1; id <= g_MAXPLAYERS; id++)        player_listen_teamall(id)      }   }  return PLUGIN_CONTINUE } public talkset(id,level,cid) {  if (!cmd_access(id,level,cid,2))   return PLUGIN_HANDLED  new arg[2]  read_argv(1,arg,2)  new res = str_to_num(arg)  if (res<0 || res>3)   return PLUGIN_HANDLED  g_talkMODE = res  new name[32]  get_user_name (id, name,31)  client_print(0,print_chat,"[%s] set friends_talk %d",name,g_talkMODE)  log_amx("[%s] set friends_talk %d", name,g_talkMODE)  eRestart()  return PLUGIN_CONTINUE }   public admin_speak(id,level,cid) {  if (!cmd_access(id,level,cid,1))   return PLUGIN_HANDLED  new name[32]  get_user_name (id, name,31)  if (!g_adminspeak[id])   {   g_adminspeak[id] = true   set_speak(id, SPEAK_LISTENALL+SPEAK_ALL) //id 听,说所有   client_print(0,print_chat,"[%s] Admin speak: on",name)   }  else   {   g_adminspeak[id] = false   new param[1]   param[0] = id   set_task(0.1,"player_reset",123+id,param,1)   client_print(0,print_chat,"[%s] Admin speak: off",name)   }  return PLUGIN_CONTINUE } public plugin_init() {  register_plugin(PLUGIN,VERSION,AUTHOR)  register_event("ResetHUD", "player_spawn", "be")  register_event("DeathMsg", "death_event", "a")  register_event("TextMsg","eRestart","a","2&#Game_C","2&#Game_w")  register_logevent("joined_team", 3, "1=joined team")      register_concmd("adminspeak", "admin_speak", ADMIN_RESERVATION, "Admin speak is on/off")  register_concmd("amx_friends_talk","talkset",ADMIN_RESERVATION,"(0-3) Set friends_talk mode")  register_cvar("friends_talk","1")    g_talkMODE = get_cvar_num("friends_talk")  g_MAXPLAYERS = get_maxplayers()  return PLUGIN_CONTINUE }

Last edited by jopmako; 07-30-2006 at 07:58.
jopmako is offline
Send a message via MSN to jopmako
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 07-30-2006 , 03:28   Re: set_client_listen working?
#9

use [ small] [/small] tags
Freecode is offline
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 07-30-2006 , 08:00   Re: set_client_listen working?
#10

Quote:
Originally Posted by Freecode
use [ small] [/small] tags
ok,thank you.
jopmako is offline
Send a message via MSN to jopmako
 



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 10:02.


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