03.08.2018, 09:29
1. DELETE FROM `inventory` WHERE `amount` = 0;
2. Check if the player has food by running a SELECT * FROM `inventory` WHERE `playername` = %s query, where %s is the player's name; store the result with mysql_store_result();; create a variable called result[MAX_AMOUNT_OF_ITEMS] (make sure to replace MAX_AMOUNT_OF_ITEMS) and then:
3. Just load the ones that aren't empty?
2. Check if the player has food by running a SELECT * FROM `inventory` WHERE `playername` = %s query, where %s is the player's name; store the result with mysql_store_result();; create a variable called result[MAX_AMOUNT_OF_ITEMS] (make sure to replace MAX_AMOUNT_OF_ITEMS) and then:
pawn Код:
while(mysql_retrieve_row())
{
mysql_fetch_field_row(result, "amount");
// Run this query: UPDATE `inventory` SET `itemid` = `food`, `amount` = %i; , where %i is the new value for the amount of X item.
}