Postado Maio 21, 2016 9 anos local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end function onThink() npcHandler:eek:nThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local t = { [2195] = 1, [2493] = 25, [2361] = 30, [8851] = 20, [8925] = 30, [2640] = 50, [2494] = 100, [9932] = 50, [2472] = 70, [8931] = 100 } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and getPlayerPremiumDays(cid) < t[item] then selfSay("You need "..t[item].." premium days to buy this item.", cid) else doPlayerRemovePremiumDays(cid, t[item]) doPlayerAddItem(cid, item) selfSay("Here your item!", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) [2640] = 10 [ITEM ID] = QUANTIDADE DE PREMIUM DAYS QUE PRECISA [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Janeiro 16, 2018 7 anos Em 20/05/2016 em 22:27, Vodkart disse: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end function onThink() npcHandler:eek:nThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local t = { [2195] = 1, [2493] = 25, [2361] = 30, [8851] = 20, [8925] = 30, [2640] = 50, [2494] = 100, [9932] = 50, [2472] = 70, [8931] = 100 } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and getPlayerPremiumDays(cid) < t[item] then selfSay("You need "..t[item].." premium days to buy this item.", cid) else doPlayerRemovePremiumDays(cid, t[item]) doPlayerAddItem(cid, item) selfSay("Here your item!", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) [2640] = 10 [ITEM ID] = QUANTIDADE DE PREMIUM DAYS QUE PRECISA Boa tarde @Vodkart gostaria de saber se tem como inverter (trocar "X" item por dias premium) se puder, ficaria agradecido!
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.