Postado Novembro 1, 2015 9 anos Em 04/06/2014 13:51:12, xWhiteWolf disse: <talkaction log="yes" words="/anuncio" event="script" value="broadcast.lua"/> local config = { storage = 19400, -- storage em que será salvo o tempo cor = "green", -- de acordo com o constant.lua da lib tempo = 2, -- em minutos price = 200000, -- quantidade de dinheiro que irá custar level = 100 -- level pra poder utilizar o broadcast } function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end if getPlayerLevel(cid) >= config.level then if getPlayerStorageValue(cid, config.storage) - os.time() <= 0 then if doPlayerRemoveMoney(cid, config.price) then setPlayerStorageValue(cid, config.storage, os.time() + (config.tempo*60)) doBroadcastMessage(""..getCreatureName(cid).." [ANUNCIO]: "..param.."", config.cor) doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You have successfully sent a broadcast, now you'll have to wait " ..config.tempo.. " minute(s) until you broadcast again.") else doPlayerSendCancel(cid, "You don't have " ..config.price.. " gp's for broadcasting.") return true end else doPlayerSendCancel(cid, "You have to wait " ..(getPlayerStorageValue(cid, config.storage) - os.time()).. " seconds until you can broadcast again.") return true end else doPlayerSendCancel(cid, "You have to be level " ..config.level.. " or more in order to use broadcast.") end end ps: editei com doRemoveMoney como que da reputação ? https://www.facebook.com/pokemonalternative/?ref=ts&fref=ts
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.