Ir para conteúdo

Featured Replies

Postado

SALVE GALERA DO TIBIA KING

 

TO MONTANDO UM OT AKI E NÃO SOU MUITO BOM COM SCRIPT'S ENTÃO PRECISAVA QUE ALGUÉM ME DESSE UMA FORÇA AE!

 

-> PRECISO DE UM SCRIPT PARA SERVER 8.60 QUE TIPO CERTOS CARGOS DA STAFF N CONSIGA CRIAR CERTO ITEM, TIPO UM CM VAI LÁ E DIGITA /i 2160 (CRYSTAL COIN) E APAREÇA NO DEFAULT VOCÊ NÃO PODE CRIAR ESTE ITEM, MAIS QUE ELE CONSIGA CRIAR OUTROS ITEMS TIPO UMA BP E TALS.

SÓ BLOQUEAR CERTOS ITEMS NO /i, NÃO TODOS.

 

SE ALGUÉM PODER ME AJUDAR AI REP+ 

VLW :)

 

 

 

Postado

@DouGlaS Mapper

 

Substitua o script data/talkactions/createitem.lua do seu server por este: 

(aconselho a fazer um backup do antigo script caso queira voltar a usar o script antigo)


-- Configurations --

local CONSOLE_COLOR = MESSAGE_STATUS_CONSOLE_BLUE -- Cor da mensagem que irá aparecer no Default
local MESSAGE = "Voce nao tem permissao para criar este item." -- A mensagem que irá parecer caso ele não possa criar o item 

local stages = {

--	[GroupId] = {Os Id's dos itens que serão bloqueados seguidos por virgula EX: 2160,2554,5564}
	[5] = {2160, 2454, 5777},
	[6] = {3977, 3976, 5777},

}
-------------------

function onSay(cid, words, param, channel)

	if(param == '') then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return true
	end

	local t = string.explode(param, ",")
	local ret = RETURNVALUE_NOERROR
	local pos = getCreaturePosition(cid)

	local id = tonumber(t[1])

	for k,v in pairs(stages) do
		if (getPlayerGroupId(cid) == k) then
			for i=1, #v do
				if (id == v[i]) then
					doPlayerSendTextMessage(cid, CONSOLE_COLOR, MESSAGE)
					return true
				end
			end
		end
	end

	local amount = 100
	if(t[2]) then
		amount = t[2]
	end

	local item = doCreateItemEx(id, amount)
	if(t[3] and getBooleanFromString(t[3])) then
		if(t[4] and getBooleanFromString(t[4])) then
			pos = getCreatureLookPosition(cid)
		end

		ret = doTileAddItemEx(pos, item)
	else
		ret = doPlayerAddItemEx(cid, item, true)
	end

	if(ret ~= RETURNVALUE_NOERROR) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1])
		return true
	end

	doDecayItem(item)
	if(not isPlayerGhost(cid)) then
		doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
	end
	return true
end

 

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo