[PluginReference]
private Plugin TemporaryPermissions;
There are 30 methods:
IsReady
User's Permissions:
GrantUserPermission
RevokeUserPermission
UserHasPermission
GrantActiveUsersPermission
GrantAllUsersPermission
RevokeActiveUsersPermission
RevokeAllUsersPermission
UserGetAllPermissions
UserGetPermissionByExpiry
UserGetAllPermissionsByExpiry
ActiveUsersGetAllPermissions
AllUsersGetAllPermissions
User's Groups:
AddUserGroup
RemoveUserGroup
UserHasGroup
AddActiveUsersGroup
AddAllUsersGroup
RemoveActiveUsersGroup
RemoveAllUsersGroup
UserGetAllGroups
ActiveUsersGetAllGroups
AllUsersGetAllGroups
Group's Permissions:
GrantGroupPermission
RevokeGroupPermission
GroupHasPermission
GrantAllGroupsPermission
RevokeAllGroupsPermission
GroupGetAllPermissions
AllGroupsGetAllPermissions
IsReady:
Used to check if the TemporaryPermissions plugin is loaded and ready to work.
The IsReady method returns true if it is ready, or null if it is not.
(bool)TemporaryPermissions?.Call("IsReady");//Calling the IsReady method. If the result is not null(bool true), the plugin is ready.
GrantUserPermission:
Used to grant a temporary permission to a player.
Returns true if the grant was successful.
To call the GrantUserPermission method, you need to pass 5 parameters, 3 of which are optional:
IPlayer or BasePlayer or <string>playerID - The player object or their Id;
<string>permName - The name of the permission;
<int>secondsToAdd or <DateTime>expireDate - Optional. The time in seconds to add, or the end date. If a number less than 1 is specified, or if this parameter is not specified, the permission will be valid until the wipe;
<bool>fromNow or <DateTime>assignedDate - Optional. true/false to specify whether the seconds should be added to the current date or to the existing time, or an exact assignment date. Defaults to the current date;
<bool>checkExistence - Optional. Whether to check for the existence of the permission.
(bool)TemporaryPermissions?.Call("GrantUserPermission", player.UserIDString, "realpve.vip");//Calling the GrantUserPermission method without specifying the third parameter, to grant temporary permission until the wipe.
(bool)TemporaryPermissions?.Call("GrantUserPermission", player.UserIDString, "realpve.vip", 0);//Calling the GrantUserPermission method with the specified number less than 1, to grant temporary permission until the wipe.
(bool)TemporaryPermissions?.Call("GrantUserPermission", player.UserIDString, "realpve.vip", 3600, true, true);//Calling the GrantUserPermission method with the specified number of seconds to add.
(bool)TemporaryPermissions?.Call("GrantUserPermission", player.UserIDString, "realpve.vip", expireDate, assignedDate, true);//Calling the GrantUserPermission method with the specified DateTime for the end and start of the temporary permission.
RevokeUserPermission:
Used to revoke a temporary permission from a player.
Returns true if the revoke was successful.
To call the RevokeUserPermission method, you need to pass 2 parameters:
IPlayer or BasePlayer or <string>playerID - The player object or their Id;
<string>permName - The name of the permission.
(bool)TemporaryPermissions?.Call("RevokeUserPermission", player.UserIDString, "realpve.vip");
UserHasPermission:
Used to check if a player has a temporary permission.
Returns true if the player has the specified temporary permission.
To call the UserHasPermission method, you need to pass 2 parameters:
IPlayer or BasePlayer or <string>playerID - The player object or their Id;
<string>permName - The name of the permission.
(bool)TemporaryPermissions?.Call("UserHasPermission", player.UserIDString, "realpve.vip");
GrantActiveUsersPermission:
Used to temporarily grant a permission to all online players.
Returns the <int>number of successful grants of temporary permissions to players.
To call the GrantActiveUsersPermission method, you need to pass 3 parameters, 2 of which is optional:
<string>permName - The name of the permission;
<int>secondsToAdd or <DateTime>expireDate - Optional. The time in seconds to add, or the end date. If a number less than 1 is specified, or if this parameter is not specified, the permission will be valid until the wipe;
<bool>fromNow or <DateTime>assignedDate - Optional. true/false to specify whether the seconds should be added to the current date or to the existing time, or an exact assignment date. Defaults to the current date.
(int)TemporaryPermissions?.Call("GrantActiveUsersPermission", "realpve.vip");// Calling the GrantActiveUsersPermission method without specifying the second parameter, to grant all online players temporary permission until the wipe.
(int)TemporaryPermissions?.Call("GrantActiveUsersPermission", "realpve.vip", 0);//Calling the GrantActiveUsersPermission method with the specified number less than 1, to grant all online players temporary permission until the wipe.
(int)TemporaryPermissions?.Call("GrantActiveUsersPermission", "realpve.vip", 3600, true);//Calling the GrantActiveUsersPermission method with the specified number of seconds to add.
(int)TemporaryPermissions?.Call("GrantActiveUsersPermission", "realpve.vip", expireDate, assignedDate);//Calling the GrantActiveUsersPermission method with the specified DateTime for the end and start of the temporary permission.
GrantAllUsersPermission:
Used to grant a temporary permission to all players.
Returns the <int>number of successful grants of temporary permissions to players.
To call the GrantAllUsersPermission method, you need to pass 3 parameters, 2 of which is optional:
<string>permName - The name of the permission;
<int>secondsToAdd or <DateTime>expireDate - Optional. The time in seconds to add, or the end date. If a number less than 1 is specified, or if this parameter is not specified, the permission will be valid until the wipe;
<bool>fromNow or <DateTime>assignedDate - Optional. true/false to specify whether the seconds should be added to the current date or to the existing time, or an exact assignment date. Defaults to the current date.
(int)TemporaryPermissions?.Call("GrantAllUsersPermission", "realpve.vip");//Calling the GrantAllUsersPermission method without specifying the second parameter, to grant all players temporary permission until the wipe.
(int)TemporaryPermissions?.Call("GrantAllUsersPermission", "realpve.vip", 0);//Calling the GrantAllUsersPermission method with the specified number less than 1, to grant all players temporary permission until the wipe.
(int)TemporaryPermissions?.Call("GrantAllUsersPermission", "realpve.vip", 3600, true);//Calling the GrantAllUsersPermission method with the specified number of seconds to add.
(int)TemporaryPermissions?.Call("GrantAllUsersPermission", "realpve.vip", expireDate, assignedDate);//Calling the GrantAllUsersPermission method with the specified DateTime for the end and start of the temporary permission.
RevokeActiveUsersPermission:
Used to revoke a temporary permission from all online players.
Returns the <int>number of successful revokes of temporary permissions to players.
To call the RevokeActiveUsersPermission method, you need to pass 1 parameter:
<string>permName - The name of the permission.
(int)TemporaryPermissions?.Call("RevokeActiveUsersPermission", "realpve.vip");
RevokeAllUsersPermission:
Used to revoke a temporary permission from all players.
Returns the <int>number of successful revokes of temporary permissions to players.
To call the RevokeAllUsersPermission method, you need to pass 1 parameter:
<string>permName - The name of the permission.
(int)TemporaryPermissions?.Call("RevokeAllUsersPermission", "realpve.vip");
UserGetAllPermissions:
Used to retrieve all temporary permissions of a player.
Returns a Dictionary<string, DateTime[]> where the key is the permission name and the value is an array of 2 DateTimes: the first date is the assignment date and the second date is the expiration date of the permission.
If the expiration date is set to default, it means the permission is valid until the wipe.
To call the UserGetAllPermissions method, you need to pass 1 parameter:
<string>playerID - The player's Id.
(Dictionary<string, DateTime[]>)TemporaryPermissions?.Call("UserGetAllPermissions", player.UserIDString);
UserGetPermissionByExpiry:
Used to get the expiration date of a player's temporary permission, considering the temporary permission for the group they may belong to. The latest date is taken.
Returns a DateTime[]: the first date is the assignment date and the second date is the expiration date of the permission.
If the expiration date is set to default, it means the permission is valid until the wipe.
To call the UserGetPermissionByExpiry method, you need to pass 2 parameters:
IPlayer or BasePlayer or <string>playerID - The player object or their Id;
<string>permName - The name of the permission.
(DateTime[])TemporaryPermissions?.Call("UserGetPermissionByExpiry", player.UserIDString, "realpve.vip");
UserGetAllPermissionsByExpiry:
Used to get the expiration date of all temporary permissions for a player, considering the temporary permissions for the group they may belong to. The latest date is taken.
Returns a Dictionary<string, DateTime[]> where the key is the permission name and the value is an array of 2 DateTimes: the first date is the assignment date and the second date is the expiration date of the permission.
If the expiration date is set to default, it means the permission is valid until the wipe.
To call the UserGetAllPermissionsByExpiry method, you need to pass 1 parameter:
IPlayer or BasePlayer or <string>playerID - The player object or their Id.
(Dictionary<string, DateTime[]>)TemporaryPermissions?.Call("UserGetAllPermissionsByExpiry", player.UserIDString);
ActiveUsersGetAllPermissions:
Used to retrieve all temporary permissions of all online players who have temporary permissions.
Returns a Dictionary<string, Dictionary<string, DateTime[]>> where the key is userID and the value is another Dictionary<string, DateTime[]>, where the key is the permission name and the value is an array of 2 DateTimes: the first date is the assignment date and the second date is the expiration date of the permission.
If the expiration date is set to default, it means the permission is valid until the wipe.
(Dictionary<string, Dictionary<string, DateTime[]>>)TemporaryPermissions?.Call("ActiveUsersGetAllPermissions");
AllUsersGetAllPermissions:
Used to retrieve all temporary permissions of all players who have temporary permissions.
Returns a Dictionary<string, Dictionary<string, DateTime[]>> where the key is userID and the value is another Dictionary<string, DateTime[]>, where the key is the permission name and the value is an array of 2 DateTimes: the first date is the assignment date and the second date is the expiration date of the permission.
If the expiration date is set to default, it means the permission is valid until the wipe.
(Dictionary<string, Dictionary<string, DateTime[]>>)TemporaryPermissions?.Call("AllUsersGetAllPermissions");
AddUserGroup:
Used to temporarily add a player to a group.
Returns true if the addition was successful.
To call the AddUserGroup method, you need to pass 5 parameters, 3 of which are optional:
IPlayer or BasePlayer or <string>playerID - The player object or their Id;
<string>groupName - The name of the group;
<int>secondsToAdd or <DateTime>expireDate - Optional. The time in seconds to add, or the end date. If a number less than 1 is specified, or if this parameter is not specified, the group will be valid until the wipe;
<bool>fromNow or <DateTime>assignedDate - Optional. true/false to specify whether the seconds should be added to the current date or to the existing time, or an exact assignment date. Defaults to the current date;
<bool>checkExistence - Optional. Whether to check for the existence of the group.
(bool)TemporaryPermissions?.Call("AddUserGroup", player.UserIDString, "vip");//Calling the AddUserGroup method without specifying the third parameter to temporarily add a player, to a group until the wipe.
(bool)TemporaryPermissions?.Call("AddUserGroup", player.UserIDString, "vip", 0);//Calling the AddUserGroup method with the specified number less than 1, to temporarily add a player to a group until the wipe.
(bool)TemporaryPermissions?.Call("AddUserGroup", player.UserIDString, "vip", 3600, true, true);//Calling the AddUserGroup method with the specified number of seconds to add.
(bool)TemporaryPermissions?.Call("AddUserGroup", player.UserIDString, "vip", expireDate, assignedDate, true);//Calling the AddUserGroup method with the specified DateTime for the end and start of the temporary permission.
RemoveUserGroup:
Used to remove a temporary group from a player.
Returns true if the removal was successful.
To call the RemoveUserGroup method, you need to pass 2 parameters:
IPlayer or BasePlayer or <string>playerID - The player object or their Id;
<string>groupName - The name of the group.
(bool)TemporaryPermissions?.Call("RemoveUserGroup", player.UserIDString, "vip");
UserHasGroup:
Used to check if a player has a temporary group.
Returns true if the player has the specified temporary group.
To call the UserHasGroup method, you need to pass 2 parameters:
IPlayer or BasePlayer or <string>playerID - The player object or their Id;
<string>groupName - The name of the group.
(bool)TemporaryPermissions?.Call("UserHasGroup", player.UserIDString, "vip");
AddActiveUsersGroup:
Used to temporarily add a group to all online players.
Returns the <int>number of successful additions of the temporary group to players.
To call the AddActiveUsersGroup method, you need to pass 3 parameters, 2 of which is optional:
<string>groupName - The name of the group;
<int>secondsToAdd or <DateTime>expireDate - Optional. The time in seconds to add, or the end date. If a number less than 1 is specified, or if this parameter is not specified, the group will be valid until the wipe;
<bool>fromNow or <DateTime>assignedDate - Optional. true/false to specify whether the seconds should be added to the current date or to the existing time, or an exact assignment date. Defaults to the current date.
(int)TemporaryPermissions?.Call("AddActiveUsersGroup", "vip");//Calling the AddActiveUsersGroup method without specifying the second parameter to temporarily add all online players to a group until the wipe.
(int)TemporaryPermissions?.Call("AddActiveUsersGroup", "vip", 0);//Calling the AddActiveUsersGroup method with the specified number less than 1, to temporarily add all online players to a group until the wipe.
(int)TemporaryPermissions?.Call("AddActiveUsersGroup", "vip", 3600, true);//Calling the AddActiveUsersGroup method with the specified number of seconds to add.
(int)TemporaryPermissions?.Call("AddActiveUsersGroup", "vip", expireDate, assignedDate);//Calling the AddActiveUsersGroup method with the specified DateTime for the end and start of the temporary permission.
AddAllUsersGroup:
Used to temporarily add a group to all players.
Returns the <int>number of successful additions of the temporary group to players.
To call the AddAllUsersGroup method, you need to pass 3 parameters, 2 of which is optional:
<string>groupName - The name of the group;
<int>secondsToAdd or <DateTime>expireDate - Optional. The time in seconds to add, or the end date. If a number less than 1 is specified, or if this parameter is not specified, the group will be valid until the wipe;
<bool>fromNow or <DateTime>assignedDate - Optional. true/false to specify whether the seconds should be added to the current date or to the existing time, or an exact assignment date. Defaults to the current date.
(int)TemporaryPermissions?.Call("AddAllUsersGroup", "vip");//Calling the AddAllUsersGroup method without specifying the second parameter to temporarily add all players to a group until the wipe.
(int)TemporaryPermissions?.Call("AddAllUsersGroup", "vip", 0);//Calling the AddAllUsersGroup method with the specified number less than 1, to temporarily add all players to a group until the wipe.
(int)TemporaryPermissions?.Call("AddAllUsersGroup", "vip", 3600, true);//Calling the AddAllUsersGroup method with the specified number of seconds to add.
(int)TemporaryPermissions?.Call("AddAllUsersGroup", "vip", expireDate, assignedDate);//Calling the AddAllUsersGroup method with the specified DateTime for the end and start of the temporary permission.
RemoveActiveUsersGroup:
Used to remove a temporary group from all online players.
Returns the <int>number of successful removals of temporary groups from players.
To call the RemoveActiveUsersGroup method, you need to pass 1 parameter:
<string>groupName - The name of the group.
(int)TemporaryPermissions?.Call("RemoveActiveUsersGroup", "vip");
RemoveAllUsersGroup:
Used to remove a temporary group from all players.
Returns the <int>number of successful removals of temporary groups from players.
To call the RemoveAllUsersGroup method, you need to pass 1 parameter:
<string>permName - The name of the permission.
(int)TemporaryPermissions?.Call("RemoveAllUsersGroup", "vip");
UserGetAllGroups:
Used to retrieve all temporary groups of a player.
Returns a Dictionary<string, DateTime[]> where the key is the group name and the value is an array of 2 DateTimes: the first date is the assignment date and the second date is the expiration date of the group.
If the expiration date is set to default, it means the group is valid until the wipe.
To call the UserGetAllGroups method, you need to pass 1 parameter:
<string>permName - The name of the permission.
(Dictionary<string, DateTime[]>)TemporaryPermissions?.Call("UserGetAllGroups", player.UserIDString);
ActiveUsersGetAllGroups:
Used to retrieve all temporary groups of all online players who have temporary groups.
Returns a Dictionary<string, Dictionary<string, DateTime[]>> where the key is userID and the value is another Dictionary<string, DateTime[]>, where the key is the group name and the value is an array of 2 DateTimes: the first date is the assignment date and the second date is the expiration date of the group.
If the expiration date is set to default, it means the group is valid until the wipe.
(Dictionary<string, Dictionary<string, DateTime[]>>)TemporaryPermissions?.Call("ActiveUsersGetAllGroups");
AllUsersGetAllGroups:
Used to retrieve all temporary groups of all players who have temporary groups.
Returns a Dictionary<string, Dictionary<string, DateTime[]>> where the key is userID and the value is another Dictionary<string, DateTime[]>, where the key is the group name and the value is an array of 2 DateTimes: the first date is the assignment date and the second date is the expiration date of the group.
If the expiration date is set to default, it means the group is valid until the wipe.
(Dictionary<string, Dictionary<string, DateTime[]>>)TemporaryPermissions?.Call("AllUsersGetAllGroups");
GrantGroupPermission:
Used to grant a temporary permission to a group.
Returns true if the grant was successful.
To call the GrantGroupPermission method, you need to pass 5 parameters, 3 of which are optional:
<string>groupName - The name of the group;
<string>permName - The name of the permission;
<int>secondsToAdd or <DateTime>expireDate - Optional. The time in seconds to add, or the end date. If a number less than 1 is specified, or if this parameter is not specified, the permission will be valid until the wipe;
<bool>fromNow or <DateTime>assignedDate - Optional. true/false to specify whether the seconds should be added to the current date or to the existing time, or an exact assignment date. Defaults to the current date;
<bool>checkExistence - Optional. Whether to check for the existence of the permission.
(bool)TemporaryPermissions?.Call("GrantGroupPermission", "vip", "realpve.vip");//Calling the GrantGroupPermission method without specifying the third parameter, to grant temporary permission until the wipe.
(bool)TemporaryPermissions?.Call("GrantGroupPermission", "vip", "realpve.vip", 0);//Calling the GrantGroupPermission method with the specified number less than 1, to grant temporary permission until the wipe.
(bool)TemporaryPermissions?.Call("GrantGroupPermission", "vip", "realpve.vip", 3600, true, true);//Calling the GrantGroupPermission method with the specified number of seconds to add.
(bool)TemporaryPermissions?.Call("GrantGroupPermission", "vip", "realpve.vip", expireDate, assignedDate, true);//Calling the GrantGroupPermission method with the specified DateTime for the end and start of the temporary permission.
RevokeGroupPermission:
Used to revoke a temporary permission from a group.
Returns true if the revoke was successful.
To call the RevokeGroupPermission method, you need to pass 2 parameters:
<string>groupName - The name of the group;
<string>permName - The name of the permission.
(bool)TemporaryPermissions?.Call("RevokeGroupPermission", "vip", "realpve.vip");
GroupHasPermission:
Used to check if a group has a temporary permission.
Returns true if the group has the specified temporary permission.
To call the GroupHasPermission method, you need to pass 2 parameters:
<string>groupName - The name of the group;
<string>permName - The name of the permission.
(bool)TemporaryPermissions?.Call("GroupHasPermission", "vip", "realpve.vip");
GrantAllGroupsPermission:
Used to temporarily grant a permission to all groups.
Returns the <int>number of successful grants of temporary permissions to groups.
To call the GrantAllGroupsPermission method, you need to pass 3 parameters, 2 of which is optional:
<string>permName - The name of the permission;
<int>secondsToAdd or <DateTime>expireDate - Optional. The time in seconds to add, or the end date. If a number less than 1 is specified, or if this parameter is not specified, the permission will be valid until the wipe;
<bool>fromNow or <DateTime>assignedDate - Optional. true/false to specify whether the seconds should be added to the current date or to the existing time, or an exact assignment date. Defaults to the current date.
(int)TemporaryPermissions?.Call("GrantAllGroupsPermission", "realpve.vip");//Calling the GrantAllGroupsPermission method without specifying the second parameter, to grant all groups temporary permission until the wipe.
(int)TemporaryPermissions?.Call("GrantAllGroupsPermission", "realpve.vip", 0);//Calling the GrantAllGroupsPermission method with the specified number less than 1, to grant all groups temporary permission until the wipe.
(int)TemporaryPermissions?.Call("GrantAllGroupsPermission", "realpve.vip", 3600, true);//Calling the GrantAllGroupsPermission method with the specified number of seconds to add.
(int)TemporaryPermissions?.Call("GrantAllGroupsPermission", "realpve.vip", expireDate, assignedDate);//Calling the GrantAllGroupsPermission method with the specified DateTime for the end and start of the temporary permission.
RevokeAllGroupsPermission:
Used to revoke a temporary permission from all groups.
Returns the <int>number of successful revokes of temporary permissions to groups.
To call the RevokeAllGroupsPermission method, you need to pass 1 parameter:
<string>permName - The name of the permission.
(int)TemporaryPermissions?.Call("RevokeAllGroupsPermission", "realpve.vip");
GroupGetAllPermissions:
Used to retrieve all temporary permissions of a group.
Returns a Dictionary<string, DateTime[]> where the key is the permission name and the value is an array of 2 DateTimes: the first date is the assignment date and the second date is the expiration date of the permission.
If the expiration date is set to default, it means the permission is valid until the wipe.
To call the GroupGetAllPermissions method, you need to pass 1 parameter:
<string>groupName - The name of the group.
(Dictionary<string, DateTime[]>)TemporaryPermissions?.Call("GroupGetAllPermissions", "vip");
AllGroupsGetAllPermissions:
Used to retrieve all temporary permissions of all groups that have temporary permissions.
Returns a Dictionary<string, Dictionary<string, DateTime[]>> where the key is the group name and the value is another Dictionary<string, DateTime[]>, where the key is the permission name and the value is an array of 2 DateTimes: the first date is the assignment date and the second date is the expiration date of the permission.
If the expiration date is set to default, it means the permission is valid until the wipe.
(Dictionary<string, Dictionary<string, DateTime[]>>)TemporaryPermissions?.Call("AllGroupsGetAllPermissions");