CRole.Register
Registers a custom role.
Syntax
CRole.Register id "display_name" role_type *spawn_system? remove_role_on_death?
Arguments
| Name | Required | Type | Description |
|---|---|---|---|
id | Yes | Text with no spaces e.g. someValue (quotes are not required) | This will be used to identify the role. |
display name | Yes | Any text e.g. "Hello, World!" | |
role type | Yes | RoleTypeId enum value - found using 'serhelp RoleTypeId' command | |
spawn system | No | a reference to CustomRoleSpawnSystem object. | Default: the role will not be spawned automatically |
remove role on death | No | bool (true or false) value | Default: True |
Possible errors
- Display name uses an invalid format.
Validated examples using this method
On a running server
Use serhelp CRole.Register to inspect the reference generated by your installed SER version.