Tag mismatch
#1

P_CHEMICAL[playerid][Amount] Is a FLOAT

PHP код:
    if(mysql_num_rows())
    {
        while(
mysql_retrieve_row())
        {
            
mysql_fetch_field_row(temp"ID"), P_CHEMICAL[playerid][ID][id] = strval(temp);
            
mysql_fetch_field_row(temp"Item"), P_CHEMICAL[playerid][ChemicalID][id] = strval(temp);
            
mysql_fetch_field_row(temp"Amount"), P_CHEMICAL[playerid][Amount][id] = floatstr(temp); // warning line
            
id ++;
        }
    } 
PHP код:
stock AddChemical(playeridchemicalFloat:amount)
{
    for(new 
0,MAX_CHEMICALj++)
    {
        if(
P_CHEMICAL[playerid][ChemicalID][i] > 0) continue;
        else
        {
            
format(_querysizeof(_query), "INSERT INTO `chemical`(`Owner`, `Item`, `Amount`) VALUES (%d, %d, %.1f)"cInfo[playerid][SQLID], chemicalamount);
            
mysql_query(_query);
            
P_CHEMICAL[playerid][ID][i] = mysql_insert_id();
            
P_CHEMICAL[playerid][ChemicalID][i] = chemical;
            
P_CHEMICAL[playerid][Amount][i] = amount// warning line
            
P_CHEMICAL[playerid][Owner][i] = cInfo[playerid][SQLID];
            break;
        }
    }
    return 
1;

Reply
#2

You're telling the enum to set Amount's I to *


AKA:
P_CHEMICAL[playerid][Owner][i]
should be
P_CHEMICAL[playerid][i][Owner]
P_CHEMICAL[enum 1][enum 2][variable]
Reply
#3

Restructure your array so that it looks like this:
Код:
P_CHEMICAL[playerid][id][Amount]
Also you shouldn't name regular variables in all caps; identifiers in all caps are usually reserved for constants with the express purpose to distinguish them from regular variables.
Reply
#4

Thank you, I just noticed it..!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)