AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   help server_cmd (https://forums.alliedmods.net/showthread.php?t=60293)

AdogeN 08-31-2007 05:13

help server_cmd
 
I want .
client say /voiceon or /voiceoff .
voice on off. Themselves.
Code:

#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "AGN"
 
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /voiceon", "action1")
register_clcmd("say /voiceoff", "action2")
}
public action1(id) {
server_cmd("sv_voiceenable 1")
client_print(id,print_chat,"[server] Voice On")
}
public action2(id) {
server_cmd("sv_voiceenable 0")
client_print(id,print_chat,"[server] Voice off")
}


vl@d 08-31-2007 07:30

Re: help server_cmd
 
dont understand.
You meen to have the players to turn that comand off and on when ever they wish?

Drak 08-31-2007 08:35

Re: help server_cmd
 
When using server command like that, it will disable it for the whole server.
The CVar maybe client side to. So doing "client_cmd" might work.

_Master_ 08-31-2007 11:17

Re: help server_cmd
 
NO.
sv_ cvars are active if running a server.
cl_ cvars are active client-side.

Search these forums to find out how you can enable/disable voicecom (other than std in-game mute menu)

M249-M4A1 08-31-2007 13:39

Re: help server_cmd
 
voice_enable works in client-side, it just disables your own voice communication (and you cant hear others too)

toazron1 08-31-2007 15:50

Re: help server_cmd
 
Plus you need to restart the game if you try to turn it back on after you shut it off, for NS anyway.


All times are GMT -4. The time now is 16:14.

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