Skip to main content

CRole.SetCallbacks

Sets the callbacks for a provided custom role.

Syntaxโ€‹

CRole.SetCallbacks custom_role on_spawning? on_removing?

Argumentsโ€‹

NameRequiredTypeDescription
custom roleYesCustom role id e.g. myCustomRole
on spawningNoA name of a function defined above e.g. MyFunction. It has to have these arguments: @player *roleThis will be called when a player is being spawned with this role.
on removingNoA name of a function defined above e.g. MyFunction. It has to have these arguments: @player *roleThis will be called when this role is being taken away from a player.

On a running serverโ€‹

Use serhelp CRole.SetCallbacks to inspect the reference generated by your installed SER version.