ViolationHandler
Supported Games
- NTeleportation1.7.5
The BlockUsers plugin does not perform any specific tasks on its own, but rather serves as a tool for managing a list of blocked users. It provides functions that can be utilized by other plugins to perform various actions based on a player's list of blocked users. These actions can include preventing teleportation or blocking access to certain things for specific players.
However:
It was designed originally for NTeleportation to allow users to prevent them from attempting to tp to them. This can prevent users from spamming tp requests to a user. And since early June 2023, this has been implemented into NTeleportation for use.
Configuration
- CacheTime (Default Value : 0)= Blocked Users list cache time (0 to disable)
- MaxBlockedUsers (Default Value : 30)= Maximum number of blocked users (0 to disable)
- BlockDelay (Default Value : 00:00:00)= Cooldown for block command in seconds (00:00:00 to disable) Formatting for the BlockDelay is as follows hh:mm:ss, h = hours, m = minutes, s = seconds.
Limitation of BlockDelay, you need to put 00:01:00 for 1 minute, you cannot do 00:00:60 seconds. Same for 1 hr, 01:00:00 and not 00:60:00.
- UsePermissions (Default Value : false)= Use permission system
{
"Blocked Users list cache time (0 to disable)": 0,
"Maximum number of blocked users (0 to disable)": 30,
// The timer below has a cooldown of 2 hours 4 minutes and 5 seconds
"Cooldown for block command in seconds (00:00:00 to disable)": 02:04:05,
"Use permission system": false
}
Commands
/block <add/remove> <player name or id>
-- Add or remove a player as a blocked user/block list
-- List all of your current blocked users
Localization
Permissions
Note: If UsePermissions is set to false
, then block.use
permissions are NOT required.
block.use
- /blockadd
/remove
(space)player name
orid
API
Before you can use the functions from this API, you must reference the plugin.
[PluginReference]
private Plugin BlockUsers;
Once you have obtained the reference to the plugin, you can easily invoke the desired API method by calling it.
BlockUsers.CallHook("HasBlockedUser", playerId, targetId)
//Example Call:
var fr = BlockUsers?.CallHook("AreBlockedUsers", playerid, ownerid);
In the example above, the API method "HasBlockedUser" is used. To find other available methods, please refer to the list below.
Api Methods
bool AddBlockedUser(string playerId, string blockedUserId)
bool AddBlockedUser(ulong playerId, ulong blockedUserId)
bool RemoveBlockedUser(string playerId, string blockedUserId)
bool RemoveBlockedUser(ulong playerId, ulong blockedUserId)
bool HasBlockedUser(string playerId, string blockedUserId)
bool HasBlockedUser(ulong playerId, ulong blockedUserId)
bool AreBlockedUsers(string playerId, string blockedUserId)
bool AreBlockedUsers(ulong playerId, ulong blockedUserId)
bool IsBlockedUser(string playerId, string blockedUserId)
bool IsBlockedUser(ulong playerId, ulong blockedUserId)
string[] GetBlockedUserList(string playerId)
ulong[] GetBlockedUserList(ulong playerId)
string[] IsBlockedUserOf(string playerId)
ulong[] IsBlockedUserOf(ulong playerId)
bool HadBlockedUser(string playerId, string blockedUserId)
bool HadBlockedUser(ulong playerId, ulong blockedUserId)
bool WereBlockedUsers(string playerId, string blockedUserId)
bool WereBlockedUsers(ulong playerId, ulong blockedUserId)
bool WasBlockedUser(string playerId, string blockedUserId)
bool WasBlockedUser(ulong playerId, ulong blockedUserId)
string[] GetBlockedUsers(string playerId)
ulong[] GetBlockedUsers(ulong playerId)
int GetMaxBlockedUsers()
Hooks
private void OnBlockedUserAdded(string playerId, string blockedUserId)
private void OnBlockedUserRemoved(string playerId, string blockedUserId)
Credit
MrBlue/Nogrod, Nogrod made the original Friends API plugin for Rust, now (to my knowledge) MrBlue maintains it. This plugin is based off of the Friends plugin, hence its extreme similarities to it and it's uMod plugin page.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.