Ir para conteúdo

Featured Replies

Postado

Existe uma maneira de limitar para que por exemplo o GM FULANO DE TAL, não possa dar /goto GM FULANINHO

Comando /goto
 

function onSay(cid, words, param)
	local player = Player(cid)
	if getPlayerGroupId(cid) > 3 then

	local target = Creature(param)
	if target == nil then
		player:sendCancelMessage("Creature not found.")
		return false
	end

	player:teleportTo(target:getPosition())
	return false
end
end

 

Comando /c

function onSay(player, words, param)
	if not player:getGroup():getAccess() then
		return true
	end

	local creature = Creature(param)
	if not creature then
		player:sendCancelMessage("A creature with that name could not be found.")
		return false
	end

	local oldPosition = creature:getPosition()
	local newPosition = creature:getClosestFreePosition(player:getPosition(), false)
	if newPosition.x == 0 then
		player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".")
		return false
	elseif creature:teleportTo(newPosition) then
		if not creature:isInGhostMode() then
			oldPosition:sendMagicEffect(CONST_ME_POFF)
			newPosition:sendMagicEffect(CONST_ME_TELEPORT)
		end
	end
	return false
end

 

Resolvido por Cjaker

Ir para solução
  • Respostas 12
  • Visualizações 585
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • Makhai Drakon
    Makhai Drakon

    @SouDeus Mano Se for dar umas respostas dessa e melhor ficar queto não acha ? @Andreeyyy Testei não mano adicionei a função de vem quais são as restrições   Bom aproveito! /goto function

  • Configs = { RestrictNames = {"gm fulano de tal"} -- lista de nomes proibidos para se usar /goto } local function tableContains(table, value) for index = 1, #table do if table[index]:lower() == va

  • Makhai Drakon
    Makhai Drakon

    @Andreeyyy  function onSay(cid, words, param) local restricao = {"Demon","Fire Devil"} for r = 1, #restricao do if param == restricao[r]then player:sendCancelMessage("Você não pode usar isto diga

Postado

@SouDeus Mano Se for dar umas respostas dessa e melhor ficar queto não acha ?

@Andreeyyy Testei não mano adicionei a função de vem quais são as restrições :)  Bom aproveito!

/goto

function onSay(cid, words, param)
local restricao = {"Demon","Fire Devil"}
if param == "restricao"
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, restricao[r]")
return true
end

for r = 1, #restricao do
if param == restricao[r]then

	local player = Player(cid)
	if getPlayerGroupId(cid) > 3 then

	local target = Creature(param)
	if target == nil then
		player:sendCancelMessage("Creature not found.")
		return false
	end

	player:teleportTo(target:getPosition())
	return false
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar isto diga /goto restricao")
end
end

/c

function onSay(player, words, param)

local restricao = {"Demon","Fire Devil"}
if param == "restricao"
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, restricao[r]")
return true
end

for r = 1, #restricao do
if param == restricao[r]then

	if not player:getGroup():getAccess() then
		return true
	end

	local creature = Creature(param)
	if not creature then
		player:sendCancelMessage("A creature with that name could not be found.")
		return false
	end

	local oldPosition = creature:getPosition()
	local newPosition = creature:getClosestFreePosition(player:getPosition(), false)
	if newPosition.x == 0 then
		player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".")
		return false
	elseif creature:teleportTo(newPosition) then
		if not creature:isInGhostMode() then
			oldPosition:sendMagicEffect(CONST_ME_POFF)
			newPosition:sendMagicEffect(CONST_ME_TELEPORT)
		end
	end
	return false
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar isto diga /c restricao")
end
end

 

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

Ajudei? REP+

 

Meus Servers:

PokeUnwind Em Breve

Rust Tibia Fechado

 

Tópicos: 

[Tutorial] Adicionando Pokemons com icon system

[Solução] ElfBot não abre corpos

 

Projetos:

DigiTibia Fechado

Rust Tibia Fechado(temporariamente!)

