FirstPlugin [hp]
I can not get the menu to open up there no errors and no log errors can anyone help me so i can see the menu in game Thank you your help!!
PHP Code:
[CODE][HTML]#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#include <cstrike>
#include <fakemeta>
#define PLUGIN "Health"
#define VERSION "1.0"
#define AUTHOR "Pastout"
new gKeysHealthMenu;
new gszHealthMenu[256];
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /lucky", "show(HealthMenu");
createMenus();
register_menucmd(register_menuid("HealthMenu"), gKeysHealthMenu, "handleHealthMenu");
register_cvar("healamount", "10.0");
register_event("TextMsg", "eventRoundRestart", "a", "2&#Game_C", "2&#Game_w");
}
enum
{
N1, N2, N3, N4, N5, N6, N7, N8, N9, N0
};
enum
{
B1 = 1 << N1, B2 = 1 << N2, B3 = 1 << N3, B4 = 1 << N4, B5 = 1 << N5,
B6 = 1 << N6, B7 = 1 << N7, B8 = 1 << N8, B9 = 1 << N9, B0 = 1 << N0,
};
createMenus()
{
//create main menu
new size = sizeof(gszHealthMenu);
add(gszHealthMenu, size, "\yHealth Menu^n^n");
add(gszHealthMenu, size, "\r1. \wHP 10^n");
add(gszHealthMenu, size, "\r2. \wHP 20^n");
add(gszHealthMenu, size, "\r3. \wHP 30^n");
add(gszHealthMenu, size, "\r4. \wHP 40^n");
add(gszHealthMenu, size, "\r5. \wHP 50^n");
add(gszHealthMenu, size, "\r6. \wHP 60^n");
add(gszHealthMenu, size, "\r7. \wHP 70^n");
add(gszHealthMenu, size, "\r8. \wHP 80^n");
add(gszHealthMenu, size, "\r9. \wHP 90^n");
add(gszHealthMenu, size, "\r0. \wClose");
gKeysHealthMenu = B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 | B0;
}
public showHealthMenu(id)
{
new col[3];
new szMenu[256];
new szHealth[8];
//format the main menu
format(szMenu, 256, gszHealthMenu, col, szHealth, col, szHealth, col, szHealth, col, szHealth, col, szHealth);
//show the main menu to the player
show_menu(id, gKeysHealthMenu, szMenu, -1, "HealthMenu");
return PLUGIN_HANDLED;
}
public handleHealthMenu(id, num)
{
switch (num)
{
case N1: { Health10(id); }
case N2: { Health20(id); }
case N3: { Health30(id); }
case N4: { Health40(id); }
case N5: { Health50(id); }
case N6: { Health60(id); }
case N7: { Health70(id); }
case N8: { Health80(id); }
case N9: { Health90(id); }
case N0: { return; }
}
}
Health10(id)
{
new hp = get_user_health( id );
new amount = floatround(get_cvar_float("healamount"), floatround_floor);
new sum = (hp + amount);
if (sum < 100)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
}
Health20(id)
{
new hp = get_user_health( id );
new amount = floatround(get_cvar_float("healamount"), floatround_floor);
new sum = (hp + amount);
if (sum < 100)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
}
Health30(id)
{
new hp = get_user_health(id);
new amount = floatround(get_cvar_float("healamount"), floatround_floor);
new sum = (hp + amount);
if (sum < 100)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
}
Health40(id)
{
new hp = get_user_health(id);
new amount = floatround(get_cvar_float("healamount"), floatround_floor);
new sum = (hp + amount);
if (sum < 100)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
}
Health50(id)
{
new hp = get_user_health(id);
new amount = floatround(get_cvar_float("healamount"), floatround_floor);
new sum = (hp + amount);
if (sum < 100)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
}
Health60(id)
{
new hp = get_user_health(id);
new amount = floatround(get_cvar_float("healamount"), floatround_floor);
new sum = (hp + amount);
if (sum < 100)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
}
Health70(id)
{
new hp = get_user_health(id);
new amount = floatround(get_cvar_float("healamount"), floatround_floor);
new sum = (hp + amount);
if (sum < 100)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
}
Health80(id)
{
new hp = get_user_health(id);
new amount = floatround(get_cvar_float("healamount"), floatround_floor);
new sum = (hp + amount);
if (sum < 100)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
}
Health90(id)
{
new hp = get_user_health(id);
new amount = floatround(get_cvar_float("healamount"), floatround_floor);
new sum = (hp + amount);
if (sum < 100)
{
set_user_health(id, sum);
}
else
{
set_user_health(id, 100);
}
}[/HTML][/CODE]
|