Docs: STRaidKit Redux Rewrite


Custom functions and hooks included in STRaidKit Redux Rewrite

- - - - -

Functions


ENTITY.AddCap - sv

void ENTITY:AddCap()

Adds 1 point to the capture progress of the point.

Available on st_teamcontrolpoint, st_controlpoint2.

WARNING: This value is not clamped.


ENTITY.ClaimerNear - sv

boolean ENTITY:ClaimerNear()

Returns whether or not an owner of the point is within 250 units of the point.

Available on st_teamcontrolpoint, st_controlpoint2.


ENTITY.GetClaimer - sv/cl

Player|number ENTITY:GetClaimer()

Returns the player that currently owns the point.

For unowned Control Points, this will return a NULL Entity.

For unowned Team Control Points, this will return -1.

Available on st_teamcontrolpoint, st_controlpoint2.


ENTITY.GetClaimNum - sv/cl

number ENTITY:GetClaimNum()

Returns the current capture progress for the control point.

Available on st_teamcontrolpoint, st_controlpoint2.


ENTITY.GetClaimTime - sv/cl

number ENTITY:GetClaimTime()

Returns how often the control point gets a progress point added to it.

Available on st_teamcontrolpoint, st_controlpoint2.


ENTITY.GetLocationName - sv/cl

string ENTITY:GetLocationName()

Returns the name of the control point.

Available on st_teamcontrolpoint, st_controlpoint2.


ENTITY.GetRaider - sv/cl

Player|number ENTITY:GetRaider()

Returns the player that is currently capturing the point.

For uncontested Control Points, this will return a NULL Entity.

For uncontested Team Control Points, this will return -1.

Available on st_teamcontrolpoint, st_controlpoint2.


ENTITY.NoCap - sv

void ENTITY:NoCap()

Sets the capture progress of the point to 0.

Available on st_teamcontrolpoint, st_controlpoint2.


ENTITY.RaiderNear - sv

boolean ENTITY:RaiderNear()

Returns whether or not a raider of the point is within 250 units of the point.

A raider is someone who is attempting to capture the point.

Available on st_teamcontrolpoint, st_controlpoint2.


ENTITY.SetClaimer - sv/cl

void ENTITY:SetClaimer( Player|number newOwner )

Sets the current owner of the control point.

Control Points expect a valid player entity.

Team Control Points expect a number corresponding to an existing team.

Available on st_teamcontrolpoint, st_controlpoint2.

WARNING: You probably shouldn't use this unless you know what you're doing.


ENTITY.SetClaimNum - sv/cl

void ENTITY:SetClaimNum( number progress )

Sets the current capture progress for the control point.

Available on st_teamcontrolpoint, st_controlpoint2.

WARNING: You probably shouldn't use this unless you know what you're doing.


ENTITY.SetClaimTime - sv/cl

void ENTITY:SetClaimTime( number rate )

Sets how often the control point gets a progress point added to it.

Available on st_teamcontrolpoint, st_controlpoint2.

INFO: This can more easily be used by an admin holding their +walk bind and using the control point.


ENTITY.SetLocationName - sv/cl

void ENTITY:SetLocationName( string name )

Sets the name of the control point.

Available on st_teamcontrolpoint, st_controlpoint2.

INFO: This can more easily be used by an admin holding their +walk bind and using the control point.


ENTITY.SetRaider - sv/cl

void ENTITY:SetRaider( Player|number newCapturer )

Sets the current capturer of the control point.

Control Points expect a valid player entity.

Team Control Points expect a number corresponding to an existing team.

Available on st_teamcontrolpoint, st_controlpoint2.

WARNING: You probably shouldn't use this unless you know what you're doing.


ENTITY.SubCap - sv

void ENTITY:SubCap()

Subtracts 1 point from the capture progress of the point.

Available on st_teamcontrolpoint, st_controlpoint2.

INFO: This value is clamped between 0 and 100.


Hooks


STRKRR_OnStartCapture - sv

hook.Add( "STRKRR_OnStartCapture", "...", function( Entity point, Player capturer ) )

Called when a player (capturer) tries taking a Control Point (point).

Return false in this hook to prevent the capture from starting.


STRKRR_OnStartTeamCapture - sv

hook.Add( "STRKRR_OnStartTeamCapture", "...", function( Entity point, table teamPlayers, number teamNum, Player capturer ) )

Called when a player (capturer) tries taking a Team Control Point (point).

teamPlayers contains all of the players on team teamNum, which is the team of the capturer.

Return false in this hook to prevent the capture from starting.


STRKRR_PointCaptured - sv

hook.Add( "STRKRR_PointCaptured", "...", function( Entity point, Player capturer ) )

Called when a player (capturer) successfully captures a Control Point (point).


STRKRR_PointLost - sv

hook.Add( "STRKRR_PointLost", "...", function( Entity point, Player owner, Player capturer ) )

Called when a point (point) is lost by its owner (owner) to a capturer (capturer).

Use the team library to access team members.


STRKRR_TeamPointCaptured - sv

hook.Add( "STRKRR_TeamPointCaptured", "...", function( Entity point, table teamPlayers, Player capturer ) )

Called when a player (capturer) successfully captures a Control Point (point).

teamPlayers contains all of the players on the capturer's team.


STRKRR_TeamPointLost - sv

hook.Add( "STRKRR_TeamPointLost", "...", function( Entity point, number teamOwner, number teamCapturer ) )

Called when a point (point) is lost by its owner (teamOwner) to a capturer (teamCapturer).

Use the team library to access team members.