DI

[Duvida] Script Service

Por diegool, 14 de out. de 2010 em Archived

script
3
1.1k
diegoolD
14 de outubro de 2010 às 00:55

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 !

1 ano depois...
ADMkoringaA
12 de janeiro de 2012 às 10:45

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

SkyDangerousS
12 de janeiro de 2012 às 13:01

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.