Ir para conteúdo

Featured Replies

Postado

Falae pessoal, de boa?, então, eu to criando um server 7.92 e queria colocar aquele comando "/r" nele, que apaga qlqr coisa do SQM da sua frente, como faço pra colocar isso?

Postado
function onSay (cid, words, param)
	local amount = 1
	param = tonumber(param)
	if(param) then
		amount = tonumber(param)
	end

	local tmp = {}
	local toPos = getPlayerLookPos(cid)
	toPos.stackpos = 255
	tmp = getThingFromPos(toPos)
	if(tmp.uid ~= 0) then
		if(isCreature(tmp.uid) ) then
			doRemoveCreature(tmp.uid)
		else
			doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount))
		end

		doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)
		return false
	end

	toPos.stackpos = 254
	tmp = getThingFromPos(toPos)
	if(tmp.uid ~= 0) then
		doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount))
		doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)
		return false
	end

	toPos.stackpos = 253
	tmp = getThingFromPos(toPos)
	if(tmp.uid ~= 0) then
		doRemoveCreature(tmp.uid)
		doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)
		return false
	end

	for i = 5, 1, -1 do
		toPos.stackpos = i
		tmp = getThingFromPos(toPos)
		if(tmp.uid ~= 0) then
			if(isCreature(tmp.uid) ) then
				doRemoveCreature(tmp.uid)
			else
				doRemoveItem(tmp.uid, math.min(math.max(1, tmp.type), amount))
			end

			doSendMagicEffect(toPos, CONST_ME_MAGIC_RED)
			return false
		end
	end

	doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
	return false
end

Tag talkactions.xml:

<talkaction words="/r" access="3" filter="first word" script="removething.lua"/>

 

Editado por login12 (veja o histórico de edições)

 

@This life is filled with hurt

When happiness doesn't work

Trust me and take my hand

When the lights go out you will understand

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