Postado
  • Autor
6 horas atrás, Ckfox disse:

@SouDeus Mano Se for dar umas respostas dessa e melhor ficar queto não acha ?

@Andreeyyy Testei não mano adicionei a função de vem quais são as restrições :)  Bom aproveito!

/goto


function onSay(cid, words, param)
local restricao = {"Demon","Fire Devil"}
if param == "restricao"
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, restricao[r]")
return true
end

for r = 1, #restricao do
if param == restricao[r]then

	local player = Player(cid)
	if getPlayerGroupId(cid) > 3 then

	local target = Creature(param)
	if target == nil then
		player:sendCancelMessage("Creature not found.")
		return false
	end

	player:teleportTo(target:getPosition())
	return false
end
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar isto diga /goto restricao")
end
end

/c


function onSay(player, words, param)

local restricao = {"Demon","Fire Devil"}
if param == "restricao"
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, restricao[r]")
return true
end

for r = 1, #restricao do
if param == restricao[r]then

	if not player:getGroup():getAccess() then
		return true
	end

	local creature = Creature(param)
	if not creature then
		player:sendCancelMessage("A creature with that name could not be found.")
		return false
	end

	local oldPosition = creature:getPosition()
	local newPosition = creature:getClosestFreePosition(player:getPosition(), false)
	if newPosition.x == 0 then
		player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".")
		return false
	elseif creature:teleportTo(newPosition) then
		if not creature:isInGhostMode() then
			oldPosition:sendMagicEffect(CONST_ME_POFF)
			newPosition:sendMagicEffect(CONST_ME_TELEPORT)
		end
	end
	return false
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode usar isto diga /c restricao")
end
end

 

 

 

[Warning - Event::checkScript] Can not load script: scripts/teleport_to_creature.lua
data/talkactions/scripts/teleport_to_creature.lua:19: 'then' expected near 'doPlayerSendTextMessage'

TFS 1.2 - OTX

Postado

@Andreeyyy 

function onSay(cid, words, param)
local restricao = {"Demon","Fire Devil"}
if param == "restricao"
player:sendCancelMessage(restricao[r])
return true
end

for r = 1, #restricao do
if param == restricao[r]then

	local player = Player(cid)
	if getPlayerGroupId(cid) > 3 then

	local target = Creature(param)
	if target == nil then
		player:sendCancelMessage("Creature not found.")
		return false
	end

	player:teleportTo(target:getPosition())
	return false
end
end
player:sendCancelMessage("Você não pode usar isto diga /goto restricao")
end
end
----------------------------------------------------------------------------------------

function onSay(player, words, param)

local restricao = {"Demon","Fire Devil"}
if param == "restricao"
player:sendCancelMessage(restricao[r])
return true
end

for r = 1, #restricao do
if param == restricao[r]then

	if not player:getGroup():getAccess() then
		return true
	end

	local creature = Creature(param)
	if not creature then
		player:sendCancelMessage("A creature with that name could not be found.")
		return false
	end

	local oldPosition = creature:getPosition()
	local newPosition = creature:getClosestFreePosition(player:getPosition(), false)
	if newPosition.x == 0 then
		player:sendCancelMessage("You can not teleport " .. creature:getName() .. ".")
		return false
	elseif creature:teleportTo(newPosition) then
		if not creature:isInGhostMode() then
			oldPosition:sendMagicEffect(CONST_ME_POFF)
			newPosition:sendMagicEffect(CONST_ME_TELEPORT)
		end
	end
	return false
end
player:sendCancelMessage("Você não pode usar isto diga /c restricao")
end
end

 

Ajudei? REP+

 

Meus Servers:

PokeUnwind Em Breve

Rust Tibia Fechado

 

Tópicos: 

[Tutorial] Adicionando Pokemons com icon system

[Solução] ElfBot não abre corpos

 

Projetos:

DigiTibia Fechado

Rust Tibia Fechado(temporariamente!)

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.6k

Informação Importante

Confirmação de Termo