Raised This Month: $ Target: $400
 0% 

disabling say or say_team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-22-2006 , 22:47   disabling say or say_team
Reply With Quote #1

how would i disable it so for anyone so when they say something it comes out as you were muted you may not speak or something
wonsae is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-22-2006 , 23:16  
Reply With Quote #2

Variables.
Code:
#include <amxmodx> new bool:cant_type[33]; public plugin_init() {   register_clcmd("say" , "hook_say");   register_clcmd("say_team" , "hook_say"); } public client_connect(id) {   cant_type[id] = false; } public hook_say(id) {   if(cant_type[id]) {     return PLUGIN_HANDLED;   }   return PLUGIN_CONTINUE; }

Now somewhere along the line you want to set cant_type[index] = true.
__________________
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
Rixorster
Senior Member
Join Date: Jul 2005
Old 03-23-2006 , 06:51  
Reply With Quote #3

Let's make it have CVAR
Code:
#include <amxmodx> public plugin_init() {   register_clcmd("say" , "hook_say");   register_clcmd("say_team" , "hook_say");   register_cvar("allowtalk","1") } public hook_say(id) {   new allowtalk[64]   new talkallow = get_cvar_string("allowtalk",allowtalk,63)   if(talkallow != 1) {     return PLUGIN_HANDLED;   }   return PLUGIN_CONTINUE; }
Maybe, not really sure about cvar stuff >_>
__________________
You never know, what will happen the day after tomorrow...

+karma if i helped you!
Rixorster is offline
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 03-23-2006 , 07:40  
Reply With Quote #4

Code:
#include <amxmodx> public plugin_init() {     register_clcmd("say" , "hook_say");     register_clcmd("say_team" , "hook_say");     register_cvar("allowtalk","1"); } public hook_say(id) {     if(get_cvar_num("allowtalk" ) != 1)         return PLUGIN_HANDLED;     return PLUGIN_CONTINUE; }

thats the correct version
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-23-2006 , 09:04  
Reply With Quote #5

Code:
#include <amxmodx> public plugin_init() {     register_clcmd("say" , "hook_say");     register_clcmd("say_team" , "hook_say");     register_cvar("allowtalk","1"); } public hook_say(id) {     if(get_cvar_num("allowtalk" ) != 1)                 client_print(id,print_chat,"[AMXX] You may not speak now.")         return PLUGIN_HANDLED;     return PLUGIN_CONTINUE; }
so something like this?
wonsae is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-23-2006 , 09:13  
Reply With Quote #6

Something more like this:
Code:
#include <amxmodx> public plugin_init() {     register_clcmd("say" , "hook_say");     register_clcmd("say_team" , "hook_say");     register_cvar("allowtalk","1"); } public hook_say(id) {     if(!get_cvar_num("allowtalk"))     {         client_print(id,print_chat,"[AMXX] You may not speak now.");         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }

Or in AMXX 1.70 or later...

Code:
#include <amxmodx> new g_cvarAllowTalk; public plugin_init() {     register_clcmd("say" , "hook_say");     register_clcmd("say_team" , "hook_say");     g_cvarAllowTalk = register_cvar("allowtalk","1"); } public hook_say(id) {     if(!get_pcvar_num(g_cvarAllowTalk))     {         client_print(id,print_chat,"[AMXX] You may not speak now.");         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }
Brad is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 03-23-2006 , 09:16  
Reply With Quote #7

Using a CVAR in this way is more of a global way to allow/disallow talking. Do you want everyone to be able to talk or not talk or just specific people?
Brad is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-23-2006 , 15:13  
Reply With Quote #8

Quote:
Originally Posted by Brad
Something more like this:
Code:
#include <amxmodx> public plugin_init() {     register_clcmd("say" , "hook_say");     register_clcmd("say_team" , "hook_say");     register_cvar("allowtalk","1"); } public hook_say(id) {     if(!get_cvar_num("allowtalk"))     {         client_print(id,print_chat,"[AMXX] You may not speak now.");         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }

Or in AMXX 1.70 or later...

Code:
#include <amxmodx> new g_cvarAllowTalk; public plugin_init() {     register_clcmd("say" , "hook_say");     register_clcmd("say_team" , "hook_say");     g_cvarAllowTalk = register_cvar("allowtalk","1"); } public hook_say(id) {     if(!get_pcvar_num(g_cvarAllowTalk))     {         client_print(id,print_chat,"[AMXX] You may not speak now.");         return PLUGIN_HANDLED;     }     return PLUGIN_CONTINUE; }
this is for amxx 1.01 and the specialists
wonsae is offline
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-23-2006 , 15:25  
Reply With Quote #9

Quote:
Originally Posted by Brad
Using a CVAR in this way is more of a global way to allow/disallow talking. Do you want everyone to be able to talk or not talk or just specific people?
specific people
wonsae is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-23-2006 , 16:00  
Reply With Quote #10

Use my way then.
__________________
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
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 16:29.


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