Resource:Sqlbans

From Multi Theft Auto: Wiki
Revision as of 17:00, 1 February 2011 by Arran Fortuna (talk | contribs) (Created page with "{{Resource page}} __NOTOC__ The SQLbans resource gives servers 100% flexibility with their ban system because they can edit it to meet their needs. The bans are stored in SQL rat...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The SQLbans resource gives servers 100% flexibility with their ban system because they can edit it to meet their needs. The bans are stored in SQL rather than XML which is used by the inbuilt MTA ban system.

Download can be found: On the MTA community.

Exported functions/events

Click to collapse [-]
Server

Functions

bool addBanSQL ( string banValue, string/element banisher, string reason, int duration )
  • banValue: A string for a players serial or IP address.
  • banisher: Either a string, player pointer, or element pointer.
  • reason: The reason for the ban.
  • duration: Integer in minutes for the ban.
table getBansSQL ()

Returns a table with 4 columns:

  • banValue: A string for a players serial or IP address.
  • banisher: Either a string, player pointer, or element pointer.
  • reason: The reason for the ban.
  • duration: Integer in minutes for the ban.
string banValue string banisher string reason int duration getBanDetailsSQL ( string banValue )

Returns three strings and an integer:

  • banValue: A string for a players serial or IP address.
  • banisher: Either a string, player pointer, or element pointer.
  • reason: The reason for the ban.
  • duration: Integer in minutes for the ban.
bool banPlayerSQL ( player thePlayer, bool serial, bool ipAddress, string/player/resource banisher, string reason, int duration )
  • thePlayer: The player to ban
  • serial: Ban their serial?
  • ipAddress: Ban their IP address? (Can't ban both)
  • banisher: A string, player, or resource that is banning the player
  • reason: The ban reason
  • duration: Time in minutes the ban should last for
bool removeBanSQL ( string banValue, string/player/resource unbanisher )
  • banValue: An IP address or serial to unban
  • serial: A string, player or resource that is causing the unban.