Raised This Month: $ Target: $400
 0% 

set_client_listen not working?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 03-27-2004 , 18:39   set_client_listen not working?
Reply With Quote #1

I wrote this plugin.. it all works.. except the part of set_client_listen.. it doesn't give me any errors when compiling or running.. it just doesn't work.. is my logic flawed or something?



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") } public go_loud(id,level,cid){     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 }
__________________
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
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 03-27-2004 , 23:26  
Reply With Quote #2

any amxx dev team members able to help me here? I've tried a couple of different things.. and while it looks like my code is good.. it just doesn't work. Is there anyway I can get confirmation that the set_client_listen function works?
__________________
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
BAILOPAN
Join Date: Jan 2004
Old 03-27-2004 , 23:31  
Reply With Quote #3

does it work in AMX Mod? i.e. are yo uporting it?
__________________
egg
BAILOPAN is offline
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 03-27-2004 , 23:47  
Reply With Quote #4

I never tried it with amx, I'm not porting it, I just made it. I think it was in the fun module for amx but in the include it said it didn't work. Since you are getting all the amx stuff working that should have, I was hoping that it was fixed since it was in there. I have some really cool plugins in mind if it works.. I was thinking of things like team-members can hear other team-members whether they are dead or alive (no need for teamspeak or ventro for matches) or things like that.

I know the set_speak works.. and thanks for adding that function to the engine. I would really love to get the set_client_listen function working.
__________________
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
BAILOPAN
Join Date: Jan 2004
Old 03-27-2004 , 23:52  
Reply With Quote #5

Code:
static cell AMX_NATIVE_CALL set_client_listening(AMX *amx, cell *params) // set_client_listening(receiver, sender, listen); = 3 params
{
	// params[1] = receiver
	// params[2] = sender
	// params[3] = listen

	if (params[1] < 1 || params[1] > gpGlobals->maxClients
	|| params[2] < 1 || params[2] > gpGlobals->maxClients)
	{
		AMX_RAISEERROR(amx, AMX_ERR_NATIVE);
		return 0;
	}

	return SETCLIENTLISTENING(params[1], params[2], params[3]);
}
the error is in:
Code:
SETCLIENTLISTENING(params[1], params[2], params[3])
should be
Code:
SETCLIENTLISTENING(params[1], params[2], (params[3]?true:false))
will fix in next release
__________________
egg
BAILOPAN is offline
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 03-27-2004 , 23:55  
Reply With Quote #6

you da man.. can't wait.. so when you say next release.. do you mean next cvs build or next .1x version?

ps .. does the plugin look ok otherwise? as far as my logic? I know it's not the tightest peice of code.. but I started programing back in the day doing basic on a apple IIe before they had things like do while's and select case stuff .. if thens were your friends and I don't program for a living .. I just dabble
__________________
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
BAILOPAN
Join Date: Jan 2004
Old 03-27-2004 , 23:56  
Reply With Quote #7

0.20
don't expect it very soon, we are changing a lot

0.20 will make amxx truly different from amx 0.9.8
__________________
egg
BAILOPAN is offline
KiN | SuicideDog
Senior Member
Join Date: Mar 2004
Old 03-28-2004 , 00:02  
Reply With Quote #8

Quote:
Originally Posted by BAILOPAN
0.20
don't expect it very soon, we are changing a lot

0.20 will make amxx truly different from amx 0.9.8
/me is scared.. it took me this long to learn how to program basic crap for amx.. I hope I don't have to start from scratch again.
__________________
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
BAILOPAN
Join Date: Jan 2004
Old 03-28-2004 , 00:03  
Reply With Quote #9

you will not, it is the core that will be changing. scripting side will be completely the same.
__________________
egg
BAILOPAN is offline
CheesyPeteza
Senior Member
Join Date: Feb 2004
Location: UK
Old 03-28-2004 , 04:17  
Reply With Quote #10

It looks like high quality coding to me.
__________________
YO|Cheesy Peteza

[email protected]

CheesyPeteza 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 09:14.


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