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.