Warnings!!
#1

I got these warnings.
Код:
f\business.pwn(2084) : warning 217: loose indentation
f\business.pwn(2085) : warning 217: loose indentation
f\business.pwn(2086) : warning 217: loose indentation
f\business.pwn(2087) : warning 217: loose indentation
f\business.pwn(2088) : warning 217: loose indentation
f\business.pwn(2181) : warning 217: loose indentation
And I got these lines from 2081-2090
pawn Код:
new numitems;
    if(total != 0)
    {
        CheckNumberedItem("Vehicle Lock Picks","VehLockpicks")
        CheckNumberedItem("Vehicle Tracer","VehTracers")
        CheckNumberedItem("Cigars","Cigars")
        CheckNumberedItem("Fertilizer","NumFertilizer")
        CheckNumberedItem("Gas Can","GasCans")
        format(tempstr,sizeof(tempstr),"Congratulations, you now own %s %s",getNumberString(numitems) ,Buyable24Items[itemid][EBIDisplayName]);
    }
Reply
#2

You need add all you function to correctly
pawn Код:
new numitems;
if(total != 0)
{
        CheckNumberedItem("Vehicle Lock Picks","VehLockpicks")
        CheckNumberedItem("Vehicle Tracer","VehTracers")
        CheckNumberedItem("Cigars","Cigars")
        CheckNumberedItem("Fertilizer","NumFertilizer")
        CheckNumberedItem("Gas Can","GasCans")
        format(tempstr,sizeof(tempstr),"Congratulations, you now own %s %s",getNumberString(numitems) ,Buyable24Items[itemid][EBIDisplayName]);
}
Reply
#3

That's one of the common error among all errors. This is due to the indentation, the spacing, use TAB and SHIFT + TAB to reverse TAB and make it properly indent. ****** about it for more information.

Also, CheckNumberedItem(x, x) <-- needs ;
Reply
#4

In future search to see if your question has been asked already, http://lmgtfy.com/?q=warning+217%3A+...orum.sa-mp.com
Reply
#5

I really thank you all. REP+
EDIT:
I got some other warning but I don't know how to fix them.
Код:
f\sqlqueries.pwn(474) : warning 202: number of arguments does not match definition
f\sqlqueries.pwn(474) : warning 202: number of arguments does not match definition
f\sqlqueries.pwn(525) : warning 202: number of arguments does not match definition
f\sqlqueries.pwn(525) : warning 202: number of arguments does not match definition
f\sqlqueries.pwn(578) : warning 202: number of arguments does not match definition
f\sqlqueries.pwn(578) : warning 202: number of arguments does not match definition
Line 577-581:
pawn Код:
strcat(msg, "|", sizeof(msg));
    SendClientMessage(playerid, COLOR_YELLOW, "Teacher's List:", 0, 128);
    //SendSplitClientMessage(playerid, COLOR_GREEN, msg, 0, 128);
    msg[0] = 0;
    for(new i=0;i<rows;i++)
In the other lines it's like the same code but with other name in SendClientMessage Line where the "" are
Reply
#6

Show me lines at 474 until 578
Reply
#7

