Lopaskurwa
Active Member
- Joined
- Oct 6, 2017
- Messages
- 873
- Solutions
- 2
- Reaction score
- 49
Is it possible to add a storage check for a trader? Lets say if you he doesnt have storage 6541 npc would say "You have to finish blablabla" so trade wont open and if he have that storage it would allow to type trade.
And whats the max amount money you can ask from player is it 999gold or 1000gold?
And whats the max amount money you can ask from player is it 999gold or 1000gold?
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
local shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
shopModule:addBuyableItem({'test1'}, 2672, 400, 1, 'test1')
shopModule:addBuyableItem({'test2'}, 2691, 300, 1, 'test2')
shopModule:addBuyableItem({'test3'}, 2675, 300, 1, 'test3')
shopModule:addBuyableItem({'test4'}, 2677, 200, 1, 'test4')
shopModule:addBuyableItem({'test5'}, 2678, 200, 1, 'test5')
shopModule:addBuyableItem({'test6'}, 2666, 300, 1, 'test6')
function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())