Raised This Month: $ Target: $400
 0% 

Tag Mismatch on AddMenuItem and IntToString


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 01-21-2015 , 19:29   Tag Mismatch on AddMenuItem and IntToString
Reply With Quote #1

PHP Code:
public T_CashMenu(Handle:ownerHandle:hndl, const String:error[], any:data)
{
 
    if (
hndl == INVALID_HANDLE)
    {
        
LogError("Query failed! %s"error);
    }
    
    new 
client data;

    if(
ClientIsValid(client))
    {
        new 
count 0;
        new 
Handle:hMenu CreateMenu(CashMenuHandle);
        
SetMenuTitle(hMenu"Cash");
        if(
SQL_GetRowCount(hndl) > 0)
        {
            while(
SQL_FetchRow(hndl))
            {
                new 
drug SQL_FetchInt(hndl0);
                new 
num SQL_FetchInt(hndl1);
                new 
string:n[5];
                
IntToString(drugnsizeof(n));
                new 
String:menu_item[10];
                
Format(menu_itemsizeof(menu_item), "[%d] - %s"numdrug_name[drug]);
                if (
num >= 10)
                {
                    
count++;
                    
AddMenuItem(hMenunmenu_item);
                } 
                else
                {
                    
AddMenuItem(hMenunmenu_itemITEMDRAW_DISABLED);
                }
            }
        }
                
        
DisplayMenu(hMenuclientMENU_TIME_FOREVER);
    }

Everything works fine in game and no errors on compilation but I get tag mismatch for both the addmenuitems and inttostring.

What am I doing wrong?

Last edited by Jasonbourne; 01-21-2015 at 19:31.
Jasonbourne is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-21-2015 , 19:35   Re: Tag Mismatch on AddMenuItem and IntToString
Reply With Quote #2

Quote:
Originally Posted by Jasonbourne View Post
PHP Code:
            while(SQL_FetchRow(hndl))
            {
                new 
drug SQL_FetchInt(hndl0);
                new 
num SQL_FetchInt(hndl1);
                new 
string:n[5];
                
IntToString(drugnsizeof(n));
                new 
String:menu_item[10];
                
Format(menu_itemsizeof(menu_item), "[%d] - %s"numdrug_name[drug]); 
PHP Code:
            while(SQL_FetchRow(hndl))
            {
                new 
drug SQL_FetchInt(hndl0);
                new 
num SQL_FetchInt(hndl1);
                new 
String:n[5]; // <<<=================================
                
IntToString(drugnsizeof(n));
                new 
String:menu_item[10];
                
Format(menu_itemsizeof(menu_item), "[%d] - %s"numdrug_name[drug]); 

Last edited by Potato Uno; 01-21-2015 at 19:37.
Potato Uno is offline
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 01-21-2015 , 19:39   Re: Tag Mismatch on AddMenuItem and IntToString
Reply With Quote #3

Quote:
Originally Posted by Potato Uno View Post
PHP Code:
            while(SQL_FetchRow(hndl))
            {
                new 
drug SQL_FetchInt(hndl0);
                new 
num SQL_FetchInt(hndl1);
                new 
String:n[5]; // <<<=================================
                
IntToString(drugnsizeof(n));
                new 
String:menu_item[10];
                
Format(menu_itemsizeof(menu_item), "[%d] - %s"numdrug_name[drug]); 

What should that line be?

^^
cant believe i didnt see that...

Last edited by Jasonbourne; 01-21-2015 at 19:40.
Jasonbourne is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 01-21-2015 , 19:41   Re: Tag Mismatch on AddMenuItem and IntToString
Reply With Quote #4

I fixed your mistake already in that post.

Basically you had

PHP Code:
new string:n[5]; 
and I changed it to

PHP Code:
new String:n[5]; 
Now try it and see if it works.
Potato Uno is offline
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 01-21-2015 , 19:42   Re: Tag Mismatch on AddMenuItem and IntToString
Reply With Quote #5

The fact that I couldnt see the difference between your post and mine is the reason why there was a tag mismatch
Jasonbourne 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 18:34.


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