Skip to content

Natives

Filip Tomaszewski edited this page Sep 28, 2018 · 12 revisions

Contents

Client Interaction ^

Name Description
RTD2_GetClientPerk Returns player's current RTDPerk. Can be used to check if the player is in roll.
RTD2_GetClientPerkTime Returns time in seconds the player has left to the perk end.
RTD2_Force Forces a perk on a player.
RTD2_Roll Rolls a perk with given data.
RTD2_Remove Removes current perk from the client.

Perk Queries ^

Name Description
RTD2_FindPerk Finds a perk by token or ID, where token is prioritized.
RTD2_FindPerks Finds perks by token, ID or tags.

External Perk Management ^

Name Description
RTD2_ObtainPerk Gets a perk by token, or registers one if not found.
RTD2_IsRegOpen Returns whether perks can be registered.
RTD2_DisableModulePerks Disables all the perks that were registered by the plugin this native is called from, and sets all overriden core perks back to the default state.
RTD2_CanPlayerBeHurt A miscellaneous native which returns whether the client can be hurt.

Used by RTDPerk Class ^

Instead of using any of these, you should prefer the ones provided by RTDPerk Class instead.

Name Description
RTD2_GetPerkAny Gets perk property of type any or Handle.
RTD2_SetPerkAny Sets perk property of type any.
RTD2_GetPerkString Gets perk property of type char[].
RTD2_SetPerkString Sets perk property of type char[].
RTD2_SetPerkCall Set the function to call when perk should operate on client.
RTD2_GetPerkPrefCell Gets perk setting of type cell.
RTD2_GetPerkPrefFloat Gets perk setting of type float.
RTD2_GetPerkPrefString Gets perk setting of type char[].
RTD2_SetPerkPref Sets perk property of type char[].
RTD2_Format Format specific perk properties into a buffer.

Deprecated ^

Do not use these ever or your computer will explode.

Name Description Replaced By
RTD2_GetClientPerkId Returns player's current perk index. Meant to check if player is using RTD. RTD_GetClientPerk
RTD2_ForcePerk Forces a perk on a player. RTD2_Force
RTD2_RollPerk Rolls a perk with given data. RTD2_Roll
RTD2_RemovePerk Removes current perk from the client. RTD2_Remove
RTD2_GetPerkOfString Gets the perk's index by either the actual index, perk's token or a single tag. RTD2_FindPerk
RTD2_RegisterPerk Registers a perk from a different plugin to the core. RTD2_ObtainPerk
RTD2_SetPerkByToken Enables/disables perk by token. RTD2_SetPerk*
RTD2_SetPerkById Enables/disables perk by ID. RTD2_SetPerk*
RTD2_DefaultCorePerk Set back perk's call to default one. RTD2_SetPerk*


RTD2_GetClientPerk ^

Returns player's current RTDPerk. Can be used to check if the player is in roll.

RTDPerk.Valid is false if client was not in roll.

RTDPerk RTD2_GetClientPerk(int client)

Parameters

  • int client — Client index.

Returns RTDPerk object.


RTD2_GetClientPerkTime ^

Returns time in seconds the player has left to the perk end.

int RTD2_GetClientPerkTime(int client)

Parameters

  • int client — Client index.

Returns time in seconds if client is using RTD, -1 otherwise.


RTD2_Force ^

Forces a perk on a player.

RTDForceResult RTD2_Force(int client, const char[] sQuery, int iTime=-1, int iInitiator=0)

Parameters

  • int client — Client index.
  • const char[] sQuery — Query string, containing id, token or a tag. If invalid a roll will occur.
  • int iTime — Custom perk's time. -1 = use default.
  • int iInitiator — Entity which initiated forcing the perk.

Returns RTDForceResult enum value.


RTD2_Roll ^

Rolls a perk with given data.

This does not apply the perk to the client.

RTDPerk.Valid is false if no applicable perks are found.

RTDPerk RTD2_Roll(int client, int iRollFlags=ROLLFLAG_NONE, const char[] sFilter="")

Parameters

  • int client — Client index.
  • int iRollFlagsRoll flag definitions.
  • const char[] sFilter — Query by which to filter the applicable perks.

Returns RTDPerk object.


RTD2_Remove ^

Removes current perk from the client.

RTDPerk.Valid is false if client was not in roll.

RTDPerk RTD2_Remove(int client, RTDRemoveReason reason=RTDRemove_WearOff, const char[] sReason="")

Parameters

  • int client — Client index.
  • RTDRemoveReason reasonRTDRemoveReason enum.
  • const char[] sReason — Print custom message if reason=RTDRemove_Custom.

Returns RTDPerk object.



RTD2_FindPerk ^

Finds a perk by token or ID, where token is prioritized.

RTDPerk.Valid is false if no perk was found.

RTDPerk RTD2_FindPerk(const char[] sQuery="")

Parameters

  • const char[] sQuery — Query to search by.

Returns RTDPerk object.


RTD2_FindPerks ^

Finds perks by token, ID or tags.

Will never be null, but might be empty.

Must be freed via delete or CloseHandle().

RTDPerkList RTD2_FindPerks(const char[] sQuery="")

Parameters

  • const char[] sQuery — Query to search by.

Returns RTDPerkList object.