Skip to content

Forwards

Phil25 edited this page Jan 4, 2024 · 7 revisions

Contents

Action Type ^

Name Description
RTD2_CanRollDice Called to determine if the player can use the dice mod.
RTD2_CanForcePerk Called when a perk is about to be forced by an admin on a target.
RTD2_CanRemovePerk Called when a perk is about to be removed by an admin from a target.

Regular ^

Name Description
RTD2_Rolled Called when a perk has just been activated on a player.
RTD2_Removed Called when a perk has just been removed from a player.

External Perk Management ^

Name Description
RTD2_OnRegOpen Called when RTD is ready handle perk registration.


RTD2_CanRollDice ^

Called every client roll to determine if the they can use the dice mod.

sm_forcertd command and RTD2_Force native do not call this.

Action RTD2_CanRollDice(int client)

Parameters

  • int client — Client index.

Return Plugin_Continue to allow, anything else denies access.


RTD2_CanForcePerk ^

Called when a perk is about to be forced by an admin (client) on a target (iTarget).

Called only by sm_forcertd command and RTD2_Force native.

Action RTD2_CanForcePerk(int client, int iTarget, RTDPerk perk)

Parameters

  • int client — Admin client index.
  • int iTarget — Target client index.
  • RTDPerk perkRTDPerk object being forced.

Return Plugin_Continue to allow, anything else denies the force.


RTD2_CanRemovePerk ^

Called when a perk is about to be removed by an admin (client) from a target (iTarget).

Called only by sm_removertd command and RTD2_Remove native.

Action RTD2_CanRemovePerk(int client, int iTarget, RTDPerk perk)

Parameters

  • int client — Admin client index.
  • int iTarget — Target client index.
  • RTDPerk perkRTDPerk object being removed.

Return Plugin_Continue to allow, anything else denies the removal.



RTD2_Rolled ^

Called when a perk has just been activated on a player.

void RTD2_Rolled(int client, RTDPerk perk, int iDuration)

Parameters

  • int client — Client index.
  • RTDPerk perkRTDPerk object.
  • int iDuration — Duration in seconds, -1 if perk has no timer.

RTD2_Removed ^

Called when a perk has just been removed from a player.

void RTD2_Removed(int client, RTDPerk perk, RTDRemoveReason reason)

Parameters

  • int client — Client index.
  • RTDPerk perkRTDPerk object.
  • RTDRemoveReason reasonRTDRemoveReason enum.


RTD2_OnRegOpen ^

Called when the plugin is ready to handle external perk registration.

If your module registers any, RTD2_ObtainPerk() should always be executed in this forward

void RTD2_OnRegOpen()

No parameters