Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Crappy Plugin"
#define VERSION "1.0"
#define AUTHOR "CrapperCoder420"
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("buy", "CrappyBuyFunction", ADMIN_BAN, "buy [item] [ammount]")
}
public CrappybuyFunction(id, level, cid)
{
// This checks to see if the person who executed the command
// is in fact an admin, and passed 3 arguments into console
// 0 = command; 1 = item; 2 = ammount
// if not it simply returns out of the plugin and goes on with tis day
if(!cmd_access(id, level, cid, 3)
return PLUGIN_HANDLED
// This grabs the first argument from the command passed
// and saves it to the defined sz_item
new sz_item[32]; read_argv(1, sz_item, charsmax(sz_item) )
// This grabs the second argument from the command line
// and saves it to the defined sz_ammount string
new sz_ammount[32]; read_argv(2, sz_ammount, charsmax(sz_ammount) )
// I ignore the item because i odn't know really what you want to do
// I set sz_ammount to the ammount variable
// this is saved as an int/number/decimal using str_to_num
// which takes a string, parses it into a number, and returns it
new ammount = str_to_num(sz_ammount)
// I then return the ammount; Just to show it did something.
return ammount
}
__________________