today I'm releasing a mod for the game file which has always been sought, at least in the past.
It's the in-game ban command, which GMs can use in the same way they would use the "block chat" command.
The mod is applied to the game with the "dynamic library" method, but I haven't used any code from the one posted by niky90, everything's been done from scratch by me and only me: the "base" library is the same I will use on my server,
, but, obviously, there are just two modules in this one, the "Command extension" and the "Ban command" ones.To use the library, download it and put it somewhere on your server, then edit the start script, to be more precise the line where it runs the "cores" (it'll probably look like "./corename"):
Code:
env LD_PRELOAD="/full/path/to/the/lib.so" ./corename
You can check if the library has been loaded by the message it shows when the game starts:
The in-game usage is really simple:
Code:
/ban playername [duration]
To unban, just write:
Code:
/ban playername 0
That should be all. I will probably update this when I have time, to make it show a notice to all players that a certain user has been (un)banned.
Credits:
me XD
, since I wouldn't have made the library, nor could I have tested without this server.Changelog:
- 29/04/2013: Initial release, added automatic disconnect and database query in case the banned player is not online.
Quote:
Update: someone asked via PM to have the source of the ban function. While it's not a problem for me to post that, it would be to post the source for my whole library. So, I'm posting this just for reference, to let people see how it works (and also check if there is any bug, why not). You probably won't be able to compile the source as it is, if you don't have the right header files XD
![]()

Password: UniversalElements






