WiBox Posted August 13, 2018 Share Posted August 13, 2018 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
WorthlessCynomys Posted August 13, 2018 Share Posted August 13, 2018 Users are stored in ACL with the prefix user. and their usernames with what they registered and logged in on the server. So like a player registers on the server with username Doe, he will be stored in the ACL like user.Doe . You have to use this format in the isObjectInACLGroup to check it properly. Link to comment
WiBox Posted August 13, 2018 Author Share Posted August 13, 2018 (edited) 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 August 13, 2018 by SSKE Link to comment
Discord Moderators Pirulax Posted August 13, 2018 Discord Moderators Share Posted August 13, 2018 (edited) 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 August 13, 2018 by Pirulax Link to comment
WiBox Posted August 13, 2018 Author Share Posted August 13, 2018 I need to check if the player is in Donator acl group in Client Side not server side Link to comment
Discord Moderators Pirulax Posted August 13, 2018 Discord Moderators Share Posted August 13, 2018 (edited) Jesus Christ help me. This is the way you can do it. Anyways, why do you need to check C.-S. if a player is a donator or not? Edited August 13, 2018 by Pirulax Link to comment
WiBox Posted August 13, 2018 Author Share Posted August 13, 2018 (edited) 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 August 13, 2018 by SSKE 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