Raised This Month: $12 Target: $400
 3% 

error 104: cannot find any methods for int


Post New Thread Reply   
 
Thread Tools Display Modes
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
nosoop
Veteran Member
Join Date: Aug 2014
Old 07-03-2020 , 20:04   Re: error 104: cannot find any methods for int
Reply With Quote #2

Quote:
Originally Posted by enderandrew View Post
Code:
new g_FeatureList[MAXFEATURES][FeatureEnum];
That should be changed to this:

Code:
FeatureEnum g_FeatureList[MAXFEATURES];
I don't know anything about STAMM, but it looks like you want to iterate over the g_FeatureList array, in which case your loop should look like the following:

Code:
for (int i=0; i < sizeof(g_FeatureList); i++)
{
    Format(query, sizeof(query), "%s, `%s`", query, g_FeatureList[i].FEATURE_BASE);
}

Actually, don't know what g_iFeatures is supposed to be.

Since you're accessing an array within an enum struct, the following should be right:

Code:
if (g_FeatureList[feature].FEATURE_POINTS[block-1] > 0)
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 07-03-2020 at 20:06.
nosoop is offline
enderandrew
Senior Member
Join Date: Jun 2020
Old 07-03-2020 , 22:03   Re: error 104: cannot find any methods for int
Reply With Quote #3

Thanks, that is very helpful!

As for g_iFeatures, STAMM is very modular itself where tons of other plugins add features to the base STAMM system. So the base STAMM plugin puts together arrays of those features/plugins and relevant values for them.

One more question if you don't mind:

PHP Code:
enum StammGames
{
    
GAME_UNSUPPORTED=0,
    
GAME_CSS,
    
GAME_CSGO,
    
GAME_TF2,
    
GAME_DOD,

becomes:

PHP Code:
enum struct StammGames
{
    
int GAME_UNSUPPORTED;
    
int GAME_CSS;
    
int GAME_CSGO;
    
int GAME_TF2;
    
int GAME_DOD;

Because apparently I can't keep =0. Can you still set values of the first item in an enum and incremental values?

And what does this turn into in the new syntax with the new enum struct format?

PHP Code:
new StammGames:g_iGameID
There is a later line also throwing an error:

PHP Code:
    CreateNative("STAMM_GetGame"nativelib_GetStammGame); 
My final compilation errors are all related to StammGames.

Last edited by enderandrew; 07-03-2020 at 22:20.
enderandrew is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 07-03-2020 , 22:26   Re: error 104: cannot find any methods for int
Reply With Quote #4

Quote:
Originally Posted by enderandrew View Post
Thanks, that is very helpful!

As for g_iFeatures, STAMM is very modular itself where tons of other plugins add features to the base STAMM system. So the base STAMM plugin puts together arrays of those features/plugins and relevant values for them.

One more question if you don't mind:
Gotcha. I'm not familiar with the codebase itself so I can't provide exact suggestions.

StammGames is just a plain enum (set of constant values), not an enum struct. Leave the declaration as is; the enum name replaces the type, so g_iGameID would be declared as:

Code:
StammGames g_iGameID;
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
enderandrew
Senior Member
Join Date: Jun 2020
Old 07-04-2020 , 03:08   Re: error 104: cannot find any methods for int
Reply With Quote #5

Thanks for all your help! I really appreciate it.

Currently I have 44 out of 45 plugins updated and compiling with no warnings or errors. One has me stumped a bit, but it is only for CSGO and I'm running TF2 so I won't sweat it too much. Now I need to test if any of this works.
enderandrew is offline
Reply


Thread Tools
Display Modes

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 05:54.


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