View Single Post
Author Message
enderandrew
Senior Member
Join Date: Jun 2020
Old 07-03-2020 , 16:11   error 104: cannot find any methods for int
Reply With Quote #1

I found a fork of STAMM that was a little more updated and I wanted to try and update it even more to the new syntax and then try and compile it with a SM 1.11 build.

I'm new to all of this and a little unsure of what I'm doing. But here is an example:

PHP Code:
enum FeatureEnum
{
    
FEATURE_LEVEL[MAXLEVELS],
    
/* TODO: IMPLEMENT
    FEATURE_POINTS[MAXLEVELS],*/
    
FEATURE_BLOCKS,
    
bool:FEATURE_CHANGE,
    
bool:FEATURE_STANDARD,
    
bool:FEATURE_ENABLE,
    
bool:WANT_FEATURE[MAXPLAYERS 1],
    
String:FEATURE_BASE[64],
    
String:FEATURE_BASEREAL[64],
    
String:FEATURE_NAME[64],
    
Handle:FEATURE_HANDLE,

becomes

PHP Code:
enum struct FeatureEnum {
    
int FEATURE_LEVEL[MAXLEVELS];
    
int FEATURE_BLOCKS;
    
bool FEATURE_CHANGE;
    
bool FEATURE_STANDARD;
    
bool FEATURE_ENABLE;
    
bool WANT_FEATURE[MAXPLAYERS 1];
    
char FEATURE_BASE[64];
    
char FEATURE_BASEREAL[64];
    
char FEATURE_NAME[64];
    
Handle FEATURE_HANDLE;

and then this:

PHP Code:
new g_FeatureList[MAXFEATURES][FeatureEnum]; 
becomes:

PHP Code:
g_FeatureList[MAXFEATURES]; 
Those changes seem to take fine. But then I change:

PHP Code:
        for (new i=0g_iFeaturesi++)
        { 
            
Format(querysizeof(query), "%s, `%s`"queryg_FeatureList[i][FEATURE_BASE]);
        } 
to:

PHP Code:
        for (new i=0g_iFeaturesi++)
        { 
            
Format(querysizeof(query), "%s, `%s`"queryg_FeatureList[i].FEATURE_BASE);
        } 
I get the error:

stamm/sqllib.sp(204) : error 104: cannot find any methods for int

As far as I can tell, it doesn't like me passing i as an integer in the for loop. But I don't understand why that is a problem or how to fix that.

Also, I'm unsure what the new syntax should be for this:

PHP Code:
        if (g_FeatureList[feature][FEATURE_POINTS][block-1] > 0
Would it be:

PHP Code:
        if (g_FeatureList[feature].FEATURE_POINTS[block-1] > 0
Or:

PHP Code:
        if (g_FeatureList[feature].FEATURE_POINTS.block-0
enderandrew is offline