Raised This Month: $ Target: $400
 0% 

Limiting items


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RAW_192
Senior Member
Join Date: Feb 2017
Old 08-01-2017 , 09:50   Limiting items
Reply With Quote #1

PHP Code:
public mh_MyMenu(idmenuitem)
{         
if(
item == MENU_EXIT)
{
menu_cancel(id);
return 
PLUGIN_HANDLED;
}
new 
money =  get_user_point(id
new 
command[6], name[64], accesscallback;
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

switch(
item)
{
case 
0:
{
if(
g_hasitem[id] == true)
{
client_print(id,"You already have one item")
return;
}
else ( 
get_user_point(id) >= 150)
{
g_hasitem[id] == true
}
case 
1:
{
if(
g_hasitem[id] == true)
{
return;
client_print(id,"You already have one item")
}
else( 
get_user_point(id) >= 100)
{
....    
g_hasitem[id] == true;
}
}
menu_destroy(menu);

return 
PLUGIN_HANDLED;



I am trying to limit items to players .. i.e if player buys one item he cant buy other

But when im using this method im unable to buy anything .. Everytime i buy it shows you already have one item


Also is there any way i can show Points of players below menu

EX:

Quote:
Menu
Your Coins : ... Coins

1.
2.

One last error is im using \r to make it color as in the guide of article [New Amxx Menu System]

But its not working

Last edited by RAW_192; 08-01-2017 at 09:51.
RAW_192 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-01-2017 , 11:14   Re: Limiting items
Reply With Quote #2

Basics mistakes

Firstly
Spoiler


Secondary
Spoiler


Each item should has its own data(variable/boolean)..
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-01-2017 at 11:15.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 08-01-2017 , 13:37   Re: Limiting items
Reply With Quote #3

if(item == MENU_EXIT)
{
menu_cancel(id);
return PLUGIN_HANDLED;
}
why not to destroy instead of cancel
__________________
Ayman Khaled is offline
RAW_192
Senior Member
Join Date: Feb 2017
Old 08-04-2017 , 07:18   Re: Limiting items
Reply With Quote #4

Thanks Natsheh ... Silly mistakes

Btw can you also tell about the other two issues ?


1) Also is there any way i can show Points of players below menu

EX:
Quote:
Menu
Your Coins : ...

1)
2)
2) Using color on menu .. \r \w didn't work
RAW_192 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 23:03.


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