-
Notifications
You must be signed in to change notification settings - Fork 1
CAU_xChat_fnc_role
Connor edited this page Nov 8, 2020
·
4 revisions
Contains all code required for the role system to work.
- Command: String - keyword used to call the command
Supported Commands:-
create
Argument:
0 : STRING - Name of the role
1 : ARRAY or STRING - RGBA color array or hex code (Optional, default: mention color defined in settings)
2 : ARRAY - Array of unit owner ids to add to the role on creation (Optional, default: [])
Return: NUMBER - New role id, -1 if a role with that name already exists -
delete
Argument: NUMBER - Role ID
Return: BOOL - true if role was successfully deleted -
add
Argument:
0 : NUMBER - Role ID
1 : NUMBER or ARRAY - Owner ID of unit(s) to add to role
Return: BOOL - true if IDs were successfully added -
remove
Argument:
0 : NUMBER - Role ID
1 : NUMBER or ARRAY - Owner ID of unit(s) to remove from role
Return: BOOL - true if IDs were successfully removed -
getAllRoles
Argument: NOTHING
Return: ARRAY - All roles in role data format[role id,name,color,owner ids]
-
getRole
Argument: NUMBER - Role ID
Return: ARRAY - Role data format -
getUnitRoles
Argument: OBJECT - Unit to get roles of
Return: ARRAY - All roles unit is part of in role data format -
getOwnerIDRoles
Argument: NUMBER - Owner ID to get roles of
Return: ARRAY - All roles owner id is part of in role data format
-
["create",["My Role",[0,1,0,1],[clientOwner]]] call CAU_xChat_fnc_role;
// 0
["delete",0] call CAU_xChat_fnc_role;
// true/false
["add",[0,clientOwner]] call CAU_xChat_fnc_role;
["add",[0,[3,4,5]]] call CAU_xChat_fnc_role;
// true/false
["remove",[0,clientOwner]] call CAU_xChat_fnc_role;
["remove",[0,[3,4,5]]] call CAU_xChat_fnc_role;
// true/false
["getAllRoles"] call CAU_xChat_fnc_role;
// [[0,"My Role","#FF00FF00",[3]],...]
["getRole",0] call CAU_xChat_fnc_role;
// [0,"My Role","#FF00FF00",[3]]
["getUnitRoles",player] call CAU_xChat_fnc_role;
// [[0,"My Role","#FF00FF00",[3]],...]
["getOwnerIDRoles",clientOwner] call CAU_xChat_fnc_role;
// [[0,"My Role","#FF00FF00",[3]],...]