• 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!

Lua Help to fix trade-off in game 8.6

kennyubuntu

Member
Joined
May 20, 2016
Messages
150
Reaction score
13
I'm tryng to when player use this item
Code:
14:44 You see a depot chest (Vol:30).
ItemID: [2594].

Item inside depot, show the options to market based on this script
https://otland.net/threads/offline-player-to-player-item-trader-auction-system.51447/

Someone could help me?

@DangerII make this script, but just show the commands, not show the items...

How to fix?

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local result = db.getResult("SELECT * FROM `auction_system` ORDER BY `auction_system`.`id` ASC")

local msg = "Trade Offline:\n\n!offer buy, ID\n!offer remove, ID\n!offer add, ItemName, ItemPrice, ItemCount\n\n"
if(result:getID() == -1) then
repeat
local id = result:getDataString("id")
local name = getPlayerNameByGUID(result:getDataString("player"))
local item_name = getItemNameById(result:getDataString("item_id"))
local count = result:getDataString("count")
local custo = result:getDataString("cost")/1000
local custo2 = result:getDataString("cost")
if isPlayer(cid) then
msg = ""..msg.."ID : "..id.."\nItem Name : "..item_name.." - Item Count : "..count.." - Item Cust : "..custo.."k("..custo2.."GP) - Dono : "..name.."\n"
end
until not result.next(result_plr)
result.free(result_plr)
end
doPlayerPopupFYI(cid, msg) return true
end

Its show me just
Code:
Trade Offline:

!offer buy, ID
!offer remove,ID
!offer add, ItemName, ItemPrice, ItemCount
 
Shouldn't it be?
Code:
if(result:getID() ~= -1) then

I was changed it, but gave me other error
Code:
[16:16:28.536] [Error - Action Interface]
[16:16:28.536] data/actions/scripts/tradeoff_depotchest.lua:onUse
[16:16:28.536] Description:
[16:16:28.536] data/lib/004-database.lua:91: attempt to index local 'self' (a nil value)
[16:16:28.536] stack traceback:
[16:16:28.536]    data/lib/004-database.lua:91: in function 'next'
[16:16:28.536]    data/actions/scripts/tradeoff_depotchest.lua:16: in function <data/actions/scripts/tradeoff_depotchest.lua:1>

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
  local result = db.getResult("SELECT * FROM `auction_system` ORDER BY `auction_system`.`id` ASC")

  local msg = "Market:\n\n/market buy, ID\n/market remove, ID\n/market add, ItemName, ItemPrice, ItemCount\n\n"
  if(result:getID() ~= -1) then
  repeat
  local id = result:getDataString("id")
  local name = getPlayerNameByGUID(result:getDataString("player"))
  local item_name = getItemNameById(result:getDataString("item_id"))
  local count = result:getDataString("count")
  local custo = result:getDataString("cost")/1000
  local custo2 = result:getDataString("cost")
  if isPlayer(cid) then
  msg = ""..msg.."ID : "..id.."\nItem Name : "..item_name.." - Item Count : "..count.." - Item Cust : "..custo.."k("..custo2.."GP) - Dono : "..name.."\n"
  end
  until not result.next(result_plr)
  result.free(result_plr)
  end
  doPlayerPopupFYI(cid, msg) return true
end
 
Change
Code:
  until not result.next(result_plr)
  result.free(result_plr)

To
Code:
  until not result:next()
  result:free()

Ty!! It's work now!

But there is other function like doPlayerPopupFYI
Or a way to make buttons in doPlayerPopupFYI
To make search button by item,by seller, my offers...

To be a nice in-game market in 8.60?
 

Ok, ty :(

With sources edits and no client edits would be possible? Make something like:
2cy47zb.jpg


Just to know
 
Yes! ZEZENIUM!!!
But now with task training and izi game i stoped play...

There is no way to make anything like this with no client edit?
Mate, understand. If there isn't the stuff that you want coded in the client code HOW ARE YOU GOING TO CREATE SOMETHING IN THE CLIENT. You can only use whatever cipsoft coded and they didn't code anything to create windows (not until modalwindows but they are still limited.)
 
Back
Top