Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

Find number not working, MYSQL.

$
0
0
Code:

        format(query, sizeof(query), "SELECT `PlayerName`,`Number` FROM `accounts` WHERE `PlayerName` LIKE '%%%s%%'", player);
        mysql_tquery(dbHandle, query,"FoundNumber", "i", playerid);
        return 1;
}
forward FoundNumber(playerid);
public FoundNumber(playerid)
{
        new rows, fields;
        cache_get_data(rows, fields);
        new string[512], result[64];
        new name[32], number;
        if(rows)
        {
                for(new x; x < rows; x++)
                {
                        cache_get_row(x, 0, name);
                        number = cache_get_row_int(x, 1);
                        if(number > 0)
                        {
                                format(result, sizeof(result), "%s | Number: %d", name, number);
                                strcat(string, result);
                        }
                }
                SendClientMessage(playerid, COLOUR_WHITE, string);
        }
        if(!rows)
        {
                return SendClientMessage(playerid, COLOUR_GREY, "No numbers found with that name.");
        }
        return 1;
}


It seems to send a blank message when used, it only works briefly. It's very odd.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>