Can someone help me with this menu here,
what I did here was the following, when the player destroys only one dispenser is destroyed now when there are two more dispensers he can choose which dispenser he wants to destroy that this function here
but I also put another thing when the admin needs to destroy a dispenser he can
So when admin destroy a dispenser all dispensers need to appear for him, but I do not know how to do this in handle can anyone help me ?
PHP Code:
public menu_admin_dispenser_destroy(id)
{
new menu = menu_create("Destruir Dispenser Menu:", "menu_admin_dispenser_destroy_handler");
new iEnt = -1;
new iLevel, iHealth, iOwner, sEntId[6];
while ((iEnt = engfunc(EngFunc_FindEntityByString, iEnt, "classname", dispenser_classname)))
{
if (!pev_valid(iEnt))
{
iOwner != id && is_user_admin(id)
if(iOwner != id && is_user_admin(id))
{
continue;
}
}
iLevel = pev(iEnt, DISPENSER_LEVEL);
iHealth = pev(iEnt, pev_health);
iOwner = pev(iEnt, DISPENSER_OWNER);
num_to_str(iEnt, sEntId, charsmax(sEntId));
if(is_user_admin(id))
menu_additem(menu, fmt("Level: [%2d], Vida: [%4d] Dono: [%n]", iLevel, iHealth, iOwner), sEntId);
else
menu_additem(menu, fmt("Level: [%2d], Vida:[%4d]", iLevel, iHealth), sEntId);
}
menu_display(id, menu, 0);
}
public menu_admin_dispenser_destroy_handler(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu);
return;
}
new szData[6], szName[64], access, callback;
menu_item_getinfo(menu, item, access, szData, charsmax(szData), szName, charsmax(szName), callback);
new ent = str_to_num(szData);
if(pev_valid(ent))
{
if()
new iOwner = pev(ent, DISPENSER_OWNER);
client_print_color(0, print_team_default, "%s ^3Você destruiu seu próprio ^4Dispenser^3", PREFIX_CHAT)
g_DispPlayerCount[iOwner]--;
xLimitGlobal[cs_get_user_team(iOwner)]--
isEnt[ent] = false
xRemoveEntFix(ent);
}
}