Resource:Sqlbans

From Multi Theft Auto: Wiki
Revision as of 17:07, 1 February 2011 by Arran Fortuna (talk | contribs)
Jump to navigation Jump to search

The SQLbans resource gives servers 100% flexibility with their ban system as it can be edited to meet their needs. The bans are stored using the inbult SQL functions into the database "bans" 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: A string for either a custom banisher, player name or resource name
  • reason: The reason for the ban.
  • duration: The minutes left in the ban time.
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: The minutes left in the ban time.
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.