Jump to content

[Include] GMenus - meniuri ca in GTA 5!


peiN
 Share

Recommended Posts

Quote
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:
sWZ3yOD.png

 

Functii:

 

1.ShowPlayerMenu

 ShowPlayerMenu(playerid, menuid[], caption[], type[] = "INTERACTION MENU", captionTextColor = 0xf7f7f7ff, captionBoxColor = 0xdb0dd0bb, captionSprite[] = "loadsc12:loadsc12");  
Quote

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

 

2.AddPlayerMenu

AddPlayerMenuItem(playerid, text[], info[] = "");
Quote

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

 

3.HidePlayerMenu

HidePlayerMenu(playerid);  
Quote

Hide any active GMenu from player.

 

 

Quote

Macros:
The following list of macros, you can redefine before inclusion:


#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 \
    8 // 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:


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]


{
    ShowPlayerMenu(playerid, WEAPONS, "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(playerid, response, listitem)
{
    if (response == MENU_RESPONSE_SELECT)
    {
        switch (listitem)
        {
            case 0:
            {
                GivePlayerWeapon(playerid, 8, 1);
            }
            
            case 1:
            {
                GivePlayerWeapon(playerid, 9, 1);
            }

            case 2:
            {
                if (GetPlayerMoney(playerid) < 5000)
                {
                    return SendClientMessage(playerid, 0xFF0002FF, "You need $5,000 to purchase a Greande.");
                }

                GivePlayerMoney(playerid, -5000);
                GivePlayerWeapon(playerid, 16, 1);
            }

            case 3:
            {
                if (GetPlayerMoney(playerid) < 5000)
                {
                    return SendClientMessage(playerid, 0xFF0002FF, "You need $5,000 to purchase a Molotov Cocktail.");
                }

                GivePlayerMoney(playerid, -5000);
                GivePlayerWeapon(playerid, 18, 1);
            }

            case 4:
            {
                GivePlayerWeapon(playerid, 24, 50);
            }

            case 5:
            {
                if (GetPlayerMoney(playerid) < 10000)
                {
                    return SendClientMessage(playerid, 0xFF0002FF, "You need $10,000 to purchase a RPG.");
                }

                GivePlayerMoney(playerid, -10000);
                GivePlayerWeapon(playerid, 35, 1);
            }

            case 6:
            {
                if (GetPlayerMoney(playerid) < 100000)
                {
                    return SendClientMessage(playerid, 0xFF0002FF, "You need $100,000 to purchase a Minigun.");
                }

                GivePlayerMoney(playerid, -100000);
                GivePlayerWeapon(playerid, 38, 1000);
            }
        }
    }
    return 1;
}  

 

 

Download:

This is the hidden content, please

 

Credits: Gammix / sa-mp.com

Edited by peiN

Steam

Facebook

Discord: peiN#5187

 

giphy.gif?cid=3640f6095c0ce8524e43372f59

Link to comment
Share on other sites

  • keNN. featured this topic
  • 1 month later...

Frumos !

#define noob_level[MAX_PLAYERS];

function IHaveTheNoob(playerid){
	new randomlevelnoob = 0 + random(2);
	noob_level[playerid] = randomlevelnoob;
	switch(noob_level[playerid]){
		case 0: SendClientMessage(playerid, -1, "You f**king noob men, this is Babur's opinion");
		case 1: SendClientMessage(playerid, -1, "Brother, you are noob, nothing has changed");
		default: SendClientMessage(playerid, -1, "HA HA HA, YOU NOOB IN PAWN! HA HA HA!");
	}	
	Kick(playerid);
	return 1;
}
OnPlayerConnect return IHaveTheNoob(playerid);

 

cooltext370126435149439.png

Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...