[Duvida] Script Service

diegool
em Lixeira Pública

diegool

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 02/08/10Posts: 51Char no Tibia: thor

Eai Galera blz ? eu gostaria de saber se dava pra colocar um tempo ou muted se a pessoas usar um certo comando varias vezes..

como no meu ot que eu qero eh o !service , muitas pessoas fica dando spaw com ele , e isso eh foda...

rs

 

Script:

local config = {
   priceForEachMessage = 10000, -- preço de cada mensagem
   levelToUseQuestService = 50 -- level para poder usar este comando
}

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] !service servicename, preço(gold coins)")
       return TRUE
   end    

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

   if(getPlayerLevel(cid) <= config.levelToUseQuestService) then
       doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "[ERROR] Only Players Level " .. config.levelToUseQuestService .. " or more may use this command.")    
       return TRUE 
   end

   if(doPlayerRemoveMoney(cid, config.priceForEachMessage) == TRUE) then
       doBroadcastMessage("QuestService: " .. getPlayerName(cid) .. "'s now starting a " .. 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  

 

 

Me Ajudem Por favor...oque der pra eles nao usarem tanta vezes sem para ajuda...

rs

 

Abraços !

ADMkoringa

Administrador
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 11/01/12Posts: 0Char no Tibia: Nao-Pode :D

Nao,Mud kra isso e fela,sem mute pioro,deixa o jeito q tah,sem muted O kra vai solta poder sem parar igual,adm

Mas o comando !service vou procurar

AJUDEI +REP

SkyDangerous

Deus Kalec
avatar
Lorde
Lorde

INFOS

Grupo: LordeRegistrado: 17/01/09Posts: 2098Char no Tibia: Adra Sata

dá sim cara.

 

faz assim.

 

seta uma storage globalmente, e os-time , fazendo quem usar os de mais tenque esperar dar o tempo para usar novamente.

Me segui lá (:

 

b906.png

http://ageofwar.servegame.com/

IP: ageofwar.servegame.com

TIBIA: 10.78

GLOBAL PERFECT CUSTOM