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

C++ How to make its possible

esnio12

Member
Joined
Oct 2, 2010
Messages
65
Reaction score
15
Hello guys, anyone can help-me with a question?

Hello everyone, I would like to know how to keep the trade window from all available, even if there is no money in backpack to buy certain item.

Like this
7xubYdx.png

For this, without money of course.
pPFZ3z6.png


I want to leave everything available, but when someone tries to buy and have no money the script will say that the player has no money, my idea is to put items to sell by points, that these points will be the storage value, but without money is not possible to click on the items.

Sorry for my bad english, if anyone do not understand, can reply and i will try to explain again
 
In modules>game_npctrade>npctrade.lua

try changing

Code:
function canTradeItem(item)
  if getCurrentTradeType() == BUY then
    return (ignoreCapacity:isChecked() or (not ignoreCapacity:isChecked() and playerFreeCapacity >= item.weight)) and playerMoney >= getItemPrice(item, true)
  else
    return getSellQuantity(item.ptr) > 0
  end
end

to

Code:
function canTradeItem(item)
  if getCurrentTradeType() == BUY then
    return (ignoreCapacity:isChecked() or (not ignoreCapacity:isChecked() and playerFreeCapacity >= item.weight))
  else
    return getSellQuantity(item.ptr) > 0
  end
end
 
Back
Top