Ryuzaki Posted March 1, 2015 Share Posted March 1, 2015 Olá a muito tempo tenha essa duvida, de como colocar um time no uso de /ss. por exemplo [ Tente de novo daqui 20 segundos ] . Pois algum tempo vejo que existe alguns players que ainda usam esse comando junto com ( /bind 1 ss skin ), para ter vantagem sobre os outros players. queria uma ajuda de como criar esse sequinte script... obrigado pela atenção Link to comment
n3wage Posted March 1, 2015 Share Posted March 1, 2015 Tente isso: -- fr_client.lua - Linha 60 (pode ser diferente ai) ssTime = false function setSkinCommand(cmd, skin) skin = skin and tonumber(skin) if skin then if not ssTime or ssTime < getTickCount() then ssTime = getTickCount() + ( 20 *1000 ) -- 20 = 20 segundos server.setMySkin(skin) fadeCamera(true) closeWindow(wndSpawnMap) closeWindow(wndSetPos) else outputChatBox ( "Aguarde "..math.floor ( ( ssTime - getTickCount() ) /1000 ).. " Segundos antes de trocar a skin novamente !", 255, 0, 0, true ) end end end addCommandHandler('setskin', setSkinCommand) addCommandHandler('ss', setSkinCommand) Link to comment
Banex Posted March 1, 2015 Share Posted March 1, 2015 allow = true function setSkinCommand(cmd, skin) if not allow then return outputChatBox("Aguarde 30 segundos para mudar de skin novamente!", 255,0,0) end skin = skin and tonumber(skin) if skin then server.setMySkin(skin) fadeCamera(true) closeWindow(wndSpawnMap) closeWindow(wndSetPos) allow = false setTimer( function() allow = true end, 30000,1) end end Link to comment
manawydan Posted March 1, 2015 Share Posted March 1, 2015 um timer pode ser a solução Link to comment
n3wage Posted March 1, 2015 Share Posted March 1, 2015 um timer pode ser a solução Acho que é desnecessário o uso de um timer, prefiro minha solução Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now