stock AddHouseSafeItem(houseid, model, amount)
{
new string[102];
mysql_format(connect, string, sizeof string, "SELECT `amount` FROM `house_safe` WHERE `house`='%d' AND `model`='%d'", houseid, model);
new Cache:cache = mysql_query(connect, string);
if(cache_get_row_count(connect) > 0) {
amount += cache_get_field_content_int(0, "amount");
mysql_format(connect, string, sizeof string, "UPDATE `house_safe` SET `amount`='%d' WHERE `house`='%d' AND `model`='%d'", amount, houseid, model);
} else {
mysql_format(connect, string, sizeof string, "INSERT INTO `house_safe`(`house`,`model`,`amount`) VALUES ('%d','%d','%d')", houseid, model, amount);
}
cache_delete(cache, connect);
return mysql_tquery(connect, string);
}