SQL ERRORS
#1

Hiya guys today i got a errors
pawn Код:
#if USE_MYSQL == true
public OnQueryFinish(query[], resultid, extraid, connectionHandle)
{
    //printf("OnQueryFinish('%s',%d,%d,%d)",query,resultid,extraid,connectionHandle);

    switch(resultid)
    {
        case _THREAD_GET_AKA :
        {
            mysql_store_result();
            new tempstring[1024], count = 0, finstring[1536];
           
            while(mysql_retrieve_row())
            {
                new result[MAX_PLAYER_NAME], temp[MAX_PLAYER_NAME+50];
               
                mysql_fetch_field_row(result, "PlayerName");
               
                format(temp, sizeof(temp), ""white"\n%d. - %s", count, result);
                strcat(tempstring, temp);
                count++;
            }
            if(count == 1)
            {
                SendClientMessage(extraid, GREEN, "This user has no more account with the same ip");
            }
            else
            {
                format(finstring, sizeof(finstring), ""white"Player has "red"%d "white"account(s) with the same IP,\nHeґs using following names:\n", count);
                strcat(finstring, tempstring);

                ShowPlayerDialog(extraid, AKA_DIALOG, DIALOG_STYLE_MSGBOX, "Aka list", finstring, "OK", "");
            }
            mysql_free_result();
        }
        case _THREAD_ACCOUNT_EXIST :
        {
            mysql_store_result();
            if(mysql_num_rows(gSQL) == 0)
            {
                ShowPlayerRegisterDialog(extraid);
            }
            else
            {
                IsPlayerMySQLBanned(extraid);
            }
            mysql_free_result();
        }
        case _THREAD_CREATE_PLAYER :
        {
            SendClientMessage(extraid, LIGHT_GREEN, "Your account has been created! Welcome!");
            PlayerInfo[extraid][Logged] = true;
        }
        case _THREAD_LOAD_PLAYER :
        {
            mysql_store_result();
            if(mysql_num_rows(gSQL) > 0)
            {
                new resultline[512], score, money, wanted;
               
                mysql_fetch_row_format(resultline);

                if(sscanf(resultline, "p<|>fffdddddddffddddddds[16]",
                    PlayerInfo[extraid][XPos],
                    PlayerInfo[extraid][YPos],
                    PlayerInfo[extraid][ZPos],
                    PlayerInfo[extraid][AdminLevel],
                    PlayerInfo[extraid][VIPLevel],
                    wanted,
                    PlayerInfo[extraid][Kills],
                    PlayerInfo[extraid][Deaths],
                    money,
                    score,
                    PlayerInfo[extraid][Health],
                    PlayerInfo[extraid][Armour],
                    PlayerInfo[extraid][Hours],
                    PlayerInfo[extraid][Minutes],
                    PlayerInfo[extraid][Seconds],
                    PlayerInfo[extraid][KickCount],
                    PlayerInfo[extraid][LastSkin],
                    PlayerInfo[extraid][SpawnCount],
                    PlayerInfo[extraid][ReportCount],
                    PlayerInfo[extraid][RegDate]))
                    {
                        SendClientMessage(extraid, LIGHT_GREEN, "There was a problem while loading your account");
                        KickEx(extraid);
                        mysql_free_result();
                        return 1;
                    }
                   
                SetPlayerWantedLevel(extraid, wanted);
                GivePlayerMoney(extraid, money);
                SetPlayerScore(extraid, score);
                PlayerInfo[extraid][Logged] = true;
                if(PlayerInfo[extraid][AdminLevel] > 0)
                {
                    new string[128];
                    format(string,sizeof(string),"Successfully logged in. (Adminlevel %d)", PlayerInfo[extraid][AdminLevel]);
                    SendClientMessage(extraid,GREEN,string);
                } else SendClientMessage(extraid,GREEN,"Successfully logged in!");
            }
            mysql_free_result();
        }
        case _THREAD_IS_BANNED :
        {
            mysql_store_result();
            if(mysql_num_rows(gSQL) > 0)
            {
                LoadMySQLBanStat(extraid);
            }
            else
            {
                #if USE_AUTO_LOGIN == true
                new IP[16];
                GetPlayerIp(extraid, IP, sizeof(IP));
                MySQLCheckAutoLogin(extraid, IP);
                #else
                ShowPlayerLoginDialog(extraid);
                #endif
            }
            mysql_free_result();
        }
        case _FETCH_BAN_STAT :
        {
            mysql_store_result();
            new string2[512], resultline[512], adminname[MAX_PLAYER_NAME], reason[128], Date[16];
            mysql_fetch_row_format(resultline);
            sscanf(resultline, "p<|>s[24]s[128]s[16]", adminname, reason, Date);
            mysql_free_result();
            format(string2,sizeof(string2),""red"You have been banned\n\n"white"Banned by:\t%s\nYour name:\t%s\nReason:\t%s\nDate:\t\t%s", adminname, GetName(extraid), reason, Date);
            ShowPlayerDialog(extraid, BAN_DIALOG, DIALOG_STYLE_MSGBOX, " ", string2, "OK", "");
            PlayerInfo[extraid][KickCount]++;
            #if PRINT_BYKICK == true
            printf("[KICK]: %s has been kicked", GetName(extraid));
            #endif
            KickEx(extraid);
        }
        case _CHECK_PASSWORD :
        {
            mysql_store_result();
            if(mysql_num_rows(gSQL) > 0)
            {
                LoadPlayer(extraid);
                LogPlayerIn(extraid);
            }
            else
            {
                SendClientMessage(extraid,RED,"Login failed! Incorrect password");
                PlayerInfo[extraid][FailLogin]++;
                printf("LOGIN: %s has failed to login, Wrong password Attempt (%d)", GetName(extraid), PlayerInfo[extraid][FailLogin]);
                if(PlayerInfo[extraid][FailLogin] == MAX_FAIL_LOGINS)
                {
                    printf("%s has been kicked (Failed Logins)",GetName(extraid));
                    #if PRINT_BYKICK == true
                    printf("[KICK]: %s has been kicked", GetName(extraid));
                    #endif
                    Kick(extraid);
                }
                ShowPlayerLoginDialog(extraid);
            }
            mysql_free_result();
        }
        case _CHECK_AUTO_LOGIN :
        {
            mysql_store_result();
            if(mysql_num_rows(gSQL) > 0)
            {
                SendClientMessage(extraid,RED,"SERVER: You will get autologged in now");
                LoadPlayer(extraid);
                LogPlayerIn(extraid);
            }
            else
            {
                ShowPlayerLoginDialog(extraid);
            }
            mysql_free_result();
        }
    }

    return 1;
}

public OnQueryError(errorid, error[], callback[], query[], connectionHandle)//line 1114
{
    printf("%d, %s, %s, %s, %d", errorid, error, callback, query, connectionHandle);
    return 1;
}
Errors:-------
pawn Код:
D:\MellAdminV1.2 R3\filterscripts\MellAdmin.pwn(1114) : error 025: function heading differs from prototype

#endif
Reply
#2

Open a_mysql and search for "forward OnQueryError" text. Copy the parameters from the include and replace those from your script with those you copied.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)