Raised This Month: $ Target: $400
 0% 

Problem with %d


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-01-2015 , 11:46   Re: Problem with %d
Reply With Quote #1

This is the fixed version. ;)

1. No need to cache cs_get_user_money(id) with Cash[id]. So, I change it.

2. Below code is no need in your case:
Code:
    new data[6], szName[33];
    new acces, callback;
    menu_item_getinfo(menu, item, acces, data,charsmax(data), szName,charsmax(szName), callback); 

    new key = str_to_num(data); 
So, I remove it. Just read this to know at what situation can you use menu_item_getinfo(: https://forums.alliedmods.net/showth...hp?t=46364#top

3. Just see below code:
PHP Code:
menu_display(id,  menu0
Explanation:
Quote:
Originally Posted by HamletEagle
All the items starts from 0 (the first menu item is 0, the second 1....)
Yet, your item start from "1". It is not correct:
Code:
switch(item) 
    {
        case 1: {
So, I fix it.

4. For you information menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) is not needed. Yet, I don't remove it.

Why it is not needed?
PHP Code:
//Set a property on the menu
menu_setpropmenuMPROP_EXITMEXIT_ALL );
//Note - menu_setprop
//The first parameter is the menu to modify
//The second parameter is what to modify ( found in amxconst.inc )
//The third parameter is what to modify it to ( in this case, we are  adding a option to the menu that will exit the menu. setting it to  MEXIT_NEVER will disable this option )
//Additional note - MEXIT_ALL is the default property for MPROP_EXIT, so this is redundant 
Thats all for now. ;)
Attached Files
File Type: sma Get Plugin or Get Source (cc_16.sma - 367 views - 13.4 KB)

Last edited by zmd94; 01-01-2015 at 12:06.
zmd94 is offline
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 01-01-2015 , 16:39   Re: Problem with %d
Reply With Quote #2

Quote:
Originally Posted by zmd94 View Post
This is the fixed version. ;)

1. No need to cache cs_get_user_money(id) with Cash[id]. So, I change it.

2. Below code is no need in your case:
Code:
    new data[6], szName[33];
    new acces, callback;
    menu_item_getinfo(menu, item, acces, data,charsmax(data), szName,charsmax(szName), callback); 

    new key = str_to_num(data); 
So, I remove it. Just read this to know at what situation can you use menu_item_getinfo(: https://forums.alliedmods.net/showth...hp?t=46364#top

3. Just see below code:
PHP Code:
menu_display(id,  menu0
Explanation:
Yet, your item start from "1". It is not correct:
Code:
switch(item) 
    {
        case 1: {
So, I fix it.

4. For you information menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) is not needed. Yet, I don't remove it.

Why it is not needed?
PHP Code:
//Set a property on the menu
menu_setpropmenuMPROP_EXITMEXIT_ALL );
//Note - menu_setprop
//The first parameter is the menu to modify
//The second parameter is what to modify ( found in amxconst.inc )
//The third parameter is what to modify it to ( in this case, we are  adding a option to the menu that will exit the menu. setting it to  MEXIT_NEVER will disable this option )
//Additional note - MEXIT_ALL is the default property for MPROP_EXIT, so this is redundant 
Thats all for now. ;)
Thank u it's work!
Eviatar Mor is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-01-2015 , 11:58   Re: Problem with %d
Reply With Quote #3

zmd, not really
PHP Code:
menu_display(id,  menu0
The last param is the menu page. All the items starts from 0(the first menu item is 0, the second 1....). It has nothing to do with the menu page in the way you explained.

PHP Code:
menu_setprop(menuMPROP_EXITMEXIT_ALL
is set by default.
__________________

Last edited by HamletEagle; 01-01-2015 at 11:58.
HamletEagle is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-01-2015 , 12:04   Re: Problem with %d
Reply With Quote #4

HamletEagle, then it is my fault. I have misread it.
zmd94 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-01-2015 , 20:31   Re: Problem with %d
Reply With Quote #5

Nice, I'm glad I can help you.
zmd94 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 15:29.


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