Here are lines 473 until 588:
pawn Код:
strcat(msg, "|", sizeof(msg));
    SendClientMessage(playerid, COLOR_YELLOW, "Admin List:", 0, 128);
    //SendSplitClientMessage(playerid, COLOR_GREEN, msg, 0, 128);
    msg[0] = 0;
    for(new i=0;i<rows;i++)
    {
        for(new x=0;x<columns;x++)
        {
            cache_get_row(i,x,rowname, connhandle);
            format(tmsg, sizeof(tmsg), "%s          ", rowname);
            strcat(msg, tmsg, sizeof(msg));
        }
        //strcat(msg, "|", sizeof(msg));
        SendSplitClientMessage(playerid, COLOR_LIGHTBLUE, msg, 0, 128);
        msg[0] = 0;
    }
    strcat(msg, "|", sizeof(msg));

    //format(msg, sizeof(msg), "* %d rows returned, %d columns",rows,columns);
    //SendClientMessage(playerid, COLOR_GREEN, msg);
    return 1;
}
public OnSQLQueryHelper(playerid) {
    new rows, columns;
    new connhandle = playerConnectHandle[playerid];
    if(connhandle == -1) {
        connhandle = g_mysql_handle;
    }
    new msg[512],rowname[64], tmsg[128];
    cache_get_data(rows, columns, connhandle);
    if(columns == 0) {
        new num = mysql_affected_rows(connhandle);
        new insert_id = mysql_insert_id();
        if(num != 0 || insert_id == 0) {
            format(msg, sizeof(msg), "* %d rows affected.",num);
        } else {
            format(msg, sizeof(msg), "* Last Insert ID: %d",insert_id);
        }
        SendClientMessage(playerid, X11_TOMATO_2, msg);
        return 1;
    }
    if(rows == 0) {
        SendClientMessage(playerid, X11_TOMATO_2, "No results returned.");
        return 1;
    }
    for(new i=0;i<columns;i++)
    {
        cache_get_field(i,rowname, connhandle);
        format(tmsg, sizeof(tmsg), "|%s", rowname);
        strcat(msg, tmsg, sizeof(msg));
    }
    strcat(msg, "|", sizeof(msg));
    SendClientMessage(playerid, COLOR_YELLOW, "Helper's List:", 0, 128);
    //SendSplitClientMessage(playerid, COLOR_GREEN, msg, 0, 128);
    msg[0] = 0;
    for(new i=0;i<rows;i++)
    {
        for(new x=0;x<columns;x++)
        {
            cache_get_row(i,x,rowname, connhandle);
            format(tmsg, sizeof(tmsg), "%s", rowname);
            strcat(msg, tmsg, sizeof(msg));
        }
        //strcat(msg, "|", sizeof(msg));
        SendSplitClientMessage(playerid, COLOR_LIGHTBLUE, msg, 0, 128);
        msg[0] = 0;
    }
    strcat(msg, "|", sizeof(msg));
    mysql_function_query(connhandle, "SELECT `username` FROM `accounts` WHERE `newbrank` >= 2", true, "OnSQLQueryTeacher", "d",playerid);
    //format(msg, sizeof(msg), "* %d rows returned, %d columns",rows,columns);
    //SendClientMessage(playerid, COLOR_GREEN, msg);
    return 1;
}

