Raised This Month: $ Target: $400
 0% 

command value not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
urban_ninja
Senior Member
Join Date: Feb 2009
Old 12-08-2011 , 09:09   Re: command value not working
Reply With Quote #1

Quote:
It works fine for me when I changed "bot" to "shr" for DOD. Which means that everything that I wrote works fine. Maybe you are using the wrong format of command for your bot program.
The command format for foxbot is all bot commands have to be prefixed by "bot" with quotes and then the bot command with quotes("bot" "bot_max #"). Use that command format through rcon and it works but I dont want to give full access to admins just for bot commands. The admin mod foxbot control plugin also uses the same command format.

I just need a foxbot control plugin to replace the one from admin mod so I can finally get rid of admin mod.
__________________
urban_ninja is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-08-2011 , 16:17   Re: command value not working
Reply With Quote #2

Quote:
Originally Posted by urban_ninja View Post
The command format for foxbot is all bot commands have to be prefixed by "bot" with quotes and then the bot command with quotes("bot" "bot_max #"). Use that command format through rcon and it works but I dont want to give full access to admins just for bot commands. The admin mod foxbot control plugin also uses the same command format.

I just need a foxbot control plugin to replace the one from admin mod so I can finally get rid of admin mod.
Are you saying you are supposed to have quotes around the word bot? If yes, then you forgot to do that. If no then I don't see anything wrong.
__________________
fysiks is offline
Vet
Veteran Member
Join Date: Jul 2006
Location: I|O wa
Old 12-26-2011 , 22:24   Re: command value not working
Reply With Quote #3

Try this. Its a snippet of what works on our server. It also adds a check to ensure the bot value is
within a specific range (edit for you needs) and reports the change in chat. Requires admin level 'f'.

Code:
#include <amxmodx>

#define PLUGIN "AMX Bot Control"
#define VERSION "1.0"
#define AUTHOR "Vet(3TT3V)"

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR)
        register_concmd("amx_bot_max", "BotCon", ADMIN_MAP)
}

public BotCon(id, lvl, cid)
{
	if (!cmd_access(id, lvl, cid, 2))
		return PLUGIN_HANDLED

	new arg[8]
	new tmpint
	read_argv(1, arg, 7)
	tmpint = str_to_num(arg)
	if (tmpint < 1 || tmpint > 19) {
		console_print(id, "Number out of range (1 - 19)")
		return PLUGIN_HANDLED
	}
	new tmpstr[32]
	format(tmpstr, 31, "bot ^"max_bots %d^"", tmpint)
	server_cmd(tmpstr)

	console_print(id, "max_bots set to %d", tmpint)
	get_user_name(id, tmpstr, 31)
	log_message("[AMXX] Admin %s set max_bots to %d", tmpstr, tmpint)
	if (get_cvar_num("amx_show_activity") == 2)
		client_print(0, print_chat, "ADMIN %s: set max_bots to %d", tmpstr, tmpint)

	return PLUGIN_HANDLED
}
FYI, per the Foxbot instructions I've read, the prefix is NOT surrounded by quotes.
An example RCON command would be: RCON bot "max_bots 10"
__________________
=====================================
- My Plugins -
=====================================
Vet is offline
Send a message via MSN to Vet
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 12:11.


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