Jump to content

Add/Remove ACL user


WiBox

Recommended Posts

I made a panel for add a thing to a group in ACL..

I want by a click of a button the player get added to that group and buy a click he get removed.. any ideas?

My problem is to check if the player is already in that ACL group, what I want to do:

button named: Buy Donator

if he already got Donator then the button will be disabled with guiSetProperty but the thing is I need to know if the players isObjectInACLGroup but didn't work for me.. Any help please

 

Link to comment

I used:

function isPlayerDonator(plr)
    accName = getAccountName(getPlayerAccount(plr))
    if ( isObjectInACLGroup("user."..accName, aclGetGroup("Donator")) then
        return true
    else
        return false
    end
end
addEvent("isPlayerDonator", true)
addEventHandler("isPlayerDonator", root, isPlayerDonator)

but I didn't know how to write in client side, if isPlayerDonator == true then if == false then... Any tips?

Edited by SSKE
Link to comment
  • Discord Moderators

you can't use simple "return" to return a value from a server-sided function to a client-side one, but instead you need to triggerClientEvent with a value.
Actually, you don't even need those 'if' statements.

addEvent("isPlayerDonator", true)
addEventHandler("isPlayerDonator", root, function()
  triggerClientEvent("isPlayerDonatorAnswer", client, isObjectInACLGroup("user."..tostring(getAccountName(getPlayerAccount(plr))), aclGetGroup("Donator"))
end)

 

Edited by Pirulax
Link to comment

Because I'm making as with a click of a button the player get added to donator ACL Group, and if the player is already in the donate acl group i want to disable the button 

I made a panel with a button which I want from it with a click of a button it add a player in the donator acl group, but I want if the player already in that acl group the button will be disable so he don't repress it, that's why I need to check if the player already in the Donator acl group or not and use it in Client Side so I can use guiSetProperty

 

Edited by SSKE
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...