peiN
-
Posts
126 -
Joined
-
Last visited
-
Days Won
3
Posts posted by peiN
-
-
re
-
-
-
Am
Am/n-am furat catalogul ca sa-mi motivez absente
-
-
QuoteGMenu.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:Functii:
1.ShowPlayerMenu
ShowPlayerMenu(playerid, menuid[], caption[], type[] = "INTERACTION MENU", captionTextColor = 0xf7f7f7ff, captionBoxColor = 0xdb0dd0bb, captionSprite[] = "loadsc12:loadsc12");
QuoteShow 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[] = "");
QuoteAdd 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);
QuoteHide any active GMenu from player.
QuoteMacros:
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:
Credits: Gammix / sa-mp.com
-
Folosesti functia SetPlayerColor: https://wiki.sa-mp.com/wiki/Function:SetPlayerColor
La OnPlayerConnect, ii setezi o culoare de baza (de obicei e gri), iar apoi, dupa ce se logheaza, ii setezi alta culoare (pe gm-urile RPG este in functie de factiunea jucatorului)
-
-
18 minutes ago, SebastianKiduu said:
Nu recomand acest baiat !
Ce s-a intamplat? :))
- MIonel and SebastianKiduu
- 1
- 1
-
-
-
-
-
-
-
Arata super misto!
-
-
up, micsorat pretul la 250
-
-
-
-
-
-
re
[DELETED]Gamemode Saints-Network
in Archives
Posted
il vr