Talcktion De Comunicação

lucianacastro10
em Lixeira Pública

lucianacastro10

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/01/09Posts: 6Char no Tibia: sasasas

Tipo do script: Talcktion

Protocolo (8.6):

Servidor utilizado: Real Server 1.7

Nível de experiência: Medio / Basico

Adicionais/Informações: Preciso de um script qe o player diga !post msg, e apareçerá em vermelho pra todos..

EXEMPLO: !post Compro Royal Helmet 30K; ae aparece Player say: Compro Royal Helmet 30K; e nisso ele gasta 2k por anuncio,

 

obrigado se puderem ajudar e se nao puderem obrigado por lerem xd

bloder

Lucas
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 22/04/10Posts: 30

Crie um arquivo chamado post.lua na pasta talkactions e cole isto dentro:

local config = {
   priceForEachMessage = 2000, -- preço de cada mensagem
}


function onSay(cid, words, param, channel)


   if(param == "") then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ERROR] Command requires param.")
       return TRUE
   end

   local t = string.explode(param, ",")
   if(not t[2]) then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ERROR] !post NAME_item, Price In 'k'")
       return TRUE
   end    

   if(isNumber(t[2]) == FALSE) then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ERROR] Price can be only numbers.")
       return TRUE
   end        


   if(doPlayerRemoveMoney(cid, config.priceForEachMessage) == TRUE) then
       doBroadcastMessage(" " .. getPlayerName(cid) .. "'s esta comprando  " .. t[1] .. "! Preço: " .. t[2] .. "k.", MESSAGE_STATUS_WARNING)
   else
       doPlayerSendCancel(cid, "[ERROR] You need " .. config.priceForEachMessage .. " gold coins to send a message.")
end
   return TRUE 
end 

 

Dps coloque issu em talkactions.xml

<talkaction words="!post" event="script" value="post.lua"/>

 

para usar o comando diga !post nome do item,preço em k ex: !post royal helmet,30

Flw!

23768_7.png

Ajudei ? Então clika ali no add.png E da um Rep+ pra mim!

Subwat

GAUCHO MACHO
avatar
Infante
Infante

INFOS

Grupo: InfanteRegistrado: 27/07/09Posts: 1516Char no Tibia: Gean Riot

local config = {
priceForEachMessage = 20000, -- preço de cada mensagem
}
function onSay(cid, words, param, channel)
if(param == "") then
doPlayerPopupFYI(cid,"voce precisa digitar uma mensagem.!")
return TRUE
end

if(doPlayerRemoveMoney(cid, config.priceForEachMessage) == TRUE) then
doBroadcastMessage("" .. getPlayerName(cid) .. " Diz: " .. param .. "", MESSAGE_STATUS_CONSOLE_RED)
else
doPlayerPopupFYI(cid, "Você precisa de " .. config.priceForEachMessage .. " gps para enviar a messagem.")
end

return TRUE
end

 

<talkaction words="!post" script="post.lua"/>

Entrem Server online desde o dia 22/02/2013 Monster 24HORAS dedicado!

IP: monster24h.com

PROTOCOL:8.60

PORT:7171

 

RATES:

Exp: 9999x~10x

Skills:800x

Magic:200x

Loot:2x

Pvp-e Advanced: 1.1x Ao matar players de level semelhante.

 

Accounts Pelo Account Manager!