error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
error_reporting(0);
if( is_array($offer_list['item']) && count($offer_list['item']) > 0)
elseif( is_array($offer_list['container']) && count($offer_list['container']) > 0)
if( (is_array($offer_list['item'] && is_array($offer_list['container'])) && (count($offer_list['item']) > 0) or (count($offer_list['container']) > 0))
if( is_array($offer_list['item']) && (count($offer_list['item']) > 0) and ($action == 'item'))
if( is_array($offer_list['container']) && (count($offer_list['container']) > 0) and ($action == 'container'))
if( (is_array($offer_list['item']) && is_array($offer_list['container'])) && (count($offer_list['item']) > 0) or (count($offer_list['container']) > 0))
It's tutorial for Gesior 2012 account maker, not old one.
1. What will you need?
- installed account maker
- working ots based on TFS 0.3.6/0.4
Tutorial:
1. INSTALLATION OF SHOP [to make it deliver items]
Shop show images of items. It will not work, if you don't install item images! [there is tutorial how to do it]
It adds in description of all items (also in containers) name of player that bought item and unique ID of shop system transaction ^_^
1. Open account maker folder and go to folder config and edit file config.php
2. Find in it line:
and change it value to truePHP:$config['site']['shop_system'] = false; // show server shop page? use only if you installed LUA scripts of shop
3. Now open folder data of your ots
4. Open file globalevents.xml in folder globalevents
5. Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
or:XML:<globalevent name="website_shop_item_delivery" interval="30" event="script" value="shop.lua"/>
(if in that file is event 'save' with interval 3600/7200 then add 30 [it's time in seconds], if interval is very high like 3600000/7200000 then add line with interval 30000 [it's time in miliseconds - ms])XML:<globalevent name="website_shop_item_delivery" interval="30000" event="script" value="shop.lua"/>
6. Create file shop.lua in folder globalevents/scripts and paste in it:
That script should work on 0.3.6 and 0.4 without problems (made for my 0.3.6pl1 OTS and tests on 0.4 client 9.6).Lua:-- ### CONFIG ### -- message send to player by script "type" (types you can check in "data/lib/000-constants.lua") SHOP_MSG_TYPE = MESSAGE_STATUS_CONSOLE_BLUE -- time (in seconds) between queries to MySQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM `z_ots_comunication` WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) doItemSetAttribute(new_container, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') doItemSetAttribute(new_container, "tid", id) local iter = 0 while iter ~= container_count do local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') doItemSetAttribute(new_item, "tid", id) doAddContainerItemEx(new_container, new_item) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') doItemSetAttribute(new_item, "tid", id) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') doPlayerSave(cid) db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end return true end
Script only for OTSes that use MySQL database!
2. INSTALLATION OF 'ADD SHOP ITEMS' TALKACTION
1. Now open folder data of your ots
2. Open file talkactions.xml in folder talkactions
3. Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
[this line is from TFS 0.4 client 9.6, it may look a bit different on old distributions, make it like other talkactions for GOD]
4. Create file add_shop_talkaction.lua in folder talkactions/scripts and paste in it [tested on TFS 0.4 client 9.6, should works good with all 0.4]:XML:<talkaction log="yes" words="/addshop" access="5" event="script" value="add_shop_talkaction.lua"/>
http://paste.ots.me/560784/text
If script above doesn't work for you (error in console) try SECOND script:
http://paste.ots.me/560783/text
3. SHOP ADMINISTRATION
1. Add offer
1.1 Add with first LUA 'add shop' script [first script works good on 0.4 client 9.6, but I'm not sure if it works on 0.3.6]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add IN FRONT OF YOU:
![]()
Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:
![]()
Then in SMS shop it shows:
![]()
1.2 Add with second LUA 'add shop' script [works on all TFSes 0.3.6/0.4, BUT on 9.6 you can't put all items in right hand!]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add in your right hand:
![]()
Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:
![]()
Then in SMS shop it shows [old shop images, not it shows images]:
![]()
2. Remove offer
You can remove offers in 'phpmyadmin' [database]. Remove rows from tablez_shop_offer
.
3. Edit offer
You can edit offers in 'phpmyadmin' [database]. Edit rows in tablez_shop_offer
, but it's not easy to understand, so better remove and add again.
1. Try some online website proxy like: hide.me VPN (https://hide.me/en/proxy)The link's (paste.ot..) to talkaction don't work, i need for finish my project...Help me
function onSay(cid, words, param, channel)
local toPos = getCreatureLookPosition(cid) -- this function may not exists in old TFSes :/
toPos.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local params = string.explode(param, ",")
local price = params[1]
table.remove(params, 1)
local desc = table.concat(params,",")
local name = ''
local item1 = getThingFromPos(toPos)
local itemid1 = item1.itemid
local count1 = item1.type
local itemid2 = 0
local count2 = 0
if(itemid1 == 0 or isCreature(item1.uid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "There is no moveable item in front of you or there is creature.")
return true
end
if(not price) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must set price.")
return true
end
price = tonumber(price)
local itemInfo = getItemInfo(itemid1)
local offer_type = 'item'
if(isContainer(item1.uid)) then
local item2 = getContainerItem(item1.uid, 0)
if(item2.itemid > 0) then
count1 = getContainerCap(item1.uid)
itemid2 = item2.itemid
count2 = item2.type
offer_type = 'container'
itemInfo = getItemInfo(itemid2)
end
end
local count1_desc = (count1 > 0) and count1 or 1
local count2_desc = (count2 > 0) and count2 or 1
if(itemid2 == 0) then
name = count1_desc .. 'x ' .. itemInfo.name
else
name = count1_desc .. 'x ' .. count2_desc .. 'x ' .. itemInfo.name
end
db.executeQuery('INSERT INTO `z_shop_offer` (`id` ,`points` ,`itemid1` ,`count1` ,`itemid2` ,`count2` ,`offer_type` ,`offer_description` ,`offer_name`) VALUES (NULL , ' .. price .. ', ' .. itemid1 .. ', ' .. count1 .. ', ' .. itemid2 .. ', ' .. count2 .. ', \'' .. offer_type .. '\', ' .. db.escapeString(desc) .. ', ' .. db.escapeString(name) .. ');')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item >> " .. name .. " << added to SMS shop. Price is " .. price .. " premium points.")
return true
end
function onSay(cid, words, param, channel)
local params = string.explode(param, ",")
local price = params[1]
table.remove(params, 1)
local desc = table.concat(params,",")
local name = ''
local item1 = getPlayerSlotItem(cid, CONST_SLOT_RIGHT)
local itemid1 = item1.itemid
local count1 = item1.type
local itemid2 = 0
local count2 = 0
if(itemid1 == 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Put item in right hand.")
return true
end
if(not price) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must set price.")
return true
end
price = tonumber(price)
local itemInfo = getItemInfo(itemid1)
local offer_type = 'item'
if(isContainer(item1.uid)) then
local item2 = getContainerItem(item1.uid, 0)
if(item2.itemid > 0) then
count1 = getContainerCap(item1.uid)
itemid2 = item2.itemid
count2 = item2.type
offer_type = 'container'
itemInfo = getItemInfo(itemid2)
end
end
local count1_desc = (count1 > 0) and count1 or 1
local count2_desc = (count2 > 0) and count2 or 1
if(itemid2 == 0) then
name = count1_desc .. 'x ' .. itemInfo.name
else
name = count1_desc .. 'x ' .. count2_desc .. 'x ' .. itemInfo.name
end
db.executeQuery('INSERT INTO `z_shop_offer` (`id` ,`points` ,`itemid1` ,`count1` ,`itemid2` ,`count2` ,`offer_type` ,`offer_description` ,`offer_name`) VALUES (NULL , ' .. price .. ', ' .. itemid1 .. ', ' .. count1 .. ', ' .. itemid2 .. ', ' .. count2 .. ', \'' .. offer_type .. '\', ' .. db.escapeString(desc) .. ', ' .. db.escapeString(name) .. ');')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item >> " .. name .. " << added to SMS shop. Price is " .. price .. " premium points.")
return true
end
Zrobiłem jak należy, mam tfsa 1.2 powinno działać skoro mam acc maker 2012? mam rozumiec że potem wchodze na goda i wpisuje /addshop 50 < i to znaczy że dodaje itema którego mam w prawej ręce do shopa za 50 ptk?It's tutorial for Gesior 2012 account maker, not old one.
1. What will you need?
- installed account maker
- working ots based on TFS 0.3.6/0.4
Tutorial:
1. INSTALLATION OF SHOP [to make it deliver items]
Shop show images of items. It will not work, if you don't install item images! [there is tutorial how to do it]
It adds in description of all items (also in containers) name of player that bought item and unique ID of shop system transaction ^_^
1. Open account maker folder and go to folder config and edit file config.php
2. Find in it line:
and change it value to truePHP:$config['site']['shop_system'] = false; // show server shop page? use only if you installed LUA scripts of shop
3. Now open folder data of your ots
4. Open file globalevents.xml in folder globalevents
5. Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
or:XML:<globalevent name="website_shop_item_delivery" interval="30" event="script" value="shop.lua"/>
(if in that file is event 'save' with interval 3600/7200 then add 30 [it's time in seconds], if interval is very high like 3600000/7200000 then add line with interval 30000 [it's time in miliseconds - ms])XML:<globalevent name="website_shop_item_delivery" interval="30000" event="script" value="shop.lua"/>
6. Create file shop.lua in folder globalevents/scripts and paste in it:
That script should work on 0.3.6 and 0.4 without problems (made for my 0.3.6pl1 OTS and tests on 0.4 client 9.6).Lua:-- ### CONFIG ### -- message send to player by script "type" (types you can check in "data/lib/000-constants.lua") SHOP_MSG_TYPE = MESSAGE_STATUS_CONSOLE_BLUE -- time (in seconds) between queries to MySQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM `z_ots_comunication` WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) doItemSetAttribute(new_container, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') doItemSetAttribute(new_container, "tid", id) local iter = 0 while iter ~= container_count do local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') doItemSetAttribute(new_item, "tid", id) doAddContainerItemEx(new_container, new_item) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') doItemSetAttribute(new_item, "tid", id) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') doPlayerSave(cid) db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end return true end
Script only for OTSes that use MySQL database!
2. INSTALLATION OF 'ADD SHOP ITEMS' TALKACTION
1. Now open folder data of your ots
2. Open file talkactions.xml in folder talkactions
3. Add there line (don't break XML structure, ask someone to help you if you got no idea about XML files format):
[this line is from TFS 0.4 client 9.6, it may look a bit different on old distributions, make it like other talkactions for GOD]
4. Create file add_shop_talkaction.lua in folder talkactions/scripts and paste in it [tested on TFS 0.4 client 9.6, should works good with all 0.4]:XML:<talkaction log="yes" words="/addshop" access="5" event="script" value="add_shop_talkaction.lua"/>
http://paste.ots.me/560784/text
If script above doesn't work for you (error in console) try SECOND script:
http://paste.ots.me/560783/text
3. SHOP ADMINISTRATION
1. Add offer
1.1 Add with first LUA 'add shop' script [first script works good on 0.4 client 9.6, but I'm not sure if it works on 0.3.6]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add IN FRONT OF YOU:
![]()
Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:
![]()
Then in SMS shop it shows:
![]()
1.2 Add with second LUA 'add shop' script [works on all TFSes 0.3.6/0.4, BUT on 9.6 you can't put all items in right hand!]
Login on GOD character and put item/backpack [it will add full backpack of first item in backpack when player buy] that you want add in your right hand:
![]()
Say /addshop price or /addshop price, D e( ee'e') sc,ri p, tio n:
![]()
Then in SMS shop it shows [old shop images, not it shows images]:
![]()
2. Remove offer
You can remove offers in 'phpmyadmin' [database]. Remove rows from tablez_shop_offer
.
3. Edit offer
You can edit offers in 'phpmyadmin' [database]. Edit rows in tablez_shop_offer
, but it's not easy to understand, so better remove and add again.
@Lyky
You should disable errors and warnings in PHP.
You can try to change index.php:
To:Code:error_reporting(E_ALL ^ E_STRICT ^ E_NOTICE);
Then it won't show any errors on website.Code:error_reporting(0);
Acc. maker has a lot of 'small bugs'. Not related to security/functionality, just code isn't clean.
i have this error an you explain to me?This error means that your TFS is not compatible with LUA script that you installed and it's weird as in TFS 0.3.6 and 0.3.6pl1 function:
db.executeQuery(query)
is definied in engine.
Did you modify anything in folder /data/lib/ ?
Your error says your engine is missing function[06:46:16.891] data/talkactions/scripts/add_shop_talkaction.lua:26: attempt to call global 'isContainer' (a nil value)
isContainer
.local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE
local SQL_interval = 30
--- ### Outfits List ###
local femaleOutfits = {
["citizen"]={136},
["hunter"]={137},
["mage"]={138},
["knight"]={139},
["noblewoman"]={140},
["summoner"]={141},
["warrior"]={142},
["barbarian"]={147},
["druid"]={148},
["wizard"]={149},
["oriental"]={150},
["pirate"]={155},
["assassin"]={156},
["beggar"]={157},
["shaman"]={158},
["norsewoman"]={252},
["nightmare"]={269},
["jester"]={270},
["brotherhood"]={279},
["demonhunter"]={288},
["yalaharian"]={324},
["warmaster"]={336},
["wayfarer"]={366},
["afflicted"]={431},
["elementalist"]={433},
["deepling"]={464},
["insectoid"]={466},
["red baron"]={471},
["crystal warlord"]={513},
["soil guardian"]={514},
["demon"]={542}
}
local maleOutfits = {
["citizen"]={128},
["hunter"]={129},
["mage"]={130},
["knight"]={131},
["noblewoman"]={132},
["summoner"]={133},
["warrior"]={134},
["barbarian"]={143},
["druid"]={144},
["wizard"]={145},
["oriental"]={146},
["pirate"]={151},
["assassin"]={152},
["beggar"]={153},
["shaman"]={154},
["norsewoman"]={251},
["nightmare"]={268},
["jester"]={273},
["brotherhood"]={278},
["demonhunter"]={289},
["yalaharian"]={325},
["warmaster"]={335},
["wayfarer"]={367},
["afflicted"]={430},
["elementalist"]={432},
["deepling"]={463},
["insectoid"]={465},
["red baron"]={472},
["crystal warlord"]={512},
["soil guardian"]={516},
["demon"]={541}
}
function onThink(interval, lastExecution)
local result_plr = db.getResult("SELECT * FROM z_ots_comunication")
if(result_plr:getID() ~= -1) then
while(true) do
id = tonumber(result_plr:getDataInt("id"))
local action = tostring(result_plr:getDataString("action"))
local delete = tonumber(result_plr:getDataInt("delete_it"))
local cid = getPlayerByName(tostring(result_plr:getDataString("name")))
if isPlayer(cid) then
local itemtogive_id = tonumber(result_plr:getDataInt("param1"))
local itemtogive_count = tonumber(result_plr:getDataInt("param2"))
local outfit_name = string.lower(tostring(result_plr:getDataString("param3")))
local itemvip = tonumber(result_plr:getDataInt("param4"))
local add_item_type = tostring(result_plr:getDataString("param5"))
local add_item_name = tostring(result_plr:getDataString("param6"))
local points = tonumber(result_plr:getDataInt("param7"))
local received_item = 0
local full_weight = 0
if(action == 'give_item') then
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
if isItemRune(itemtogive_id) == TRUE then
full_weight = getItemWeightById(itemtogive_id, 1)
else
full_weight = getItemWeightById(itemtogive_id, itemtogive_count)
end
local free_cap = getPlayerFreeCap(cid)
local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
if full_weight <= free_cap then
received_item = doPlayerAddItemEx(cid, new_item)
if received_item == RETURNVALUE_NOERROR then
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << RELOGUE PARA SALVAR URGENTE.')
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";")
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.')
end
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.')
end
end
if(action == 'give_outfit') then
if outfit_name ~= "" and maleOutfits[outfit_name] and femaleOutfits[outfit_name] then
local add_outfit = getPlayerSex(cid) == 0 and femaleOutfits[outfit_name][1] or maleOutfits[outfit_name][1]
if not canPlayerWearOutfit(cid, add_outfit, 3) then
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
doPlayerAddOutfit(cid, add_outfit, 3)
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, "You received the outfit " .. add_item_name .. " of our Shop Online.")
else
doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, "You already have this outfit. Your points were returned, thank you.")
db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";")
end
end
end
end
if not(result_plr:next()) then
break
end
end
result_plr:free()
end
return true
end