#include < amxmodx >
#include < fun >
new gPlayer[33];
public plugin_init()
register_clcmd("say /ghp", "ghp");
public ghp(id){
new pl[32], cnt;
get_players(pl, cnt, "ch");
new menu = menu_create("Выберите игрока", "handler");
for(new i,name[32], temp[4]; i < cnt; i ++){
get_user_name(pl[i], name, charsmax(name));
num_to_str(pl[i], temp, charsmax(temp));
menu_additem(menu, name, temp);
}
menu_display(id, menu);
}
public handler(id, menu, item){
if(item == MENU_EXIT)
return;
new data[30], name[64], callback, access;
menu_item_getinfo(menu, item, access, data, charsmax(data), name, charsmax(name), callback);
gPlayer[id] = str_to_num(data);
menu_hp(id);
}
public menu_hp(id){
new menu = menu_create("Выберите кол-во хп", "handler2");
menu_additem(menu, "+ 50HP", "50");
menu_additem(menu, "+ 100HP", "100");
menu_additem(menu, "+ 150HP", "150");
menu_display(id, menu);
}
public handler2(id, menu, item){
if(item == MENU_EXIT)
return;
new data[30], name[64], callback, access;
menu_item_getinfo(menu, item, access, data, charsmax(data), name, charsmax(name), callback);
set_user_health(gPlayer[id], get_user_health(gPlayer[id]) + str_to_num(data));
ghp(id);
}