Group
Handles the creation and editing of player groups
Functions
impulse.Group.ComputeMembers(name, callback)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Computes members for a given group.
Parameters
-
name
string
Name of group.
-
callback
function
Callback function.
impulse.Group.DBAddPlayer(steamid, groupid, rank, callback)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Adds a player into a RP group, this is only the database side! This will not automatically sync to active server! If the player is connected, they will not be added to the group.
Parameters
-
steamid
string
Steam ID 32 of the user.
-
groupid
int
The ID of the group to join.
-
rank
int
optional
The group rank the player will start at.
-
callback
optional
Callback when the database receives all data.
impulse.Group.DBCreate(name, ownerid, maxsize, maxstorage, ranks, callback)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Creates a new RP Group in the database.
Parameters
-
name
string
Group name.
-
ownerid
int
Owners impulse DB Id.
-
maxsize
int
Max players in the group.
-
maxstorage
int
default: true
Max storage, goes unused.
-
ranks
default: true
Ranks within the group.
-
callback
function
optional
optional callback.
impulse.Group.DBPlayerRankShift(groupid, rank, newrank)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Shifts all players of a given rank to a different rank. This will not automatically sync to active server! If any players is connected, they will not be updated in the group.
Parameters
-
groupid
int
The group ID.
-
rank
int
The ID of the rank.
-
newrank
int
The new rank to give the users.
See Also
impulse.Group.DBRemove(groupid)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Deletes the RP group from the database. Searches by the numerical ID.
Parameters
-
groupid
int
The id of the group.
impulse.Group.DBRemoveByName(name)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Deletes the RP group from the database. Searches by the display name. This will not automatically sync to active server!
Parameters
-
name
string
The name of the group.
impulse.Group.DBRemovePlayer(steamid, groupid)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Removes a player from a group, only handles database side. This will not automatically sync to active server! If the player is connected, they will not be removed from the group. FIXME: groupid parameter is unused in the function.
Parameters
-
steamid
string
Steam ID 32 of the user.
-
groupid
int
optional
The ID of the group.
impulse.Group.DBRemovePlayerMass(groupid)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Removes all players from a group, only handles database side. This will not automatically sync to active server! If the players is connected, nobody will not be removed from the group.
Parameters
-
groupid
int
The group ID to remove all players from.
impulse.Group.DBUpdateData(groupid, data)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Updates the group data. You should never run this, it is all handled internally.
Parameters
-
groupid
int
The id of the group.
-
data
table
The data structure.
impulse.Group.DBUpdateMaxMembers(groupid, max)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Updates the max size of the group. You should never run this, it is all handled internally.
Parameters
-
groupid
int
The id of the group.
-
max
int
The new max size of the group.
impulse.Group.DBUpdatePlayerRank(steamid, rank)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Updates the players rank in a group. This will not automatically sync to active server! If the player is connected, they will not be updated in the group.
Parameters
-
steamid
string
Steam ID 32 of the user.
-
rank
int
The ID of the rank.
impulse.Group.DBUpdateRanks(groupid, ranks)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Updates the rank structure of the group. You should never run this, it is all handled internally.
Parameters
-
groupid
int
The id of the group.
-
ranks
table
The rank structure.
impulse.Group.GetDefaultRank(name)
View source »Returns the default rank of a given group, or Member.
Parameters
-
name
string
Group name.
Returns
-
string
Default rank name.
impulse.Group.NetworkMetaData(player, name)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Networks the metadata of a given group to a player.
Parameters
-
player
Entity
The player who will receive the metadata informatiom.
-
name
string
The name of the group.
impulse.Group.NetworkMetaDataToOnline(name)
This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.
Networks the metadata of a given group to all members of the group.
Parameters
-
name
string
The name of the group.
impulse.Group.RankShift(name, rank, newrank)
View source »Shifts all players of a given rank to a different rank.
Parameters
-
name
string
The name of the group.
-
rank
int
The ID of the rank.
-
newrank
int
The new rank to give the users.
impulse.Group.SetMetaData(name, info, col)
View source »Updates the groups metadata.
Parameters
-
name
string
Group name.
-
info
string
Metadata for the group.
-
col
color
The groups color.
Player:GroupHasPermission(act)
View source »Does the player have permission to perform an action for their group.
Parameters
-
act
int
Action enum.
Tables
RPGROUP_Enums
View source »Different permissions that can be assigned to group roles
Fields
-
RPGROUP_DEFAULT
Is default group.
-
RPGROUP_POST
Post to group chat.
-
RPGROUP_ADD_MEMBER
Can add members.
-
RPGROUP_RMV_MEMBER
Can remove members.
-
RPGROUP_MNG_MEMBER
Can promote/demote members.
-
RPGROUP_RANK_EDITOR
Can edit ranks.
-
RPGROUP_INFO_EDITOR
Can edit info page.
-
RPGROUP_OWNER
Is owner of group.