AddMenuItem
#1

We all know that menus have a limit to the amount of items that can be listed (12), so is there a way to check if a menu already has those 12 items? Once the 12 items are taken, I'm trying to create another menu to be filled with more items, yet I'm clueless how to detect the amount of items in a menu.
If anyone knows a method or has an idea, please do post it.
Reply
#2

Well it's very easy

Код:
yourmenu = CreateMenu("CarMenu pg. I", 1, 50.0, 180.0, 200.0, 200.0);//>>>>menu 1
AddMenuItem(carmenu,0,"Suvs & Wagons");   // 1st item
AddMenuItem(carmenu,0,"2-doors sedans & compact I");//2nd item
AddMenuItem(carmenu,0,"2-doors sedans & compact II");  // 3
AddMenuItem(carmenu,0,"4-doors luxury sedans I"); // 4
AddMenuItem(carmenu,0,"4-doors luxury sedans II"); // 5
AddMenuItem(carmenu,0,"Muscle cars");   // 6
AddMenuItem(carmenu,0,"Street racers");  // 7
 AddMenuItem(carmenu,0,"Next Page");   // 8th item
so you can add only 12 AddMenuitem(----------------------);
Reply
#3

Quote:
Originally Posted by mannu
Well it's very easy

Код:
yourmenu = CreateMenu("CarMenu pg. I", 1, 50.0, 180.0, 200.0, 200.0);//>>>>menu 1
AddMenuItem(carmenu,0,"Suvs & Wagons");  // 1st item
AddMenuItem(carmenu,0,"2-doors sedans & compact I");//2nd item
AddMenuItem(carmenu,0,"2-doors sedans & compact II"); // 3
AddMenuItem(carmenu,0,"4-doors luxury sedans I"); // 4
AddMenuItem(carmenu,0,"4-doors luxury sedans II"); // 5
AddMenuItem(carmenu,0,"Muscle cars");   // 6
AddMenuItem(carmenu,0,"Street racers");  // 7
 AddMenuItem(carmenu,0,"Next Page");  // 8th item
so you can add only 12 AddMenuitem(----------------------);
Well, I mean an updating set of menus. I'm trying to create something that reads from a file that is updated by the players on the SAMP server via command. An in-game forum, if you will.

As an example:
*The topic poster posts 12 times in the forum, thus creating 12 menu items.
*When the next topic is posted, it should automatically create another menu to be filled up with other topics.
Reply
#4

use Public OnPlayerUpdate
Reply
#5

You still don't understand what I'm saying.
I'll just create my own inexistant functions as an example.

Код:
Taco = CreateMenu(title[], columns, ITEMS, Float:x, Float:y, Float:col1width, Float:col2width);

if(ITEMS > 12)
{
     CreateMenu(title[], columns, items, Float:x, Float:y, Float:col1width, Float:col2width);
     return 1;
}
or possibly even something like:
Код:
GetMenuItems(Menu:menuid, items)
if(items > 12)
{
      CreateMenu(title[], columns, Float:x, Float:y, Float:col1width, Float:col2width);
      return 1;
}
Or something of that sort.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)