Command Problem
#1

Hi guys.

Im making a command which will show onnline and offline leaders.

I have this code:
pawn Код:
if(strcmp(cmd, "/alideri", true) == 0)
    {
        new query[126];
        format(query, sizeof(query),"SELECT `pLeader`,`pProfil` FROM `Igraci` WHERE pLeader != '0'");
        mysql_function_query(1, query, true, "ProverkaLideri", "i", playerid);
        return 1;
    }

forward ProverkaLideri(playerid);
public ProverkaLideri(playerid)
{
    new rows, fields;
    new podatok[64];
    new string[64];
    new ime[MAX_PLAYER_NAME];
    new LeaderID;

    cache_get_data(rows, fields);

    if(rows)
    {
        SendClientMessage(playerid, COLOR_YELLOW, " ");
        SendClientMessage(playerid,BLCRVENA, "{739EFA}_________________Offline/Onnline Lideri_________________");
        for(new i = 0; i < rows; i++)
        {
            cache_get_row(i, 35, podatok);
            LeaderID = strval(podatok);

            cache_get_field_content(i, "pProfil", podatok);
            strmid(ime, podatok, 0, strlen(podatok), 64);

            if(LeaderID == 1)
            {
                format(string, sizeof(string), "{0006AD}• LSPD Lider: %s", ime);
                SendClientMessage(playerid, COLOR_YELLOW, string);
            }
        }
        SendClientMessage(playerid,BLCRVENA, "{739EFA}____________________________________________________");
    }
    return 1;
}
With this code i don't get anything... When i type /alideri in-game doesn't show any leader, even me... I also have errors in mysql.log:
Код:
[16:13:36] [WARNING] CMySQLResult::GetRowData - invalid row ('0') or field index ('35')
[16:13:36] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('35')
[16:13:36] [WARNING] CMySQLResult::GetRowData - invalid row ('2') or field index ('35')
[16:13:36] [WARNING] CMySQLResult::GetRowData - invalid row ('3') or field index ('35')
[16:13:36] [WARNING] CMySQLResult::GetRowData - invalid row ('4') or field index ('35')
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)