ULX

Author Topic: How to Read From the Ban List  (Read 3803 times)

0 Members and 1 Guest are viewing this topic.

Offline [?B][F.F.M.]General Reidmaster

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
How to Read From the Ban List
« on: January 13, 2015, 08:56:06 PM »
So I am implementing a team ban for a jailbreak server and I have run into an issue, I don't have any clue how to read from a ban list file. What I ended up doing was making a modified version of the ulx.ban command to output to a file called guardban.txt but I have no idea how to read from the file to check if a person should be able to join the Guard team. Any ideas?

Also, if there is an easier way it would be greatly appreciated if you would tell me.

(If you need the code I will upload it, but it really isn't that much different from the ulx.ban command.)
« Last Edit: January 13, 2015, 08:58:07 PM by [?B][F.F.M.]General Reidmaster »

Offline Avoid

  • Full Member
  • ***
  • Posts: 142
  • Karma: 42
Re: How to Read From the Ban List
« Reply #1 on: January 14, 2015, 03:50:08 AM »
Hello,
I highly advise against modifing the ulib code, use this function instead to get a list of the bans: ULib.bans, it returns a table.
You then could do something like:

Code: [Select]
if ULib.bans[SteamIDOfPlayer] then
...
end

Cheers,
Avoid

Offline [?B][F.F.M.]General Reidmaster

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: How to Read From the Ban List
« Reply #2 on: January 14, 2015, 08:10:16 AM »
Hello,
I highly advise against modifing the ulib code, use this function instead to get a list of the bans: ULib.bans, it returns a table.
You then could do something like:

Code: [Select]
if ULib.bans[SteamIDOfPlayer] then
...
end

Cheers,
Avoid

Cool, thanks!

(Also, to clarify, I didn't actually modify the ulx.ban command. I copied all of the functions necessary to make it work and made a new command ulx.guardban.)

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given