Barradas Posted June 26, 2019 Posted June 26, 2019 Gente, eu comecei agora a fazer as script e gostaria de fazer um sistema de pagamento mas só para uma acl. Por exemplo só para as cl bope receber o pagamento. Alguém pode me ajudar? 1 minute ago, Barradas said: Gente, eu comecei agora a fazer as script e gostaria de fazer um sistema de pagamento mas só para uma acl. Por exemplo só para as cl bope receber o pagamento. Alguém pode me ajudar? Eu já fiz algumas tentativas e estou fazendo assim function payday (thePlayer) local Bope = get account Name (getPlayerAccount (thePlayer)) givePlayerMoney (thePlayer, 5000) the outputChatBox (" Você recebeu um salário no total de 5000 R$", 255,255,255,true) end setTimer (500,0)
DNL291 Posted June 26, 2019 Posted June 26, 2019 Veja esta função útil: https://wiki.multitheftauto.com/wiki/IsPlayerInACL
Barradas Posted June 26, 2019 Author Posted June 26, 2019 Eu já fiz algumas tentativas e estou fazendo assim function payday (thePlayer) local Bope = get account Name (getPlayerAccount (thePlayer)) givePlayerMoney (thePlayer, 5000) the outputChatBox (" Você recebeu um salário no total de 5000 R$", 255,255,255,true) Já tentei adicionar como esta nesse arquivo e não dá! Poderia escrever como devo fazer pfv?
DNL291 Posted June 26, 2019 Posted June 26, 2019 function payday (thePlayer) if isPlayerInACL(thePlayer, "nome_da_acl") then givePlayerMoney (thePlayer, 5000) outputChatBox (" Você recebeu um salário no total de 5000 R$", thePlayer, 255,255,255,true) end end 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
Barradas Posted June 26, 2019 Author Posted June 26, 2019 13 minutes ago, DNL291 said: function payday (thePlayer) if isPlayerInACL(thePlayer, "nome_da_acl") then givePlayerMoney (thePlayer, 5000) outputChatBox (" Você recebeu um salário no total de 5000 R$", thePlayer, 255,255,255,true) end end 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 Só preciso mudar onde diz nome acl certo? Já agora muito obrigado pela ajuda e desculpa pelo incómodo
DNL291 Posted June 26, 2019 Posted June 26, 2019 Sim, na função isPlayerInACL. Isso não garante que seu código vai funcionar ou está pronto, só mostrei o trecho da verificação na ACL.
Eficiencia Posted June 27, 2019 Posted June 27, 2019 E não se esqueça de setar um timer para o tempo de pagamento
Barradas Posted June 27, 2019 Author Posted June 27, 2019 7 hours ago, Eficiencia said: E não se esqueça de setar um timer para o tempo de pagamento Eu já setei e tentei de tudo mas não funciona, já mudei onde diz guest para user e não funciona. tem alguma sugestão para me ajudar?
Other Languages Moderators androksi Posted June 27, 2019 Other Languages Moderators Posted June 27, 2019 local _minutes = 10 -- // O salário será entregue a cada quantos minutos? function payday() for _, v in pairs(getElementsByType("player")) do if isPlayerInACL(v, "nome_da_acl") then givePlayerMoney(v, 5000) outputChatBox("Você recebeu um salário no total de 5000 R$", v, 255, 255, 255, true) end end end setTimer(payday, _minutes * 60000, 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 Apenas troque nome_da_acl para a ACL que você deseja. 1
Barradas Posted June 27, 2019 Author Posted June 27, 2019 39 minutes ago, asrzkj said: local _minutes = 10 -- // O salário será entregue a cada quantos minutos? function payday() for _, v in pairs(getElementsByType("player")) do if isPlayerInACL(v, "nome_da_acl") then givePlayerMoney(v, 5000) outputChatBox("Você recebeu um salário no total de 5000 R$", v, 255, 255, 255, true) end end end setTimer(payday, _minutes * 60000, 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 Apenas troque nome_da_acl para a ACL que você deseja. Mano namoral muito obrigado. Graças a si vou poder ter meu próprio server. e obrigado a todos os outros também 1
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