12.01.2019, 05:39
You can do it using cache_get_row_count read the wiki, here's an example
pawn Код:
CMD:yourcommand(playerid, params[])
{
new query[160+MAX_PLAYER_NAME], name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
mysql_format(handle, query, sizeof(query), "SELECT * FROM `Storage_tents` WHERE `OwnerName` = '%s'", name);
mysql_tquery(handle, query, "CheckStorageTent", "i", playerid);
return 1;
}
forward CheckStorageTent(playerid);
public CheckStorageTent(playerid)
{
if(cache_get_row_count(handle) == 5)
{
return SendClientMessage(playerid, -1, "You own 5 tents already!");
}
else
{
//show player the dialog and the rest of your code here
}
return 1;
}