I want to make a command that changes server's current password immediately. A say command like; .svpass <newPassword>
I made a code that works but not properly. If I use "say .svpass 12345" via console, it works. But it doesnt when I try do this by pressing "y" key to say, then type .svpass 12345 , nothing happens.
Here is what I coded :
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say .svpass", "pass")
}
public pass (id) {
new newpass[32]
read_argv(1, newpass, 31)
server_cmd("sv_password %s", newpass)
return PLUGIN_HANDLED
}