[HELP]Please help loading leader name
#1

So I was make when I give myself leader then it update's fine I mean it save fine and I type /allmembers and on Leader 1: and then it show my name which is fine know is the problem on loading. I reset or shutdown server then turn on and go to server and type /allmembers and it says Leader 1: and here is empty but it should be my name. Thanks

this is in ongamemodeinit:


pawn Код:
mysql_format(mysql,query,sizeof(query),"SELECT * FROM `fbiclanovi`");
    mysql_tquery(mysql,query,"LoadFBI","");
and here is callback LoadFBI

pawn Код:
forward LoadFBI();
public LoadFBI()
{
    new rows,fields;
    cache_get_data(rows,fields,mysql);
    if(rows)
    {
        cache_get_field_content(0,"Leader1",FBIInfo[1][Leader]);
    }
    return 1;
}
Reply
#2

Please anyone? Please. Thanks
Reply
#3

Do you want to load ALL the members or just the leader?

If you only want the leader, it should be something like this
pawn Код:
mysql_format(mysql,query,sizeof(query),"SELECT * FROM `fbiclanovi` WHERE Leader1=?"); // Edit the question mark accordingly.
If you want to load all the members, you have to create a loop.
pawn Код:
forward LoadFBI();
public LoadFBI()
{
    new rows,fields, idx;
    cache_get_data(rows,fields,mysql);
    if(rows)
    {
        while(idx < rows)
        {
            // Fetch all the data on current row.
            idx++;
        }
    }
    return 1;
}
Reply
#4

how you mean fetch all the data is like cache_get_contect here or? Thanks
Reply
#5

Show me your enum or all the variables you want to load, and I'll explain further.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)