Jump to content

Scripting Question


SilvaSilva

Recommended Posts

Posted

Hello,

Im trying to do a script that tells me how many people there are in one ACL but im having a hard time trying to find which are the right instructions.
If anyone could help i would be thankful
 

 

Posted

getAccounts() will return a table with all accounts so you can loop trough and check if is in acl group using isObjectInACLGroup()

Posted
47 minutes ago, Tekken said:

getAccounts() will return a table with all accounts so you can loop trough and check if is in acl group using isObjectInACLGroup()

Im sorry but can you give me an example?

Posted

All info on getAccounts is on the wiki: https://wiki.multitheftauto.com/wiki/GetAccounts

calling this function on the serverside will return a table, a table can be looped over for example by using a for loop.
So every loop you can use the account to pass in the required arguments for isObjectInACLGroup (https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup).

isObjectInACLGroup needs an object and a group as you can see in the example.
The object is string formatted as user.username so "user."..getAccountName(account)

The group which you get returned from aclGetGroup ( "groupname" )

  • Scripting Moderators
Posted
1 hour ago, Tekken said:

getAccounts() will return a table with all accounts so you can loop trough and check if is in acl group using isObjectInACLGroup()

I suggest to use aclGroupListObjects instead of looping a huge table of all accounts
 

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...