Jump to content

Ajuda com sistema de pagamento e acl


Recommended Posts

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)

Link to comment

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? 

 

Link to comment
  • Moderators
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

 

Link to comment
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 

 

Link to comment
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?

Link to comment
  • Other Languages Moderators
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.

  • Thanks 1
Link to comment
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

 

  • Haha 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...