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

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Код:
	new index = (gMenu[menuid][M_LISTITEMS] + 1);
    if(index > MAX_MENU_ITEMS) return -1;
    index -= 1;
Why not just do it like this.

Код:
	new index = (gMenu[menuid][M_LISTITEMS]);
    if(index >= MAX_MENU_ITEMS) return -1;
Oh, yes.

Quote:
Originally Posted by Pottus
Посмотреть сообщение
The ordering in OnPlayerUpdate() could be done better for sure.

pawn Код:
new keys, updown, leftright;
    GetPlayerKeys(playerid, keys, updown, leftright);

    if(updown == KEY_DOWN)
    {
        if(GetPlayerMenuID(playerid) != INVALID_MENU_ID)
        {
You are already making function calls when you don't have to, this would be a better logical order.

Код:
    if(GetPlayerMenuID(playerid) != INVALID_MENU_ID)
	{
		new keys, updown, leftright;
		GetPlayerKeys(playerid, keys, updown, leftright);

		if(updown == KEY_DOWN)
		{
Yes, thats right.

Quote:
Originally Posted by Pottus
Посмотреть сообщение
Another thing to keep in mind is you are using == to check for keys which will work but you can not be pressing any other keys! Usually keys are checked like below. I won't say this method as long as it was your intention for it to be that way.
Код:
if(updown & KEY_DOWN)
No that will work but for both KEY_DOWN and KEY_UP as well other keys. So that will probably collapse.


Updated the download !




playergui.pwn
You hooking mistake:
Quote:

#else
#if defined _ALS_OnGameModeInit
#undef OnGameModeInit
#else
#define _ALS_OnGameModeInit
#endif
#define OnFilterScriptInit GUIP_OnGameModeInit
forward GUIP_OnGameModeInit();

#endif

pawn Код:
#define GUIValidIndex(%0) if(!GUIData[_:%0][GUIActive]) return 0
#define GUIValidElement(%0,%1) if(!GUIData[_:%0][GUIUsed][%1]) return 0
Or maybe this:
pawn Код:
#define GUIValidIndex(%0) return GUIData[_:%0][GUIActive]
#define GUIValidElement(%0,%1) return GUIData[_:%0][GUIUsed][%1]

The coding of your GUI is pretty good.
I like this method:
pawn Код:
#if defined FILTERSCRIPT
    public OnFilterScriptExit()
#else
    public OnGameModeExit()
#endif
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: 6 Guest(s)