Returning Strings
#1

Code:
C:\Users\TheLazySloth\Desktop\San Andreas Multiplayer\Server\TLS-Windows\gamemodes\TheLazySloth.pwn(98) : error 079: inconsistent return types (array & non-array)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
______________________________

Could not find resulting AMX or its size is under 1byte. ( Probably due to compiler failure )
I get this error when I compile, this is the code that is causing the error...

pawn Code:
stock Load(DataType[], Stat[], For[]) {
    if(strcmp(For, "None", true) == 0) {
        #pragma unused For
    }
    if(strcmp(DataType, "serverdata", true) == 0) {
        new
            Query[128],
            Result[128];
        format(Query, 128, "SELECT * FROM serverdata LIMIT 1");
        mysql_query(Query);
        mysql_store_result();
        while(mysql_fetch_row_format(Query, "|")) {
            if(strcmp(Stat, "Name", true) == 0) {
                mysql_fetch_field_row(Result, "Name");
            }
            if(strcmp(Stat, "Mode", true) == 0) {
                mysql_fetch_field_row(Result, "Mode");
            }
            if(strcmp(Stat, "Map", true) == 0) {
                mysql_fetch_field_row(Result, "Map");
            }
        }
        mysql_free_result();
        return Result;
    }
    return false;
}
I am trying to make it so it loads single data and returning the string or value.
Can someone please help? +rep would be rewarded.
Reply


Messages In This Thread
Returning Strings - by TheLazySloth - 22.01.2012, 12:12
Re: Returning Strings - by Sinner - 22.01.2012, 12:27
Re: Returning Strings - by TheLazySloth - 22.01.2012, 12:31
Re: Returning Strings - by Sinner - 22.01.2012, 12:35
Re: Returning Strings - by TheLazySloth - 22.01.2012, 12:36

Forum Jump:


Users browsing this thread: 1 Guest(s)