Ir para conteúdo

Featured Replies

  • Respostas 7
  • Visualizações 686
  • Created
  • Última resposta

Top Posters In This Topic

Postado
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

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

  • 1 year later...
Postado
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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo