General > Developers Corner
How to Read From the Ban List
[?B][F.F.M.]General Reidmaster:
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.)
Avoid:
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: ---if ULib.bans[SteamIDOfPlayer] then
...
end
--- End code ---
Cheers,
Avoid
[?B][F.F.M.]General Reidmaster:
--- Quote from: Avoid 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: ---if ULib.bans[SteamIDOfPlayer] then
...
end
--- End code ---
Cheers,
Avoid
--- End quote ---
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
[0] Board index
Go to full version