public Menu_DarBofetada(id)
{
new szMenu[84]
formatex(szMenu, charsmax(szMenu), "Menu Test")
new menu = menu_create(szMenu, "Menu_DarBofetada_Handler")
new players[32], num, name[32], szTempid[7] = (2,3,4,5,6,7)
get_players(players, num, "ach")
I made this Slap Menu, it has an option to choose the slap dmg.
But if there is alot of people online, the menu will have more than 1 page, and that option only appears on the first page, is there any way to make it appear on all pages?
Like this:
Quote:
Menu | Page 1/3
1. Slap Dmg: X
2. Player 1
3. Player 2
4. Player 3
5. Player 4
Next
Back
Exit
Quote:
Menu | Page 2/3
1. Slap Dmg: X
2. Player 5
3. Player 6
4. Player 7
5. Player 8
Next
Back
Exit
Quote:
Menu | Page 3/3
1. Slap Dmg: X
2. Player 9
3. Player 10
4. Player 11
5. Player 12
Next
Back
Exit
fysiks
05-30-2015 17:48
Re: [Help] Option stays on Menu
The original slap menu already does this. Take a look at it.
Syturi0
05-30-2015 17:57
Re: [Help] Option stays on Menu
Quote:
Originally Posted by fysiks
(Post 2302889)
The original slap menu already does this. Take a look at it.
Spoiler
PHP Code:
public actionSlapMenu(id, key)
{
switch (key)
{
case 7:
{
++g_menuOption[id]
displaySlapMenu(id, g_menuPosition[id]);
}
case 8: displaySlapMenu(id, ++g_menuPosition[id])
case 9: displaySlapMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name2[32]
public cmdSlapMenu(id, level, cid)
{
if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED
g_menuOption[id] = 0
if (ArraySize(g_slapsettings) > 0)
{
g_menuSettings[id] = ArrayGetCell(g_slapsettings, g_menuOption[id]);
}
else
{
// should never happen, but failsafe
g_menuSettings[id] = 0
}
displaySlapMenu(id, g_menuPosition[id] = 0)
return PLUGIN_HANDLED
}
The original slap menu is a mess and disorganized. I cant really understand it properly. :cry:
fysiks
05-31-2015 03:18
Re: [Help] Option stays on Menu
Quote:
Originally Posted by Syturi0
(Post 2302896)
The original slap menu is a mess and disorganized. I cant really understand it properly. :cry:
No, the slap menu code is not messy. You just need to take some time to learn how it works. Generally, things look more complicated when you are used to using an abstraction layer like newmenus.inc.
Syturi0
05-31-2015 03:22
Re: [Help] Option stays on Menu
Quote:
Originally Posted by fysiks
(Post 2303082)
No, the slap menu code is not messy. You just need to take some time to learn how it works. Generally, things look more complicated when you are used to using an abstraction layer like newmenus.inc.
If no one teachs me it will be much harder to learn :(
newmenus.inc is much easier and simple
fysiks
05-31-2015 03:28
Re: [Help] Option stays on Menu
Quote:
Originally Posted by Syturi0
(Post 2303084)
If no one teachs me it will be much harder to learn
That is what lazy people say. In a case like this, I would say the exact opposite.
Syturi0
06-07-2015 09:28
Re: [Help] Option stays on Menu
bump
fysiks
06-07-2015 09:34
Re: [Help] Option stays on Menu
Quote:
Originally Posted by fysiks
(Post 2302889)
The original slap menu already does this. Take a look at it.
Syturi0
06-07-2015 10:19
Re: [Help] Option stays on Menu
Quote:
Originally Posted by fysiks
(Post 2302889)
The original slap menu already does this. Take a look at it.
Quote:
Spoiler
PHP Code:
public actionSlapMenu(id, key)
{
switch (key)
{
case 7:
{
++g_menuOption[id]
displaySlapMenu(id, g_menuPosition[id]);
}
case 8: displaySlapMenu(id, ++g_menuPosition[id])
case 9: displaySlapMenu(id, --g_menuPosition[id])
default:
{
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name2[32]