Raised This Month: $12 Target: $400
 3% 

simple, n00b question.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
|2ob
Senior Member
Join Date: Mar 2004
Location: Ontario, Canada
Old 05-14-2004 , 02:53   simple, n00b question.
Reply With Quote #1

im a uber n00b with small coding, but i am trying to make a CZ bot commands plugin, how would i set a user defined # in a server_cmd

Code:
public bots() {     if (get_cvar_num("amx_bots_type")==1){         server_cmd("bot_quota)     } }

if someone types amx_bots 8
i want it to return bot_quota 8

do i use %s

like so

Code:
server_cmd("bot_quota %s")
__________________
24/7 Custom Maps Vitrus | Style by www.WebGZ.net
64.247.24.125:27015

Visit Vitrus's Clan Site!

I would put more, but they have a limit on chars
|2ob is offline
Send a message via AIM to |2ob Send a message via MSN to |2ob
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 05-14-2004 , 03:52  
Reply With Quote #2

You should probably check existing plugins how they do this stuff...





Code:
#include <amxmodx> #include <amxmisc> public myfunction_fn(id, level, cid) {     if (!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED     new arg[16]     read_argv(1, arg, 15)     new number = str_to_num(arg)     set_cvar_num("bot_quota", number)     return PLUGIN_HANDLED } public plugin_init() {     register_plugin(PLUGINNAME, VERSION, AUTHOR)     register_concmd("amx_bots", "myfunction", ADMIN_CFG, "<#> - specify a number") }

I'm just guessing here that bot_quota is a cvar, and that's how you would set such a cvar nicely.
Johnny got his gun 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 05:04.


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