cache_get_field_content Error, help please..
#1

pls Help me

Code:
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1422) : error 003: declaration of a local variable must appear in a compound block
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1422) : error 017: undefined symbol "result"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1422) : warning 215: expression has no effect
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1422) : error 001: expected token: ";", but found "]"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1422) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
PHP Code:

forward SprayTag_Load
(extraidtype);
public 
SprayTag_Load(extraidtype) {
    new 
rows cache_num_rows();
    switch(
type)
    {
        case 
SPRAYTAG_THREAD_LOAD:
        {
            if(
IsPlayerConnected(extraid))
            {
                for(new 
irowsi++)
                {
                    if(
>= MAX_PLAYERS_TAGS)
                    new 
result[128];
                    
cache_get_field_content(i"id"SprayTags[extraid][i][_spSQLID] = strval(result);
                    
cache_get_field_content(i"owner"SprayTags[extraid][i][_spOwned], .max_len MAX_PLAYER_NAME);
                    
cache_get_field_content(i"text"SprayTags[extraid][i][_spText], .max_len MAX_PLAYER_NAME);
                    
cache_get_field_content(i"font"SprayTags[extraid][i][_spFont], .max_len MAX_PLAYER_NAME);
                    
cache_get_field_content(i"fontsize"resultSprayTags[extraid][i][_spFontSize] = strval(result);
                    
cache_get_field_content(i"bold"resultSprayTags[extraid][i][_spBold] = strval(result);
                    
cache_get_field_content(i"color"resultSprayTags[extraid][i][_spFontColor] = strval(result);
                    
cache_get_field_content(i"posx"resultSprayTags[extraid][i][_spPosX] = floatstr(result);
                    
cache_get_field_content(i"posy"resultSprayTags[extraid][i][_spPosY] = floatstr(result);
                    
cache_get_field_content(i"posz"resultSprayTags[extraid][i][_spPosZ] = floatstr(result);
                    
cache_get_field_content(i"posrx"resultSprayTags[extraid][i][_spPosRX] = floatstr(result);
                    
cache_get_field_content(i"posry"resultSprayTags[extraid][i][_spPosRY] = floatstr(result);
                    
cache_get_field_content(i"posrz"resultSprayTags[extraid][i][_spPosRZ] = floatstr(result);
                    
cache_get_field_content(i"vw"resultSprayTags[extraid][i][_spVW] = strval(result);
                    
cache_get_field_content(i"interior"resultSprayTags[extraid][i][_spInt] = strval(result);
                    if(
SprayTags[extraid][i][_spPosX] != 0.0)
                    {
                        
SprayTag_Spawn(extraidi);
                    }
                    
i++;
                }
            }
        }
        case 
SPRAYTAG_THREAD_SAVE:
        {
        }
    }
    return 
1;

Reply
#2

For now:

Code:
 cache_get_field_content(i, "id", SprayTags[extraid][i][_spSQLID] = strval(result);
You're missing a brace there, change it for:

Code:
 cache_get_field_content(i, "id", SprayTags[extraid][i][_spSQLID] = strval(result));
EDIT: Also I think this:

Code:
cache_get_field_content(i, "text", SprayTags[extraid][i][_spText], max.len = MAX_PLAYER_NAME);
cache_get_field_content(i, "font", SprayTags[extraid][i][_spFont], max.len = MAX_PLAYER_NAME);
Should be like this:

Code:
cache_get_field_content(i, "text", SprayTags[extraid][i][_spText], .max_len = MAX_PLAYER_NAME);
cache_get_field_content(i, "font", SprayTags[extraid][i][_spFont], .max_len = MAX_PLAYER_NAME);
Notice the .max_len change, that may be your problem.
Reply
#3

Quote:
Originally Posted by Troydere
View Post
For now:

Code:
 cache_get_field_content(i, "id", SprayTags[extraid][i][_spSQLID] = strval(result);
You're missing a brace there, change it for:

Code:
 cache_get_field_content(i, "id", SprayTags[extraid][i][_spSQLID] = strval(result));
EDIT: Also I think this:

Code:
cache_get_field_content(i, "text", SprayTags[extraid][i][_spText], max.len = MAX_PLAYER_NAME);
cache_get_field_content(i, "font", SprayTags[extraid][i][_spFont], max.len = MAX_PLAYER_NAME);
Should be like this:

Code:
cache_get_field_content(i, "text", SprayTags[extraid][i][_spText], .max_len = MAX_PLAYER_NAME);
cache_get_field_content(i, "font", SprayTags[extraid][i][_spFont], .max_len = MAX_PLAYER_NAME);
Notice the .max_len change, that may be your problem.
Thank you for help,
but not work?

Code:
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1425) : error 035: argument type mismatch (argument 3)
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1431) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1432) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1433) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1434) : warning 213: tag mismatch
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1434) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1435) : warning 213: tag mismatch
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1435) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1436) : warning 213: tag mismatch
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1436) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1437) : warning 213: tag mismatch
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1437) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1438) : warning 213: tag mismatch
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1438) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1439) : warning 213: tag mismatch
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1439) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1440) : error 001: expected token: ",", but found ";"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(1441) : error 001: expected token: ",", but found ";"
NFS_NewObjects2.pwn(6772) : warning 217: loose indentation
NFS_NewObjects2.pwn(6788) : warning 217: loose indentation
NFS_NewObjects2.pwn(14829) : warning 217: loose indentation
NFS_NewObjects2.pwn(14845) : warning 217: loose indentation
NFS_NewObjects2.pwn(18188) : warning 217: loose indentation
NFS_NewObjects2.pwn(18190) : warning 217: loose indentation
NFS_NewObjects2.pwn(19033) : warning 217: loose indentation
NFS_NewObjects2.pwn(19050) : warning 217: loose indentation
NFS_NewObjects2.pwn(49563) : warning 217: loose indentation
NFS_NewObjects2.pwn(49803) : warning 217: loose indentation
NFS_NewObjects2.pwn(49804) : warning 217: loose indentation
NFS_NewObjects2.pwn(50091) : warning 217: loose indentation
NFS_NewObjects2.pwn(50161) : warning 217: loose indentation
NFS_NewObjects2.pwn(52387) : warning 217: loose indentation
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(2244) : warning 219: local variable "year" shadows a variable at a preceding level
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(2244) : warning 219: local variable "month" shadows a variable at a preceding level
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(2244) : warning 219: local variable "day" shadows a variable at a preceding level
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(4035) : error 017: undefined symbol "szQuery"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(4035) : error 017: undefined symbol "szQuery"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(4041) : warning 225: unreachable code
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(7457) : warning 219: local variable "Position" shadows a variable at a preceding level
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(7462) : error 028: invalid subscript (not an array or too many subscripts): "Position"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(7462) : warning 215: expression has no effect
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(7462) : error 001: expected token: ";", but found "]"
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(7462) : error 029: invalid expression, assumed zero
D:\games\NFS 2017 Next Build\gamemodes\NFS AWAL\NFS_BussSpray.pwn(7462) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


18 Errors.
Reply
#4

Change this
Code:
cache_get_field_content(i, "id", SprayTags[extraid][i][_spSQLID] = strval(result));
into
Code:
cache_get_field_content(i, "id", result);
SprayTags[extraid][i][_spSQLID] = strval(result);
Third parameter must be an array/string.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)