knightxd
Member
Code:
local items = {
item = { id = 2419, subType = 0, sell = 150, name = "scimitar" },
item2 = { id = 2393, subType = 0, sell = 17000, name = "giant sword" },
item3 = { id = 2534, subType = 1, buy = 15000, name = "vampire shield" }
}
function greetCallback(cid)
if getPlayerStorageValue(cid,36001) >= 1 then
selfSay('Die Human!', cid)
doTargetCombatCondition(0, cid, fire1, CONST_ME_NONE)
return false
else
return true
end
end
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setMessage(MESSAGE_GREET, 'What do you want from me, |PLAYERNAME|?')
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, 'trade') then
if getPlayerStorageValue(cid,36005) <= 1 then
openShopWindow(cid, items, onBuy, onSell)
selfSay("Prepair yourself to the war against the marids!", cid)
else
selfSay("we need to trust you instead of dealing shopping.", cid)
end
well i'm using this code, its supposed to be a djinn sample, when i've the djinn quest completed i can trade with him, else, i he won't show me the quest window..
the code is almost working, when i say trade with the quest completed, the npc shows the quest window, show the items in list but theres a problem, i can't trade them, i can select how many i want to buy/sell, but when i click OK nothing happens..
is there any other ways to make this scripts??
im using TFS 0.3.4 P2
thaks a lot!
Last edited: