But if in gesior you can have a record of the points wasted per account, must be a way to return them to the accounts.......dont you think so?
Do you want it in PHP or Lua? I'm not good enough at SQL to do it in pure SQL, sorry.
If the script has been deleting records from table z_ots_comunication, it's not possible. It would've been possible if you fixed z_shop_history_pacc on time.![]()

UPDATE accounts SET premium_points = premium_points + (SELECT SUM(price) FROM z_shop_history_item WHERE z_shop_history_item.to_account = accounts.id) WHERE (SELECT COUNT(id) FROM z_shop_history_item WHERE z_shop_history_item.to_account = accounts.id LIMIT 1) > 0;
TRUNCATE TABLE z_shop_history_item;
Try:
If everything worked, you can delete all entries if you want:SQL:UPDATE accounts SET premium_points = premium_points + (SELECT SUM(price) FROM z_shop_history_item WHERE z_shop_history_item.to_account = accounts.id) WHERE (SELECT COUNT(id) FROM z_shop_history_item WHERE z_shop_history_item.to_account = accounts.id LIMIT 1) > 0;
SQL:TRUNCATE TABLE z_shop_history_item;