I made a plugin , but i get errors in console server.
Code:
#include <amxmodx>
#include <amxmisc>
#include < hamsandwich >
#define PLUGIN "Hi bailopán."
#define VERSION "1.0"
#define AUTHOR "Luqqas"
const MAX_OPTIONS = 3
enum _:LOL
{
Option[32],
Max_Cost,
}
new const Faint[MAX_OPTIONS][LOL] =
{
{ "Opcion 1", 5 },
{ "Opcion 2", 4 },
{ "Opcion 3", 3 }
}
new menu
new MAX[33][MAX_OPTIONS]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("nightvision", "asd")
register_clcmd("say /resetcount", "clcmd_reset")
}
public asd(id)
{
menu = menu_create("FUN LUQQAS LOL", "zomg")
new Format[245], Posicion[MAX_OPTIONS]
for(new i = 0 ; i < MAX_OPTIONS; i++)
{
if(Faint[i][Max_Cost] == MAX[id][i])
formatex(Format, charsmax(Format), "%s [NO DISPONIBLE]", Faint[i][Option])
else
formatex(Format, charsmax(Format), "%s [%d/%d]", Faint[i][Option], MAX[id][i], Faint[i][Max_Cost])
num_to_str(i, Posicion, sizeof(Posicion))
menu_additem(menu, Format, Posicion)
}
menu_setprop(menu, MPROP_EXITNAME, "\ySalir")
menu_display(id, menu)
return PLUGIN_HANDLED
}
public zomg(id, menuid, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menuid)
return PLUGIN_HANDLED;
}
new buffer[MAX_OPTIONS], dummy
menu_item_getinfo(menuid, item, dummy, buffer, charsmax(buffer), _, _, dummy)
new lol
lol = str_to_num(buffer)
if(Faint[lol][Max_Cost] == MAX[id][lol])
{
client_print(id, print_center, "[ Limite Alcanzado. ]")
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
MAX[id][lol]++
client_print(id, print_center, "~ Opcion %d | Valor Max : %d", lol, MAX[id][lol])
menu_display(id, menu, 0)
return PLUGIN_HANDLED
}
public clcmd_reset(id)
{
for( new i = 0 ; i < MAX_OPTIONS ; i++)
MAX[id][i] = 0;
client_print(id, print_center, "[RESETEADO]")
}