Resource:Sqlbans: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 24: | Line 24: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Returns=== | ===Returns=== | ||
*'''banValue:''' A string for a players serial or IP address. | *'''Column 1 - banValue:''' A string for a players serial or IP address. | ||
*''' | *'''Column 2 - theBanisher:''' A string for either a custom banisher, player name or resource name | ||
*''' | *'''Column 3 - theReason:''' The reason for the ban. | ||
*''' | *'''Column 4 - theDuration:''' The minutes left in the ban time. | ||
===getBanDetailsSQL=== | ===getBanDetailsSQL=== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
string banValue string | string banValue, string theBanisher, string theReason, int theDuration getBanDetailsSQL ( string banValue ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguements=== | ===Required Arguements=== | ||
Line 38: | Line 38: | ||
===Returns=== | ===Returns=== | ||
*'''banValue:''' A string for a players serial or IP address. | *'''banValue:''' A string for a players serial or IP address. | ||
*''' | *'''theBanisher:''' Either a string, player pointer, or element pointer. | ||
*''' | *'''theReason:''' The reason for the ban. | ||
*''' | *'''theDuration:''' The minutes left in the ban time. | ||
===banPlayerSQL=== | ===banPlayerSQL=== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool banPlayerSQL ( player thePlayer, bool serial, bool ipAddress, string/player/resource | bool banPlayerSQL ( player thePlayer, bool serial, bool ipAddress, string/player/resource theBanisher, string theReason, int theDuration ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguements=== | ===Required Arguements=== | ||
Line 50: | Line 50: | ||
*'''serial:''' Ban their serial? | *'''serial:''' Ban their serial? | ||
*'''ipAddress:''' Ban their IP address? (Can't ban both.) | *'''ipAddress:''' Ban their IP address? (Can't ban both.) | ||
*''' | *'''theBanisher:''' A string, player, or resource that is banning the player. | ||
*''' | *'''theReason:''' The ban reason. | ||
*''' | *'''theDuration:''' Time in minutes the ban should last for. | ||
===Returns=== | ===Returns=== |
Revision as of 17:17, 1 February 2011
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 [-]
ServeraddBanSQL
bool addBanSQL ( string banValue, string/element banisher, string reason, int duration )
Required Arguments
- 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.
Returns
Returns true if the ban was successfully added. If the ban was not successfully added then false will be returned
getBansSQL
table getBansSQL ()
Returns
- Column 1 - banValue: A string for a players serial or IP address.
- Column 2 - theBanisher: A string for either a custom banisher, player name or resource name
- Column 3 - theReason: The reason for the ban.
- Column 4 - theDuration: The minutes left in the ban time.
getBanDetailsSQL
string banValue, string theBanisher, string theReason, int theDuration getBanDetailsSQL ( string banValue )
Required Arguements
- banValue: A string for a players serial or IP address.
Returns
- banValue: A string for a players serial or IP address.
- theBanisher: Either a string, player pointer, or element pointer.
- theReason: The reason for the ban.
- theDuration: The minutes left in the ban time.
banPlayerSQL
bool banPlayerSQL ( player thePlayer, bool serial, bool ipAddress, string/player/resource theBanisher, string theReason, int theDuration )
Required Arguements
- thePlayer: The player to ban.
- serial: Ban their serial?
- ipAddress: Ban their IP address? (Can't ban both.)
- theBanisher: A string, player, or resource that is banning the player.
- theReason: The ban reason.
- theDuration: Time in minutes the ban should last for.
Returns
This function will return true if the player was successfully banned. If they weren't successfully banned false will be returned.
removeBanSQL
bool removeBanSQL ( string banValue, string/player/resource unbanisher )
Required Arguements
- banValue: An IP address or serial to unban
- serial: A string, player or resource that is causing the unban.
Returns
This function will return true if the ban was successfully removed. If the ban wasn't successfully removed or the ban didn't even exist false will be returned.