RatoFino Postado Março 5, 2019 Denunciar Compartilhar Postado Março 5, 2019 Eu qria um SK de delay em cmd. QUALQUER comando que for digitar, tem que esperar 2s pra repetir. Obs: quero bypass pra staff. Link para o comentário Compartilhar em outros sites More sharing options...
SrBlecaute Postado Março 6, 2019 Denunciar Compartilhar Postado Março 6, 2019 (editado) on enable: load yaml "plugins/ComandoDelay/data.yml" as "delay_data" load yaml "plugins/ComandoDelay/config.yml" as "delay_config" if yaml "delay_config" is empty: set yaml value "Delay.Tempo" from "delay_config" to 300 set yaml value "Delay.Mensagem" from "delay_config" to "Aguarde @tempo para usar esse comando novamente" set the comments of yaml node "Delay" from "delay_config" to "por favor no delay dos comandos insira o tempo em segundos." save yaml "delay_config" send "" to console send "&fSrDelay - &aAtivado" to console send "&fAutor: &eSrBlecaute" to console send "" to console on disable: unload yaml "delay_config" unload yaml "delay_data" on command: if player is not console: if player does not have permission "cmd.bypass": if checkDelay(player) is true: cancel event stop else: set yaml value "Cooldown.%player%" from "delay_data" to now save yaml "delay_data" function checkDelay(p: player) :: boolean: if yaml path "Cooldown.%{_p}%" from "delay_data" exists: set {_timex} to yaml value "Cooldown.%{_p}%" from "delay_data" set {_timex} to "%{_timex}%" parsed as time set {_check} to difference between {_timex} and now set {_delay} to yaml value "Delay.Tempo" from "delay_config" set {_delay} to "%{_delay}% seconds" parsed as timespan if {_check} is less than {_delay}: set {_remaining} to "%difference between {_check} and {_delay}%" set {_formated_time} to ReplaceTime({_remaining}) set {_erro1} to yaml value "Delay.Mensagem" from "delay_config" replace all "@tempo" in {_erro1} with "%{_formated_time}%" send colored "%{_erro1}%" to {_p} return true else: return false else: return false function ReplaceTime(var: text) :: text: replace all "and" in {_var} with "e" replace all "seconds" in {_var} with "segundos" replace all "second" in {_var} with "segundo" replace all "minute" in {_var} with "minuto" replace all "minutes" in {_var} with "minutos" replace all "hour" in {_var} with "hora" replace all "hours" in {_var} with "horas" replace all "day" in {_var} with "dia" replace all "days" in {_var} with "dias" return {_var} bom fiz isso agora usei uma parte do meu código antigo necessita de skript-yaml e de SkQuery se der erro add discord SrBlecaute#3731 que eu tento ajudar Editado Março 6, 2019 por SrBlecaute Link para o comentário Compartilhar em outros sites More sharing options...
RatoFino Postado Março 6, 2019 Autor Denunciar Compartilhar Postado Março 6, 2019 1 hora atrás, SrBlecaute disse: on enable: load yaml "plugins/ComandoDelay/data.yml" as "delay_data" load yaml "plugins/ComandoDelay/config.yml" as "delay_config" if yaml "delay_config" is empty: set yaml value "Delay.Tempo" from "delay_config" to 300 set yaml value "Delay.Mensagem" from "delay_config" to "Aguarde @tempo para usar esse comando novamente" set the comments of yaml node "Delay" from "delay_config" to "por favor no delay dos comandos insira o tempo em segundos." save yaml "delay_config" send "" to console send "&fSrDelay - &aAtivado" to console send "&fAutor: &eSrBlecaute" to console send "" to console on disable: unload yaml "delay_config" unload yaml "delay_data" on command: if player is not console: if player does not have permission "cmd.bypass": if checkDelay(player) is true: cancel event stop else: set yaml value "Cooldown.%player%" from "delay_data" to now save yaml "delay_data" function checkDelay(p: player) :: boolean: if yaml path "Cooldown.%{_p}%" from "delay_data" exists: set {_timex} to yaml value "Cooldown.%{_p}%" from "delay_data" set {_timex} to "%{_timex}%" parsed as time set {_check} to difference between {_timex} and now set {_delay} to yaml value "Delay.Tempo" from "delay_config" set {_delay} to "%{_delay}% seconds" parsed as timespan if {_check} is less than {_delay}: set {_remaining} to "%difference between {_check} and {_delay}%" set {_formated_time} to ReplaceTime({_remaining}) set {_erro1} to yaml value "Delay.Mensagem" from "delay_config" replace all "@tempo" in {_erro1} with "%{_formated_time}%" send colored "%{_erro1}%" to {_p} return true else: return false else: return false function ReplaceTime(var: text) :: text: replace all "and" in {_var} with "e" replace all "seconds" in {_var} with "segundos" replace all "second" in {_var} with "segundo" replace all "minute" in {_var} with "minuto" replace all "minutes" in {_var} with "minutos" replace all "hour" in {_var} with "hora" replace all "hours" in {_var} with "horas" replace all "day" in {_var} with "dia" replace all "days" in {_var} with "dias" return {_var} bom fiz isso agora usei uma parte do meu código antigo necessita de skript-yaml e de SkQuery se der erro add discord SrBlecaute#3731 que eu tento ajudar Quero um mais simples... Link para o comentário Compartilhar em outros sites More sharing options...
SrBlecaute Postado Março 6, 2019 Denunciar Compartilhar Postado Março 6, 2019 (editado) isso é simples '-' tu vai la na pasta que ele gerar e simplesmente vai colocar o delay que você deseja e o código faz o resto Editado Março 6, 2019 por SrBlecaute Link para o comentário Compartilhar em outros sites More sharing options...
PandaxM Postado Março 7, 2019 Denunciar Compartilhar Postado Março 7, 2019 O cara que algo mais simples que isso? Link para o comentário Compartilhar em outros sites More sharing options...
SrBlecaute Postado Março 9, 2019 Denunciar Compartilhar Postado Março 9, 2019 @Avast01 resolvido ? Link para o comentário Compartilhar em outros sites More sharing options...
SrBlecaute Postado Março 16, 2019 Denunciar Compartilhar Postado Março 16, 2019 Seu pedido foi marcado como entregue por nossa equipe. Caso ele não tenha sido entregue como gostaria, crie outro tópico. OBS: Essa mensagem é automática Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados