Jump to content

[Include] GMenus // Meniuri GTA V


GoFUS
 Share

Recommended Posts

 

GMenu.inc
Versiune: 2.2.0 | Ultima Actualizare: 5 Sept, 2017 | Autor: Gammix

Acest include va ajuta sa creati meniuri mult mai simplu, cu stilul celor din GTA V. Acest include nu este creat de mine, este postat pe forumul principal sa-mp. II puteti schimba culoarea, si spites-urile. Callback-urile sunt in acelasi gen ca si easydialogs.

 

sWZ3yOD.png

Functii:

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


"menuid" - La fel ca si in easydialogs, poti pune orice nume, si nu trebuie definit..
"caption" - numele meniului.
"type" - Descrierea meniului (Maxim 30 de caractere)
"captionTextColor" - Se intelege din nume.
"captionBoxColor" - Se intelege din nume.
"captionSprite" - Culoarea background-ului.

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

 

Poti adauga ceva in lista, oricand doresti.
"text" - Numele optiunii.
"info" - Informatia despre optiune, se afiseaza in josul meniului.

HidePlayerMenu(playerid); // Ascunde meniului pentru jucator.

Macros:
Le puteti definii cum vreti inainte de includere.

#define MENU_SOUND_UPDOWN \
    1054 // Sunetul cand vei scrola in sus in meniu.

#define MENU_SOUND_CLOSE \
    1084 // Sunetul cand vei inchide meniul.

#define MENU_SOUND_SELECT \
    1083 // Sunetul cand vei alege o optiune din meniu.

#define MENU_MAX_LISTITEMS \
    24 // Numarul maxim de optiuni pe care un meniu le poate avea.

#define MENU_MAX_LISTITEM_SIZE \
    128 // String-ul maxim pentru optiunile din meniu.

#define MENU_MAX_LISTITEMS_PERPAGE \
    8 // Numarul maxim de optiuni afisate pe o pagina a unui meniu.
MENU_RESPONSE_UP // Folosit in callback (Cand jucatorul apasa UP key pentru a merge in sus.)

MENU_RESPONSE_DOWN  // Folosit in callback (Cand jucatorul apasa DOWN key pentru a merge in jos.)

MENU_RESPONSE_SELECT  // Folosit in callback (Cand jucatorul apasa SPACE key pentru a selecta o optiune.)

MENU_RESPONSE_CLOSE  // Folosit in callback (Cand jucatorul apasa ENTER key pentru a inchide meniul) 

 

/// Exemplu - Weapon Menu

#define FILTERSCRIPT

#include <a_samp>
#include <gmenu>

public OnPlayerSpawn(playerid)
{
    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

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 7 months later...
  • 5 months later...
  • 1 month later...
  • 6 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...