Loading bans
#1

Okay so i am trying to load bans with the correct id. Now i have this code and theres 1 ban in the mysql database. The id of the ban is 1 and the console says Ban id 0 loaded. This is the code:
pawn Код:
forward OnBansLoad();
public OnBansLoad()
{
    new rows, fields;
    cache_get_data( rows, fields, Handle);

    if(!rows)
    {
        print("Bans table is empty, no results found.");
        return 1;
    }
    new i = 0, id;
    while(rows > i)
    {
        id = cache_get_row_int(i, 0);
        BanVariable[id] = true;// You had only this, no loading any other

        printf("Ban %d Loaded", id);
        i++;
    }
    return 1;
}
How come it doesnt say Ban 1 loaded. because thats the id of the ban.
Reply


Messages In This Thread
Loading bans - by thimo - 19.01.2014, 10:32
Re: Loading bans - by Sithis - 19.01.2014, 11:31

Forum Jump:


Users browsing this thread: 1 Guest(s)