Raised This Month: $32 Target: $400
 8% 

How does this menu work ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 11-14-2020 , 17:49   How does this menu work ?
Reply With Quote #1

Hey guys.
So I wanna know how this menu works by removing out some items for zombies.

First Var -
Code:
new g_iShopItemsTeams[8] =
{
	2, 0, 0, 0, 0, 0, 2, 0
};
Second check in menu -
Code:
case 2:
			{
				static cNumber[3];
				static cLine[128];
				static i;
				g_iShopMenu = menu_create("Shop Menu", "_ShopMenu", 0);
				i = 0;
				while (i < 8)
				{
					if (g_iShopItemsTeams[i] == 2 && g_bZombie[iPlayer])
					{
					}
					else
					{
						formatex(cLine, 128, "%s %s", g_cShopItems[i], g_cShopItemsPrices[i]);
						num_to_str(i, cNumber, 3);
						menu_additem(g_iShopMenu, cLine, cNumber, 0, -1);
					}
					i += 1;
				}
				menu_display(iPlayer, g_iShopMenu, 0);
			}
And Finally third and last part in menu handler -
Code:
case 0:
			{
				if (g_iShopItemsPrices[iChoice] > g_iPoints[iPlayer])
				{
					client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You don't have enough points!");
				}
				else
				{
					if (g_iShopItemsTeams[iChoice] == 2 && g_bZombie[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 This item is not for your team!");
					}
					if (!g_bAlive[iPlayer])
					{
						client_print_color(iPlayer, print_team_grey, "^4[Zombie Outstanding]^1 You should be alive!");
					}
					g_bDoubleDamage[iPlayer] = 1;
                    set_hudmessage(205, 102, 29, -1.00, 0.70, 1, 0.00, 3.00, 2.00, 1.00, -1);
					ShowSyncHudMsg(0, g_iEventsHudmessage, "%s bought Double Damage!", g_cName[iPlayer]);
					client_print_color(0, print_team_grey, "^4[Zombie Outstanding]^3 %s^1 bought^4 Double Damage", g_cName[iPlayer]);
					g_iPoints[iPlayer] -= g_iShopItemsPrices[iChoice];
					SaveRank(iPlayer);
				}
			}
In effect if I am Human I can see all items of Team = 0 and 2 and when I am a Zombie then the items with Team = 2 are removed from my menu.

Can anyone make me understand how this works ?
Please ?

Last edited by Abhinash; 11-14-2020 at 17:50.
Abhinash is offline
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 11-14-2020 , 17:51   Re: How does this menu work ?
Reply With Quote #2

What? Post the full code.
redivcram is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 11-14-2020 , 17:53   Re: How does this menu work ?
Reply With Quote #3

Quote:
Originally Posted by redivcram View Post
What? Post the full code.
Here you go.
Please check it out and let me know
Attached Files
File Type: sma Get Plugin or Get Source (ZombieOutstanding.sma - 80 views - 198.7 KB)
Abhinash is offline
Helmuth von August
Junior Member
Join Date: Nov 2020
Location: Panama
Old 11-15-2020 , 13:25   Re: How does this menu work ?
Reply With Quote #4

Hi,
Post code here
Helmuth von August is offline
Abhinash
Senior Member
Join Date: Jan 2015
Location: India,kolkata
Old 11-18-2020 , 17:34   Re: How does this menu work ?
Reply With Quote #5

Quote:
Originally Posted by Helmuth von August View Post
Hi,
Post code here
Are you blind or you forgot to use your eyes ?
May I help you get a tutorial on how to use your Eyes ?
Abhinash is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode