• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Need help with my server

naod123456

Wazzaap
Joined
Mar 28, 2013
Messages
242
Reaction score
4
Im getting this error everytime somebody buy something from the shop if they buy 1 thing example boh (boots of haste) they get like unlimted ammount of boots of haste


[Error - GlobalEvent Interface]
[11/06/2014 19:49:37] data/globalevents/scripts/shop.lua:eek:nThink
[11/06/2014 19:49:37] Description:
[11/06/2014 19:49:37] data/globalevents/scripts/shop.lua:56: attempt to call field 'executeQuery' (a nil value)
[11/06/2014 19:49:37] stack traceback:
[11/06/2014 19:49:37] data/globalevents/scripts/shop.lua:56: in function <data/globalevents/scripts/shop.lua:7>
[11/06/2014 19:49:38] [Error - GlobalEvents::think] Couldn't execute event: shop
This is line 56

db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
 
Go to data/lib/100-compat.lua and look for db.query/db.executeQuery, remove that line or replace the 2 function names with eachother.
 
Go to data/lib/100-compat.lua and look for db.query/db.executeQuery, remove that line or replace the 2 function names with eachother.

Dont really under what will i remove this is my 100-compat.lua
--[[
* File containing deprecated functions and constants used by alot of scripts and other engines
]]--
TRUE = true
FALSE = false
LUA_ERROR = false
LUA_NO_ERROR = true
LUA_NULL = nil
TALKTYPE_CHANNEL_R1 = TALKTYPE_CHANNEL_RN
TALKTYPE_CHANNEL_R2 = TALKTYPE_CHANNEL_RA
TALKTYPE_ORANGE_1 = TALKTYPE_MONSTER
TALKTYPE_ORANGE_2 = TALKTYPE_MONSTER_YELL
CONDITION_PARAM_STAT_MAXHITPOINTS = CONDITION_PARAM_STAT_MAXHEALTH
CONDITION_PARAM_STAT_MAXMANAPOINTS = CONDITION_PARAM_STAT_MAXMANA
CONDITION_PARAM_STAT_SOULPOINTS = CONDITION_PARAM_STAT_SOUL
CONDITION_PARAM_STAT_MAGICPOINTS = CONDITION_PARAM_STAT_MAGICLEVEL
CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT = CONDITION_PARAM_STAT_MAXHEALTHPERCENT
CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT = CONDITION_PARAM_STAT_MAXMANAPERCENT
CONDITION_PARAM_STAT_SOULPOINTSPERCENT = CONDITION_PARAM_STAT_SOULPERCENT
CONDITION_PARAM_STAT_MAGICPOINTSPERCENT = CONDITION_PARAM_STAT_MAGICLEVELPERCENT
STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE = 1
STACKPOS_SECOND_ITEM_ABOVE_GROUNDTILE = 2
STACKPOS_THIRD_ITEM_ABOVE_GROUNDTILE = 3
STACKPOS_FOURTH_ITEM_ABOVE_GROUNDTILE = 4
STACKPOS_FIFTH_ITEM_ABOVE_GROUNDTILE = 5
CHANNEL_STAFF = 2
CHANNEL_COUNSELOR = 4
CHANNEL_GAMECHAT = 5
CHANNEL_TRADE = 6
CHANNEL_TRADEROOK = 7
CHANNEL_RLCHAT = 8
BANTYPE_IP_BANISHMENT = 1
BANTYPE_NAMELOCK = 2
BANTYPE_BANISHMENT = 3
BANTYPE_NOTATION = 4
BANTYPE_DELETION = 3
SKILLS = SKILL_NAMES
table.getPos = table.find
doSetCreatureDropLoot = doCreatureSetDropLoot
doPlayerSay = doCreatureSay
doPlayerAddMana = doCreatureAddMana
playerLearnInstantSpell = doPlayerLearnInstantSpell
doPlayerRemOutfit = doPlayerRemoveOutfit
pay = doPlayerRemoveMoney
broadcastMessage = doBroadcastMessage
getPlayerName = getCreatureName
getCreaturePosition = getThingPosition
getPlayerPosition = getCreaturePosition
getCreaturePos = getCreaturePosition
creatureGetPosition = getCreaturePosition
getPlayerMana = getCreatureMana
getPlayerMaxMana = getCreatureMaxMana
hasCondition = getCreatureCondition
isMoveable = isMovable
isItemMoveable = isItemMovable
saveData = saveServer
savePlayers = saveServer
getPlayerSkill = getPlayerSkillLevel
getPlayerSkullType = getCreatureSkullType
getCreatureSkull = getCreatureSkullType
getAccountNumberByName = getAccountIdByName
getIPByName = getIpByName
getPlayersByIP = getPlayersByIp
getThingfromPos = getThingFromPos
getPlayersByAccountNumber = getPlayersByAccountId
getIPByPlayerName = getIpByName
getPlayersByIPNumber = getPlayersByIp
getAccountNumberByPlayerName = getAccountIdByName
convertIntToIP = doConvertIntegerToIp
convertIPToInt = doConvertIpToInteger
queryTileAddThing = doTileQueryAdd
getTileHouseInfo = getHouseFromPos
executeRaid = doExecuteRaid
saveServer = doSaveServer
cleanHouse = doCleanHouse
cleanMap = doCleanMap
shutdown = doShutdown
mayNotMove = doCreatureSetNoMove
doPlayerSetNoMove = doCreatureSetNoMove
getPlayerNoMove = getCreatureNoMove
getConfigInfo = getConfigValue
doPlayerAddExp = doPlayerAddExperience
isInArea = isInRange
doPlayerSetSkillRate = doPlayerSetRate
getCreatureLookDir = getCreatureLookDirection
getPlayerLookDir = getCreatureLookDirection
getPlayerLookDirection = getCreatureLookDirection
doCreatureSetLookDir = doCreatureSetLookDirection
getPlayerLookPos = getCreatureLookPosition
setPlayerStamina = doPlayerSetStamina
setPlayerPromotionLevel = doPlayerSetPromotionLevel
setPlayerGroupId = doPlayerSetGroupId
setPlayerPartner = doPlayerSetPartner
doPlayerSetStorageValue = doCreatureSetStorage
setPlayerStorageValue = doPlayerSetStorageValue
getPlayerStorageValue = getCreatureStorage
getGlobalStorageValue = getStorage
setGlobalStorageValue = doSetStorage
setPlayerBalance = doPlayerSetBalance
doAddMapMark = doPlayerAddMapMark
doSendTutorial = doPlayerSendTutorial
getWaypointsList = getWaypointList
getPlayerLastLoginSaved = getPlayerLastLogin
getThingPos = getThingPosition
doAreaCombatHealth = doCombatAreaHealth
doAreaCombatMana = doCombatAreaMana
doAreaCombatCondition = doCombatAreaCondition
doAreaCombatDispel = doCombatAreaDispel
getItemDescriptionsById = getItemInfo
hasProperty = hasItemProperty
hasClient = hasPlayerClient
print = std.cout
db.updateQueryLimitOperator = db.updateLimiter
db.stringComparisonOperator = db.stringComparison
PlayerFlag_CannotUseCombat = 0
PlayerFlag_CannotAttackPlayer = 1
PlayerFlag_CannotAttackMonster = 2
PlayerFlag_CannotBeAttacked = 3
PlayerFlag_CanConvinceAll = 4
PlayerFlag_CanSummonAll = 5
PlayerFlag_CanIllusionAll = 6
PlayerFlag_CanSenseInvisibility = 7
PlayerFlag_IgnoredByMonsters = 8
PlayerFlag_NotGainInFight = 9
PlayerFlag_HasInfiniteMana = 10
PlayerFlag_HasInfiniteSoul = 11
PlayerFlag_HasNoExhaustion = 12
PlayerFlag_CannotUseSpells = 13
PlayerFlag_CannotPickupItem = 14
PlayerFlag_CanAlwaysLogin = 15
PlayerFlag_CanBroadcast = 16
PlayerFlag_CanEditHouses = 17
PlayerFlag_CannotBeBanned = 18
PlayerFlag_CannotBePushed = 19
PlayerFlag_HasInfiniteCapacity = 20
PlayerFlag_CanPushAllCreatures = 21
PlayerFlag_CanTalkRedPrivate = 22
PlayerFlag_CanTalkRedChannel = 23
PlayerFlag_TalkOrangeHelpChannel = 24
PlayerFlag_NotGainExperience = 25
PlayerFlag_NotGainMana = 26
PlayerFlag_NotGainHealth = 27
PlayerFlag_NotGainSkill = 28
PlayerFlag_SetMaxSpeed = 29
PlayerFlag_SpecialVIP = 30
PlayerFlag_NotGenerateLoot = 31
PlayerFlag_CanTalkRedChannelAnonymous = 32
PlayerFlag_IgnoreProtectionZone = 33
PlayerFlag_IgnoreSpellCheck = 34
PlayerFlag_IgnoreWeaponCheck = 35
PlayerFlag_CannotBeMuted = 36
PlayerFlag_IsAlwaysPremium = 37
PlayerFlag_CanAnswerRuleViolations = 38
PlayerFlag_39 = 39 -- ignore
PlayerFlag_ShowGroupNameInsteadOfVocation = 40
PlayerFlag_HasInfiniteStamina = 41
PlayerFlag_CannotMoveItems = 42
PlayerFlag_CannotMoveCreatures = 43
PlayerFlag_CanReportBugs = 44
PlayerFlag_45 = 45 -- ignore
PlayerFlag_CannotBeSeen = 46
PlayerCustomFlag_AllowIdle = 0
PlayerCustomFlag_CanSeePosition = 1
PlayerCustomFlag_CanSeeItemDetails = 2
PlayerCustomFlag_CanSeeCreatureDetails = 3
PlayerCustomFlag_NotSearchable = 4
PlayerCustomFlag_GamemasterPrivileges = 5
PlayerCustomFlag_CanThrowAnywhere = 6
PlayerCustomFlag_CanPushAllItems = 7
PlayerCustomFlag_CanMoveAnywhere = 8
PlayerCustomFlag_CanMoveFromFar = 9
PlayerCustomFlag_CanLoginMultipleCharacters = 10
PlayerCustomFlag_HasFullLight = 11
PlayerCustomFlag_CanLogoutAnytime = 12
PlayerCustomFlag_HideLevel = 13
PlayerCustomFlag_IsProtected = 14
PlayerCustomFlag_IsImmune = 15
PlayerCustomFlag_NotGainSkull = 16
PlayerCustomFlag_NotGainUnjustified = 17
PlayerCustomFlag_HideLevel = 18
PlayerCustomFlag_IgnorePacification = 19
PlayerCustomFlag_CanStairhop = 20
PlayerCustomFlag_CanTurnhop = 21
PlayerCustomFlag_IgnoreHouseRent = 22
 
Add this in 100-compat.lua.
Code:
db.query = db.executeQuery

Btw, use code tags.
[ code] your script here [/code]
 
Last edited:
Add this in 100-compat.lua.
Code:
db.query = db.executeQuery

Btw, use code tags.
[ code] your script here [/code]
Now they dont recive (get) the items they are buying this is my shop.lua maybe something wrong there?

Code:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL 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)
  local iter = 0
  while iter ~= container_count do
  doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
  iter = iter + 1
  end
  received_item = doPlayerAddItemEx(cid, new_container)
  else
  local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
  received_item = doPlayerAddItemEx(cid, new_item)
  end
  if received_item == RETURNVALUE_NOERROR then
  doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from Noobwaria shop.')
  db.query ("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 Noobwaria 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 Noobwaria 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   $account->setPremiumPoints($account->getPremiumPoints() + $pay['premium_points']);
 
Now they dont recive (get) the items they are buying this is my shop.lua maybe something wrong there?

Code:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL 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)
  local iter = 0
  while iter ~= container_count do
  doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
  iter = iter + 1
  end
  received_item = doPlayerAddItemEx(cid, new_container)
  else
  local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
  received_item = doPlayerAddItemEx(cid, new_item)
  end
  if received_item == RETURNVALUE_NOERROR then
  doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from Noobwaria shop.')
  db.query ("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 Noobwaria 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 Noobwaria 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   $account->setPremiumPoints($account->getPremiumPoints() + $pay['premium_points']);
try with this one
Code:
-- ### 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.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")
db.query("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
 
Now they dont recive (get) the items they are buying this is my shop.lua maybe something wrong there?

Code:
-- ### CONFIG ###
-- message send to player by script "type" (types you can check in "global.lua")
SHOP_MSG_TYPE = 19
-- time (in seconds) between connections to SQL 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)
  local iter = 0
  while iter ~= container_count do
  doAddContainerItem(new_container, itemtogive_id, itemtogive_count)
  iter = iter + 1
  end
  received_item = doPlayerAddItemEx(cid, new_container)
  else
  local new_item = doCreateItemEx(itemtogive_id, itemtogive_count)
  received_item = doPlayerAddItemEx(cid, new_item)
  end
  if received_item == RETURNVALUE_NOERROR then
  doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from Noobwaria shop.')
  db.query ("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 Noobwaria 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 Noobwaria 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   $account->setPremiumPoints($account->getPremiumPoints() + $pay['premium_points']);
Do you get errors? And are you still using TFS 0.3.6?
It's usefull if you add it to the thread incase you change your server.

If your server is using db.query, then add this to 100-compat.lua and remove the other, that one is for 0.3.6.
Code:
db.executeQuery = db.query
 
Do you get errors? And are you still using TFS 0.3.6?
It's usefull if you add it to the thread incase you change your server.

If your server is using db.query, then add this to 100-compat.lua and remove the other, that one is for 0.3.6.
Code:
db.executeQuery = db.query
I tested kikos script but they still get items from the shop every 30 sec and getting this error
[12/06/2014 13:56:58] [Error - GlobalEvent Interface]
[12/06/2014 13:56:58] data/globalevents/scripts/shop.lua:onThink
[12/06/2014 13:56:58] Description:
[12/06/2014 13:56:58] data/globalevents/scripts/shop.lua:64: attempt to call field 'query' (a nil value)
[12/06/2014 13:56:58] stack traceback:
[12/06/2014 13:56:58] data/globalevents/scripts/shop.lua:64: in function <data/globalevents/scripts/shop.lua:7>
[12/06/2014 13:56:58] [Error - GlobalEvents::think] Couldn't execute event: shop

This is line 64
Code:
db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";")

And i did add the code db.executeQuery = db.query in 100-combat.lua don´t know what the problem is :(
I use tfs 0.3.6 from cryingdemons (the forgotten server)
 
For TFS 0.3.6 add this in 100-compat.lua
Code:
db.query = db.executeQuery
This means, if you use db.query in a script, it's set to db.executeQuery, which is the right function for TFS 0.3.6.
Make sure you don't have db.executeQuery = db.query then anymore.
 
For TFS 0.3.6 add this in 100-compat.lua
Code:
db.query = db.executeQuery
This means, if you use db.query in a script, it's set to db.executeQuery, which is the right function for TFS 0.3.6.
Make sure you don't have db.executeQuery = db.query then anymore.
thx it works now :DDD
 
Back
Top