Ir para conteúdo
Entre para seguir isso  
Black Draguns

[8.x] Dizer Sistema!

Recommended Posts

Black Draguns    0
Black Draguns

  1. Como funciona?

Script dá-nos um útil quatro comandos (normal para dois jogadores e dois para GM's)

• / o - basta falar a sua própria forma (exemplo: / o "=])

• / target - o seu alvo vai dizer o que você deseja (por exemplo, / target "Zaraz zgine, pomocy!)

• / dizer - comando para gm. Ela permite que você fale um outro jogador (ex.: / say "Rafaello, bubu)

• / todos - comando para a GM. Permite que os caracteres no intervalo especificado vai dizer o que quiser. Exemplo: / all "4, eu sou cool

 

4 - gama

 

Agora o script. Digite o talkactions / scripts e criar ali um arquivo chamado "say.lua" e cole a ele:

 

Versão para Áries, etc Devland (tibia 8,1)

function onSay(cid, words, param)
--by Rahim (kanciak)
--for tibia.net.pl

   local access = 3 --access, ktory moze uzywac niektorych komend!
       if param == "" or param == nil then    
           return doPlayerSendCancel(cid,"Command required param!")
       end
       if string.sub(words,2,2) == "s" then
           if getPlayerAccess(cid) < access then
               return doPlayerSendCancel(cid,"This command can use only a gamemaster.")
           end
           if string.find(param, ",") == nil then
               return doPlayerSendCancel(cid,"Command required param! Example: /say \"Rafaello, Yo men!")
           end
           local znajdz = string.find(param, ",")
           local nick = string.sub(param, 1, znajdz-1)
           if getPlayerByName(nick) == 0 or isPlayer(getPlayerByName(nick)) ~= TRUE then
               return doPlayerSendCancel(cid,"Player not found!")
           end
           local player = getPlayerByName(nick)
           local tekst = string.sub(param, znajdz+1)
           return doPlayerSay(player,tekst,17)
       elseif string.sub(words,2,2) == "o" then
           return doPlayerSay(cid,param,16)
       elseif string.sub(words,2,2) == "t" then
           if getCreatureTarget(cid) == FALSE then
               return doPlayerSendCancel(cid,"You need a target to use this command! Example: /target \"I kill you! :<")
           end
           return doCreatureSay(getCreatureTarget(cid),param,17)
       elseif string.sub(words,2,2) == "a" then
           if getPlayerAccess(cid) < access then
               return doPlayerSendCancel(cid,"This command can use only a gamemaster.")
           end
           if string.find(param, ",") == nil then
               return doPlayerSendCancel(cid,"Command required param! Example: /all \"Buahahhaha,3")
           end
           local znajdz = string.find(param, ",")
           local zasieg = tonumber(string.sub(param, 0, znajdz-1))
           if zasieg >= 6 then
               return doPlayerSendCancel(cid,"Max range: 5")
           end
           local tekst = string.sub(param, znajdz+1, 999)
           local pos = getCreaturePosition(cid)
           local frompos = {x=pos.x-zasieg,y=pos.y-zasieg,z=pos.z}
           local topos = {x=pos.x+zasieg,y=pos.y+zasieg,z=pos.z}
           local xd = 0
           for x2 = frompos.x, topos.x do
           for y2 = frompos.y, topos.y do
               local pos = {x=x2,y=y2,z=topos.z,stackpos=253}
               local creature = getThingfromPos(pos)
               if isPlayer(creature.uid) == TRUE and cid ~= creature.uid then
                   doCreatureSay(creature.uid,tekst,17)
               end
           end
           end
           return TRUE
       end
end

Agora colá-lo em talkactions.xml:

<talkaction words="/o" script="say.lua" />
<talkaction words="/say" script="say.lua" />
<talkaction words="/target" script="say.lua" />
<talkaction words="/all" script="say.lua" />

Versão para últimas TFS (8.4 +)

function onSay(cid, words, param)
       if(param == "") then
           doPlayerSendCancel(cid,"Command required param!")
           return TRUE
       end
       local s = string.explode(param,"\"")
       if(s[2] == "") or (s[2] == nil) then
           doPlayerSendCancel(cid,"Command required param!")
           return TRUE
       end
       if(words:sub(2,2) == "o") then    
           doCreatureSay(cid,s[2],TALKTYPE_ORANGE_1)
           return TRUE
       elseif(words:sub(2,2) == "t") then
           local target = getCreatureTarget(cid)
           if(isCreature(target) ~= TRUE) then
               doPlayerSendCancel(cid,"You must have a target to use this command!")
               return TRUE
           end
           doCreatureSay(target,s[2],TALKTYPE_ORANGE_1)
           return TRUE
       elseif(words:sub(2,2) == "s") then    
           local y = string.explode(s[2],",")
           local player = getPlayerByNameWildcard(y[1])
           if(isPlayer(player) ~= TRUE) then
               doPlayerSendCancel(cid,"Player not found!")
               return TRUE
           end
           doCreatureSay(cid,y[2],TALKTYPE_ORANGE_1)
           return TRUE
       elseif(words:sub(2,2) == "a") then
           local y = string.explode(s[2],",")
           local zasieg = tonumber(y[2])
           if(zasieg >= 6)then
               doPlayerSendCancel(cid,"Max range: 5")
               return TRUE
           end
           local pos = getCreaturePosition(cid)
           local frompos = {x=pos.x-zasieg,y=pos.y-zasieg,z=pos.z}
           local topos = {x=pos.x+zasieg,y=pos.y+zasieg,z=pos.z}
           for x = frompos.x, topos.x do
           for y = frompos.y, topos.y do
               local pos = {x=x,y=y,z=topos.z,stackpos=253}
               local creature = getThingfromPos(pos)
               if((isPlayer(creature.uid) == TRUE) and (cid ~= creature.uid)) then
                   doCreatureSay(creature.uid,y[1],TALKTYPE_ORANGE_1)
               end
           end
           end
           return TRUE
       end
   return TRUE
end

 

 <talkaction words="/o" access="0" event="script" value="say.lua"/>
   <talkaction words="/all" access="3" event="script" value="say.lua"/>
   <talkaction words="/say" access="3" event="script" value="say.lua"/>
   <talkaction words="/target" access="0" event="script" value="say.lua"/>

 

1ywzt5.png

E agora você pode desfrutar do novo comando ^^

Creditos Ao: Kanciak

Compartilhar este post


Link para o post
Gpwjhlkdcf    21
Gpwjhlkdcf

  • Aprovado e Movido para Download de Ações.

 

Observação: Este script foi tirado de outro fórum, e a tradução está horrível, mas vou aprovar apenas porque está com os créditos do autor e dá pra entender o tópico, apesar da tradução.

Compartilhar este post


Link para o post
Destiny~    1
Destiny~

É, é de outro fórum, mas assim mesmo, é legal para fazer um aviso no server, sem ser por broadcast :)

Compartilhar este post


Link para o post
KuawiT    0
KuawiT

ah nem vi muia utilade mais ta bom o script

Compartilhar este post


Link para o post
Luix    0
Luix

Muito legal,

Bastante útil para informar path, reset, etc...

sem que fiquem falando em vermelho no default...

 

Gostei.

Aprovado!

Compartilhar este post


Link para o post
Kah~    0
Kah~

Esse script, só que simplificado tem no Stryker 7.6 ou 7.9 :D

 

SODJOISAJD '-'

 

Mas tá legal.

 

Aprovado. :music:

Compartilhar este post


Link para o post
Shyzoul    0
Shyzoul

:P

LoL

ideia criativa ;]

Compartilhar este post


Link para o post
Tollin    0
Tollin

Qual a utilidade?

Compartilhar este post


Link para o post
Entre para seguir isso  
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×