bok
Member
shop.lua
Would it be possible to add Premium Account to deliver to shop.lua?
Edit: My TFS 1.2x
SQL:
Lua:
function onThink(interval, lastExecution)
local queryShop = db.storeQuery('SELECT * FROM `z_ots_comunication`')
if queryShop ~= false then
repeat
local id, player = result.getNumber(queryShop, 'id'), Player(result.getString(queryShop, 'name'))
if player then
local item_id, item_count = result.getNumber(queryShop, 'param1'), result.getNumber(queryShop, 'param2')
local container_id, container_count = result.getNumber(queryShop, 'param3'), result.getNumber(queryShop, 'param4')
local offer_type = result.getString(queryShop, 'param5')
local item_name = result.getString(queryShop, 'param6')
-- ITEM
if offer_type == 'item' then
player:getInbox():addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do OT Shop em seu depot.')
-- ITEM NEWS
elseif offer_type == 'novos' then
player:getInbox():addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do OT Shop em seu depot.')
-- ITEM UMBRAL
elseif offer_type == 'umbral' then
player:getInbox():addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do OT Shop em seu depot.')
-- ITEM CUSTOM
elseif offer_type == 'custom' then
player:getInbox():addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do OT Shop em seu depot.')
-- CONTAINER
elseif offer_type == 'container' then
local container_id, container_count = result.getNumber(queryShop, 'param3'), result.getNumber(queryShop, 'param4')
local i, new_container = 0, player:getInbox():addItem(container_id, 1, INDEX_WHEREEVER, FLAG_NOLIMIT)
while i ~= container_count do
new_container:addItem(item_id, item_count, INDEX_WHEREEVER, FLAG_NOLIMIT)
i = i + 1
end
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..' << do OT Shop em seu depot.')
-- ADDON
elseif offer_type == 'addon' then
player:addOutfitAddon(item_id, 3)
player:addOutfitAddon(item_count, 3)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..'.')
-- MOUNT
elseif offer_type == 'mount' then
player:addMount(item_id)
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'Voce recebeu >> '.. item_name ..'.')
end
db.asyncQuery('DELETE FROM `z_ots_comunication` WHERE `id` = ' .. id)
db.asyncQuery('UPDATE `z_shop_history_item` SET `trans_state` = \'realized\', `trans_real` = ' .. os.time() .. ' WHERE id = ' .. id)
end
until not result.next(queryShop)
result.free(queryShop)
end
return true
end
Edit: My TFS 1.2x
SQL:
PHP:
INSERT INTO `z_ots_comunication` (`id`, `name`, `type`, `action`, `param1`, `param2`, `param3`, `param4`, `param5`, `param6`, `param7`, `delete_it`) VALUES
(ID, 'Player Name', 'login', 'pacc', '0', '15(Days)', 'Null', 'Null', 'Null', '15x Days of Premium Account( Offer Name)', 'Null', 1);
Last edited: