MatheusGermano Posted July 18, 2019 Share Posted July 18, 2019 Queria que apenas os jogadores Com tal ACL, recebessem esse 'Salário'. function Payday() for i, player in ipairs(getElementsByType("player")) do local salario = math.random(8000,10000) givePlayerMoney(player, salario) outputChatBox("#00FFFF----------------------------------------", player, 255, 255, 255, true) outputChatBox("#00FF00Pagamento da Força Tatica", player, 255, 255, 255, true) outputChatBox("#00FF00Seu salário: "..salario,player, 255, 255, 255, true) outputChatBox("#00FFFF----------------------------------------", player, 255, 255, 255, true) end end setTimer(Payday,1,0) Link to comment
DNL291 Posted July 19, 2019 Share Posted July 19, 2019 function Payday() for i, player in ipairs(getElementsByType("player")) do local acc = getPlayerAccount(player) if not isGuestAccount(acc) and isPlayerInACL(player, getAccountName(acc)) then local salario = math.random(8000,10000) givePlayerMoney(player, salario) outputChatBox("#00FFFF----------------------------------------", player, 255, 255, 255, true) outputChatBox("#00FF00Pagamento da Força Tatica", player, 255, 255, 255, true) outputChatBox("#00FF00Seu salário: "..salario,player, 255, 255, 255, true) outputChatBox("#00FFFF----------------------------------------", player, 255, 255, 255, true) end end end setTimer(Payday,1,0) function isPlayerInACL(player, acl) local accountName = getAccountName( getPlayerAccount(player) ) if accountName ~= "guest" and type( aclGetGroup(acl) ) == "userdata" then return isObjectInACLGroup( "user."..accountName, aclGetGroup(acl) ) end return false end Obs: o timer vai executar num intervalo muito baixo (a cada 1 milisegundo). @MatheusGermano Link to comment
Other Languages Moderators Lord Henry Posted July 19, 2019 Other Languages Moderators Share Posted July 19, 2019 Vai dar erro. O tempo mínimo possível é de 50 milissegundos. De acordo com a wiki do SetTimer. The minimum accepted interval is 50ms. Link to comment
DNL291 Posted July 19, 2019 Share Posted July 19, 2019 8 hours ago, Lord Henry said: Vai dar erro. O tempo mínimo possível é de 50 milissegundos. De acordo com a wiki do SetTimer. The minimum accepted interval is 50ms. Antes da versão 1.5.6 r16715 sim, mas a partir dela o intervalo mínimo foi atualizado para 1ms EDIT: na verdade é 0. 1 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