Crashing while using this cmd
#2

Well I've not spotted any errors directly, try and debug the code and look on your console for where the script is stopping (on server_log.txt)

pawn Код:
CMD:richlist(playerid, params[])
{
    mysql_query("SELECT `username`, `money` FROM `data` WHERE `PlayerBanned`=0 ORDER BY `money` DESC LIMIT 10");
    mysql_store_result();
    printf("debug note 1");
    new
        ID,
        output[800];
    printf("debug note 2");
    while(mysql_retrieve_row())
    {
        ID ++;
        printf("debug note 3 ID %d", id);
        new
            username[24],
            moneyvariable[80];
        printf("debug note 4 ID %d", id);
        mysql_fetch_field_row(username, "user");
        mysql_fetch_field_row(moneyvariable, "money");
        printf("debug note 5 ID %d", id);
        format(output, sizeof(output), "%s %d. %s with %d Dollars\n", output, ID, username, strval(moneyvariable));
        printf("debug note 6 ID %d", id);
    }
    mysql_free_result();
    printf("debug note 7");
    ShowPlayerDialog(playerid, 25, DIALOG_STYLE_MSGBOX, "Top 10 Players", output, "OK", "Cancel");
    printf("debug note 8");
    return 1;
}
Reply


Messages In This Thread
Crashing while using this cmd - by Bondage - 28.10.2014, 20:46
Re: Crashing while using this cmd - by DanishHaq - 28.10.2014, 23:21
Re: Crashing while using this cmd - by nemesis- - 29.10.2014, 01:48
Re: Crashing while using this cmd - by Bondage - 29.10.2014, 12:26
Re: Crashing while using this cmd - by Diverse - 29.10.2014, 12:32
Re: Crashing while using this cmd - by Bondage - 29.10.2014, 14:22
Re: Crashing while using this cmd - by Bondage - 29.10.2014, 22:49
Re: Crashing while using this cmd - by Eth - 29.10.2014, 23:32

Forum Jump:


Users browsing this thread: 1 Guest(s)