forward  OnSQLQueryTeacher(playerid);
public OnSQLQueryTeacher(playerid) {
    new rows, columns;
    new connhandle = playerConnectHandle[playerid];
    if(connhandle == -1) {
        connhandle = g_mysql_handle;
    }
    new msg[512],rowname[64], tmsg[128];
    cache_get_data(rows, columns, connhandle);
    if(columns == 0) {
        new num = mysql_affected_rows(connhandle);
        new insert_id = mysql_insert_id();
        if(num != 0 || insert_id == 0) {
            format(msg, sizeof(msg), "* %d rows affected.",num);
        } else {
            format(msg, sizeof(msg), "* Last Insert ID: %d",insert_id);
        }
        SendClientMessage(playerid, X11_TOMATO_2, msg);
        return 1;
    }
    if(rows == 0) {
        SendClientMessage(playerid, X11_TOMATO_2, "No results returned.");
        return 1;
    }
    for(new i=0;i<columns;i++)
    {
        cache_get_field(i,rowname, connhandle);
        format(tmsg, sizeof(tmsg), "|%s", rowname);
        strcat(msg, tmsg, sizeof(msg));
    }
    strcat(msg, "|", sizeof(msg));
    SendClientMessage(playerid, COLOR_YELLOW, "Teacher's List:", 0, 128);
    //SendSplitClientMessage(playerid, COLOR_GREEN, msg, 0, 128);
    msg[0] = 0;
    for(new i=0;i<rows;i++)
    {
        for(new x=0;x<columns;x++)
        {
            cache_get_row(i,x,rowname, connhandle);
            format(tmsg, sizeof(tmsg), "%s", rowname);
            strcat(msg, tmsg, sizeof(msg));
        }
Reply
#8

SendClientMessage(playerid, color, const message[]);
That's not SendClientMessage(playerid, color, const message[], var, string);

pawn Код:
strcat(msg, "|", sizeof(msg));
    SendClientMessage(playerid, COLOR_YELLOW, "Admin List:");
    //SendSplitClientMessage(playerid, COLOR_GREEN, msg, 0, 128);
    msg[0] = 0;
    for(new i=0;i<rows;i++)
    {
        for(new x=0;x<columns;x++)
        {
            cache_get_row(i,x,rowname, connhandle);
            format(tmsg, sizeof(tmsg), "%s          ", rowname);
            strcat(msg, tmsg, sizeof(msg));
        }
        //strcat(msg, "|", sizeof(msg));
        SendSplitClientMessage(playerid, COLOR_LIGHTBLUE, msg, 0, 128);
        msg[0] = 0;
    }
    strcat(msg, "|", sizeof(msg));

    //format(msg, sizeof(msg), "* %d rows returned, %d columns",rows,columns);
    //SendClientMessage(playerid, COLOR_GREEN, msg);
    return 1;
}
public OnSQLQueryHelper(playerid) {
    new rows, columns;
    new connhandle = playerConnectHandle[playerid];
    if(connhandle == -1) {
        connhandle = g_mysql_handle;
    }
    new msg[512],rowname[64], tmsg[128];
    cache_get_data(rows, columns, connhandle);
    if(columns == 0) {
        new num = mysql_affected_rows(connhandle);
        new insert_id = mysql_insert_id();
        if(num != 0 || insert_id == 0) {
            format(msg, sizeof(msg), "* %d rows affected.",num);
        } else {
            format(msg, sizeof(msg), "* Last Insert ID: %d",insert_id);
        }
        SendClientMessage(playerid, X11_TOMATO_2, msg);
        return 1;
    }
    if(rows == 0) {
        SendClientMessage(playerid, X11_TOMATO_2, "No results returned.");
        return 1;
    }
    for(new i=0;i<columns;i++)
    {
        cache_get_field(i,rowname, connhandle);
        format(tmsg, sizeof(tmsg), "|%s", rowname);
        strcat(msg, tmsg, sizeof(msg));
    }
    strcat(msg, "|", sizeof(msg));
    SendClientMessage(playerid, COLOR_YELLOW, "Helper's List:");
    //SendSplitClientMessage(playerid, COLOR_GREEN, msg, 0, 128);
    msg[0] = 0;
    for(new i=0;i<rows;i++)
    {
        for(new x=0;x<columns;x++)
        {
            cache_get_row(i,x,rowname, connhandle);
            format(tmsg, sizeof(tmsg), "%s", rowname);
            strcat(msg, tmsg, sizeof(msg));
        }
        //strcat(msg, "|", sizeof(msg));
        SendSplitClientMessage(playerid, COLOR_LIGHTBLUE, msg, 0, 128);
        msg[0] = 0;
    }
    strcat(msg, "|", sizeof(msg));
    mysql_function_query(connhandle, "SELECT `username` FROM `accounts` WHERE `newbrank` >= 2", true, "OnSQLQueryTeacher", "d",playerid);
    //format(msg, sizeof(msg), "* %d rows returned, %d columns",rows,columns);
    //SendClientMessage(playerid, COLOR_GREEN, msg);
    return 1;
}

forward  OnSQLQueryTeacher(playerid);
public OnSQLQueryTeacher(playerid) {
    new rows, columns;
    new connhandle = playerConnectHandle[playerid];
    if(connhandle == -1) {
        connhandle = g_mysql_handle;
    }
    new msg[512],rowname[64], tmsg[128];
    cache_get_data(rows, columns, connhandle);
    if(columns == 0) {
        new num = mysql_affected_rows(connhandle);
        new insert_id = mysql_insert_id();
        if(num != 0 || insert_id == 0) {
            format(msg, sizeof(msg), "* %d rows affected.",num);
        } else {
            format(msg, sizeof(msg), "* Last Insert ID: %d",insert_id);
        }
        SendClientMessage(playerid, X11_TOMATO_2, msg);
        return 1;
    }
    if(rows == 0) {
        SendClientMessage(playerid, X11_TOMATO_2, "No results returned.");
        return 1;
    }
    for(new i=0;i<columns;i++)
    {
        cache_get_field(i,rowname, connhandle);
        format(tmsg, sizeof(tmsg), "|%s", rowname);
        strcat(msg, tmsg, sizeof(msg));
    }
    strcat(msg, "|", sizeof(msg));
    SendClientMessage(playerid, COLOR_YELLOW, "Teacher's List:");
    //SendSplitClientMessage(playerid, COLOR_GREEN, msg, 0, 128);
    msg[0] = 0;
    for(new i=0;i<rows;i++)
    {
        for(new x=0;x<columns;x++)
        {
            cache_get_row(i,x,rowname, connhandle);
            format(tmsg, sizeof(tmsg), "%s", rowname);
            strcat(msg, tmsg, sizeof(msg));
        }
Reply
#9

Yea but if I do it this way when an Admin List is sent to a player it will only say "Admin List:" it wont be like Example. "Admin List: George_Johnson" bla bla

Correct me If I'm wrong.
Reply
#10

Nope test it before dude.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)