[Include] GMenus Include (stylish GTA V themed* interaction menus!)
#1

GMenu.inc
Version: 2.2.0 | Last Updated: 5 Sept, 2017
GTA V themed interaction menus for SA-MP. Works almost the same way and so does the design. You can customize the menu, like changing the colors and background sprite.
Menu callbacks are handled the same way easydialog.inc does.

Screenshot:


Functions:
PHP код:
ShowPlayerMenu(playeridmenuid[], caption[], type[] = "INTERACTION MENU"captionTextColor 0xf7f7f7ffcaptionBoxColor 0xdb0dd0bbcaptionSprite[] = "loadsc12:loadsc12"); 
Show player a GMenu!
  • "menuid" - Just like easydialog include, you can put any name and you dont need to define it.
  • "caption" - heading of menu
  • "type" - Little text to descript menu (don't make this longer than 30 characters)
  • "captionTextColor" - self explainatory
  • "captionBoxColor" - self explainatory
  • "captionSprite" - The background picture of caption
PHP код:
AddPlayerMenuItem(playeridtext[], info[] = ""); 
Add a listitem to your menu, plug'n'play feature. You can add anytime while the menu is shown.
  • "text" - The listitem's text
  • "info" - A side note/information about the listitem. Optional, leave this param empty for no information box will be shown
PHP код:
HidePlayerMenu(playerid); 
Hide any active GMenu from player.

Macros:
The following list of macros, you can redefine before inclusion:
PHP код:
#define MENU_SOUND_UPDOWN \
    
1054 // the sound id which will be played when you go up/down listitems
#define MENU_SOUND_CLOSE \
    
1084 // the sound id which will be played when you close menu
#define MENU_SOUND_SELECT \
    
1083 // the sound id which will be played when you select a listitem
#define MENU_MAX_LISTITEMS \
    
24 // maximum listitems a menu can have, the array size holding menu information
#define MENU_MAX_LISTITEM_SIZE \
    
128 // maximum string size of a listitem
#define MENU_MAX_LISTITEMS_PERPAGE \
    
// how many lisitems you want to be shown in a page 
The following are constants (i.e. cannot be changed). You can use them in handling response in callback:
PHP код:
MENU_RESPONSE_UP // used in callback (when player press UP key to go upwards in menu)
MENU_RESPONSE_DOWN  // used in callback (when player press DOWN key to go downwards in menu)
MENU_RESPONSE_SELECT  // used in callback (when player press SPACE key to select a listitem)
MENU_RESPONSE_CLOSE  // used in callback (when player press ENTER key to close menu) 
Example - Weapons Menu:
Shows player a weapon menu on every spawn:
[Notice how menu callbacks are handled, if you are not familiar with how easydialog.inc works]
PHP код:
#define FILTERSCRIPT
#include <a_samp>
#include <gmenu>
public OnPlayerSpawn(playerid)
{
    
ShowPlayerMenu(playeridWEAPONS"Weapons Menu");
    
AddPlayerMenuItem(playerid"Katana");
    
AddPlayerMenuItem(playerid"Chainsaw");
    
AddPlayerMenuItem(playerid"Grenade""Lethal weapon, will cost you $5,000 per grenade!");
    
AddPlayerMenuItem(playerid"Molotov Cocktail""Lethal weapon, will cost you $5,000 per moltov!");
    
AddPlayerMenuItem(playerid"Desert Eagle");
    
AddPlayerMenuItem(playerid"RPG""Lethal weapon, will cost you $10,000 per rocket!");
    
AddPlayerMenuItem(playerid"Minigun""Best weapon of game, this is surely worth $100,000!");
    return 
1;
}
Menu:WEAPONS(playeridresponselistitem)
{
    if (
response == MENU_RESPONSE_SELECT)
    {
        switch (
listitem)
        {
            case 
0:
            {
                
GivePlayerWeapon(playerid81);
            }
            
            case 
1:
            {
                
GivePlayerWeapon(playerid91);
            }
            case 
2:
            {
                if (
GetPlayerMoney(playerid) < 5000)
                {
                    return 
SendClientMessage(playerid0xFF0002FF"You need $5,000 to purchase a Greande.");
                }
                
GivePlayerMoney(playerid, -5000);
                
GivePlayerWeapon(playerid161);
            }
            case 
3:
            {
                if (
GetPlayerMoney(playerid) < 5000)
                {
                    return 
SendClientMessage(playerid0xFF0002FF"You need $5,000 to purchase a Molotov Cocktail.");
                }
                
GivePlayerMoney(playerid, -5000);
                
GivePlayerWeapon(playerid181);
            }
            case 
4:
            {
                
GivePlayerWeapon(playerid2450);
            }
            case 
5:
            {
                if (
GetPlayerMoney(playerid) < 10000)
                {
                    return 
SendClientMessage(playerid0xFF0002FF"You need $10,000 to purchase a RPG.");
                }
                
GivePlayerMoney(playerid, -10000);
                
GivePlayerWeapon(playerid351);
            }
            case 
6:
            {
                if (
GetPlayerMoney(playerid) < 100000)
                {
                    return 
SendClientMessage(playerid0xFF0002FF"You need $100,000 to purchase a Minigun.");
                }
                
GivePlayerMoney(playerid, -100000);
                
GivePlayerWeapon(playerid381000);
            }
        }
    }
    return 
1;

Download - Source:
https://github.com/Agneese-Saini/SA-...lude/gmenu.inc
Reply


Messages In This Thread
GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 15.05.2015, 14:15
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Sellize - 15.05.2015, 14:19
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Smileys - 15.05.2015, 14:22
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by iSkyline - 15.05.2015, 14:26
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 16.05.2015, 00:51
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Crayder - 16.05.2015, 01:06
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 16.05.2015, 01:07
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Pottus - 16.05.2015, 01:30
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 16.05.2015, 02:01
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Pottus - 16.05.2015, 02:09
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by $$inSane - 16.05.2015, 09:55
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Excel™ - 16.05.2015, 10:01
Respuesta: GMenus Include (stylish GTA V themed* interaction menus!) - by Whyd - 16.05.2015, 11:41
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by J4Rr3x - 16.05.2015, 13:06
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Excips - 20.05.2015, 05:52
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Q_Lite - 24.05.2015, 04:02
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Lorenc_ - 24.05.2015, 04:31
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Q_Lite - 24.05.2015, 04:33
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 24.05.2015, 08:51
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by SickAttack - 26.05.2015, 04:15
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 26.05.2015, 06:14
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by SickAttack - 26.05.2015, 22:17
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 27.05.2015, 04:06
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Saddin - 13.07.2015, 13:50
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 13.07.2015, 14:12
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by bruxo00 - 16.07.2015, 21:13
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by LegendOfScripts - 22.07.2015, 16:28
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Excel™ - 23.07.2015, 16:01
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by NegoEnsina - 23.07.2015, 16:20
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by LegendOfScripts - 27.07.2015, 14:32
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 20.01.2016, 22:01
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Amunra - 29.01.2016, 08:30
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 27.07.2016, 17:17
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Hunud - 27.07.2016, 17:21
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 21.08.2016, 04:33
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 28.12.2016, 18:50
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Eoussama - 28.12.2016, 18:56
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by ixesas - 30.12.2016, 15:13
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by SilverGaming - 07.01.2017, 15:32
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Variable™ - 07.01.2017, 16:24
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by BlackbirdXd - 11.02.2017, 14:56
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 11.02.2017, 21:02
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by BlackbirdXd - 12.02.2017, 09:04
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Xeon™ - 22.08.2017, 15:57
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 22.08.2017, 19:18
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Xeon™ - 22.08.2017, 19:26
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 05.09.2017, 22:49
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Skream - 09.09.2017, 15:15
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 09.09.2017, 15:43
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Deadpoop - 14.09.2017, 19:19
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Tort - 17.09.2017, 17:59
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by dani18 - 27.05.2018, 16:39
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Locky_ - 15.06.2018, 13:17
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 18.06.2018, 21:04
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by MajesticPTR - 22.08.2018, 19:47
Re: GMenus Include (stylish GTA V themed* interaction menus!) - by Gammix - 22.08.2018, 19:58

Forum Jump:


Users browsing this thread: 3 Guest(s)