Skip to content

Player Meta

All documented player metatable methods discovered across framework and module source files.

Documented methods: 79  ·  Realm: client, server, shared

Methods


player:__index(key)

Player metatable fallback indexer.

Looks up keys on ax.player.meta, then the base Entity metatable, then the player's entity table.

This keeps Parallax player extensions compatible with standard entity methods and per-player stored fields.

Realm: shared

Parameters

Name Type Description
key any The field or method key being indexed.

Returns

  • any: The resolved value, or nil if no value exists.

Source: gamemode/framework/libraries/thirdparty/dash/sh_player.lua:26


player:AddCurrency(amount, uniqueID, bNoNetworking, recipients)

Adds currency to the active character.

Delegates to Character:AddCurrency and returns the new total.

Returns 0 when the player has no active character.

Realm: shared

Parameters

Name Type Description
amount number The amount to add.
uniqueID string\|nil The unique identifier of the currency. Defaults to the currency module default.
bNoNetworking boolean\|nil When true, suppresses currency networking.
recipients Player\|table\|nil Optional networking recipients.

Returns

  • number: The new currency total, or 0 when no character is active.

Usage

local newTotal = client:AddCurrency(500, "default")

Source: gamemode/modules/currencies/meta/sh_player.lua:65


player:AddMoney(amount, uniqueID, bNoNetworking, recipients)

Adds money to the active character.

Convenience alias that delegates to Character:AddMoney.

Realm: shared

Parameters

Name Type Description
amount number The amount to add.
uniqueID string\|nil Optional currency unique ID for non-default money aliases.
bNoNetworking boolean\|nil Optional flag to disable networking.
recipients Player\|table\|nil Optional specific recipients for networking.

Returns

  • number: The new total amount of money, or 0 if no character is active.

Usage

local newTotal = client:AddMoney(500)

Source: gamemode/modules/currencies/meta/sh_player.lua:157


player:Ban(minutes, bKick, reason, admin, callback)

Creates a Parallax-managed ban for this player.

Overrides Garry's Mod's native Player:Ban so every ban is persisted in ax_bans.

Realm: server

Parameters

Name Type Description
minutes number Ban duration in minutes. Use 0 for permanent.
bKick boolean Whether to kick the player after creating the ban.
reason string Optional ban reason.
admin Player\|nil Optional admin responsible for the ban.
callback function\|nil Optional callback receiving (ok, banData, err).

Source: gamemode/modules/admin/meta/sh_player.lua:67


player:CanMaintainEntityAction(entity, allowEyeTrace, maxDistance)

Returns whether the player is still in a position to maintain an entity interaction.

First checks self:GetUseEntity() — if it equals entity the player is actively looking at it and true is returned immediately.

If allowEyeTrace is true, also checks self:GetEyeTrace() and optionally enforces a maximum distance between the player's shoot position and the trace hit position.

Returns false when the player or entity is invalid, the entity is not being looked at, or the distance limit is exceeded.

Realm: shared

Parameters

Name Type Description
entity Entity The entity the action is being performed on.
allowEyeTrace boolean\|nil When true, also accepts the eye trace as a valid look target.
maxDistance number\|nil Maximum allowed distance to the entity (in world units). Ignored when 0 or nil.

Returns

  • boolean: True if the player can maintain the action, false otherwise.

Source: gamemode/framework/meta/sh_player.lua:900


player:CanSeeZone(identifier)

Check if the player can see a specific zone (PVS/trace).

Realm: shared

Returns

  • boolean: True if player can see the zone

Usage

if client:CanSeeZone("Tower Overlook") then

Source: gamemode/modules/zones/meta/sh_player.lua:92


player:ChatPrint(...)

Prints colored messages to this player's chat box.

On the server, sends a "player.chatPrint" net message containing the arguments; the client-side hook unpacks and passes them to chat.AddText.

On the client, calls chat.AddText directly.

Accepts the same argument format as chat.AddText: alternating Color and string values.

Realm: shared

Parameters

Name Type Description
... Color\|string Alternating color and text arguments forwarded to chat.AddText.

Source: gamemode/framework/meta/sh_player.lua:792


player:ClearForcedSequenceResolution()

Clears this player's cached forced sequence resolution on the client.

Removes the cached sequence ID/duration pair and clears the local sequence.id relay value.

This is called when the sequence identifier becomes invalid or needs to be resolved again for a new model.

Realm: client

Source: gamemode/modules/animations/meta/sh_player.lua:62


player:ClearForcedSequenceResolution()

Stub for clearing forced sequence resolution outside the client realm.

Exists so shared code can safely call ClearForcedSequenceResolution without realm checks.

Realm: server

Source: gamemode/modules/animations/meta/sh_player.lua:124


player:ClearRagdollWeapons()

Clears the stored ragdoll weapon state from this player.

Removes axRagdollWeapons and axRagdollActiveWeapon from the player's entity table.

Called automatically by RestoreRagdollWeapons after weapons are given back, and can be called manually to discard weapon state without restoring.

Realm: server

Source: gamemode/framework/meta/sh_player.lua:292


player:DermaMessage(text, title, buttonName, onClosed)

Opens a Derma message dialog on this player's client.

Sends a "player.dermaMessage" net message with the dialog content.

The optional onClosed callback is stored server-side and invoked when the client acknowledges the dialog.

Useful for non-blocking informational prompts.

Realm: server

Parameters

Name Type Description
text string The body text of the message dialog.
title string The window title.
buttonName string\|nil Label for the dismiss button.
onClosed function\|nil Called when the player closes the dialog.

Source: gamemode/framework/meta/sh_player.lua:715


player:DermaStringRequest(title, subtitle, default, confirm, cancel, confirmText, cancelText)

Opens a Derma string input dialog on this player's client.

Sends a "player.dermaStringRequest" net message to the player with the dialog parameters.

The confirm and cancel callbacks are stored on the player's entity table and invoked when the client responds via the corresponding net handler.

Realm: server

Parameters

Name Type Description
title string The dialog window title.
subtitle string The instructional subtitle shown below the title.
default string\|nil Default text pre-filled in the input box.
confirm function\|nil Called with the entered text when the player confirms.
cancel function\|nil Called when the player cancels or closes the dialog.
confirmText string\|nil Label for the confirm button. Defaults to "OK".
cancelText string\|nil Label for the cancel button. Defaults to "Cancel".

Source: gamemode/framework/meta/sh_player.lua:694


player:DominantZoneHasFlag(flagName, flagValue)

Check if the player's dominant zone has a specific flag.

Realm: shared

Returns

  • boolean: True if dominant zone has the flag

Usage

if client:DominantZoneHasFlag("safe", true) then

Source: gamemode/modules/zones/meta/sh_player.lua:152


player:EnsurePlayer(callback)

Ensures the player has a row in the ax_players database table, creating one if needed.

On the server, issues a SELECT query for the player's SteamID64.

If no row is found, an INSERT is issued with default values for all fields.

In both cases callback(true) is invoked on success; callback(false) is invoked on database error.

If no callback is provided, a debug message is printed instead.

Realm: server

Parameters

Name Type Description
callback function\|nil Called as callback(ok) where ok is true on success, false on error.

Source: gamemode/framework/meta/sh_player.lua:634


player:EnsurePlayer(callback)

Queues a callback to run once this player is ready on the client.

On the client, "ready" means axReady has been set on the player's entity table by the framework initialisation sequence.

If the player is already ready, callback is invoked immediately.

Otherwise it is appended to axEnsureCallbacks and invoked once the ready state is reached.

This is the client-side counterpart to the server's database-backed EnsurePlayer.

Realm: client

Parameters

Name Type Description
callback function\|nil Called as callback(true) when the player is ready.

Source: gamemode/framework/meta/sh_player.lua:733


player:ForceSequence(sequence, callback, time, noFreeze)

Forces this player into a specific animation sequence.

Sets sequence relay data and broadcasts sequence.set so clients play the requested sequence.

When time is nil, waits for a client-authoritative duration resolve before applying timing. Passing nil as sequence resets the current sequence.

Hooks PrePlayerForceSequence and PostPlayerForceSequence are fired around the operation.

Realm: server

Parameters

Name Type Description
sequence string\|number\|nil Sequence name or ID to force, or nil to leave the current sequence.
callback function\|nil Called as callback(client) when the sequence is cleared.
time number\|nil Explicit duration in seconds. Use 0 for a looping sequence.
noFreeze boolean\|nil When true, marks the sequence as frozen in relay data for consumers.

Returns

  • number|nil: The explicit sequence time when provided, otherwise nil while waiting for client resolution.

Usage

client:ForceSequence("idle_all_01", function(client)
    client:Notify("Sequence finished.")
end)

Source: gamemode/modules/animations/meta/sh_player.lua:270


player:GetCharacter()

Returns the character instance currently active for this player.

Reads axCharacter from the player's entity table, which is set when a character is loaded via ax.character:Load().

Returns nil when the player is in the character selection screen or has no character loaded. Aliased as GetChar.

Realm: shared

Returns

  • table|nil: The active character instance, or nil if none is loaded.

Source: gamemode/framework/meta/sh_player.lua:28


player:GetCharacters()

Returns all character instances associated with this player.

Reads axCharacters from the player's entity table, which is populated when the player's characters are fetched from the database on connect.

Returns an empty table when no characters have been loaded yet.

Realm: shared

Returns

  • table: An ordered array of character instances, or {} if none are loaded.

Source: gamemode/framework/meta/sh_player.lua:62


player:GetClassData()

Returns the class definition table for this player's active character's class.

Retrieves the character's class ID via character:GetClass() and looks it up in the class registry via ax.class:Get.

Returns nil when the player has no active character or the character has no class assigned.

Realm: shared

Returns

  • table|nil: The class definition table, or nil if no class is set.

Source: gamemode/framework/meta/sh_player.lua:132


player:GetCurrency(amount, uniqueID)

Returns the active character's amount for a currency.

Delegates to Character:GetCurrency. For backwards compatibility, passing a string as the first argument is treated as uniqueID.

Returns 0 when the player has no active character.

Realm: shared

Parameters

Name Type Description
amount number\|string\|nil Ignored amount placeholder, or the currency unique ID when passed as a string.
uniqueID string\|nil The unique identifier of the currency. Defaults to the currency module default.

Returns

  • number: The amount of the requested currency.

Usage

local credits = client:GetCurrency("credits")

Source: gamemode/modules/currencies/meta/sh_player.lua:22


player:GetCurrentZoneName()

Returns the player's dominant zone name.

Includes physical zones and visible PVS/trace zones.

Realm: shared

Returns

  • string|nil: Zone name or nil

Usage

local zoneName = client:GetCurrentZoneName()

Source: gamemode/modules/zones/meta/sh_player.lua:318


player:GetDistanceToZone(identifier)

Get distance to a specific zone's center/origin.

Realm: shared

Returns

  • number|nil: Distance or nil if zone not found

Usage

local dist = client:GetDistanceToZone("Safe Zone")

Source: gamemode/modules/zones/meta/sh_player.lua:293


player:GetDominantZone()

Get the dominant zone for the player.

Realm: shared

Returns

  • table|nil: The dominant zone spec or nil

Usage

local zone = client:GetDominantZone()

Source: gamemode/modules/zones/meta/sh_player.lua:51


player:GetDominantZoneData(key)

Get a specific data value from the player's dominant zone.

Realm: shared

Returns

  • any: The data value or nil

Usage

local music = client:GetDominantZoneData("music_track")

Source: gamemode/modules/zones/meta/sh_player.lua:184


player:GetFaction()

Returns the player's current faction index, or nil if not in a valid faction.

Reads the player's team index via self:Team() and validates it against the registered faction registry via ax.faction:IsValid.

Returns nil for spectators, players not yet assigned a faction, or indices that don't map to a registered faction.

Realm: shared

Returns

  • number|nil: The faction index, or nil if not in a valid faction.

Source: gamemode/framework/meta/sh_player.lua:109


player:GetFactionData()

Returns the faction definition table for this player's current faction.

Delegates to ax.faction:Get using the result of GetFaction(). Returns nil when the player is not in a valid faction.

Realm: shared

Returns

  • table|nil: The faction definition table, or nil if not in a faction.

Source: gamemode/framework/meta/sh_player.lua:122


player:GetHighestPriorityZone()

Get the highest priority zone the player is in.

This is the first zone returned by GetZones() since they're sorted by priority.

Realm: shared

Returns

  • table|nil: The highest priority zone or nil

Usage

local topZone = client:GetHighestPriorityZone()

Source: gamemode/modules/zones/meta/sh_player.lua:249


player:GetHoldType()

Returns the player's translated animation hold type.

Checks the active weapon, optional Weapon:GetCustomHoldType(client) override, and the GetPlayerHoldType hook before falling back to HOLDTYPE_TRANSLATOR.

Returns "normal" when the player or active weapon is invalid.

Realm: shared

Returns

  • string: The hold type used by the animation system.

Usage

local holdType = client:GetHoldType()

Source: gamemode/modules/animations/meta/sh_player.lua:20


player:GetMoney(uniqueID)

Convenience aliases for the default "default" currency

These methods forward to the character's money methods

Returns the active character's money amount.

Convenience alias that delegates to Character:GetMoney.

Realm: shared

Parameters

Name Type Description
uniqueID string\|nil Optional currency unique ID for non-default money aliases.

Returns

  • number: The amount of money, or 0 if no character is active.

Usage

local money = client:GetMoney()

Source: gamemode/modules/currencies/meta/sh_player.lua:121


player:GetRankData()

Returns the rank definition table for this player's active character's rank.

Retrieves the character's rank ID via character:GetRank() and looks it up in the rank registry via ax.rank:Get.

Returns nil when the player has no active character or the character has no rank assigned.

Realm: shared

Returns

  • table|nil: The rank definition table, or nil if no rank is set.

Source: gamemode/framework/meta/sh_player.lua:149


player:GetSessionPlayTime()

Returns the number of seconds the player has been connected in this session.

Computes os.time() - axJoinTime where axJoinTime is set when the player joins the server.

Returns 0 when axJoinTime has not been set (e.g. before the player has fully initialised).

Realm: shared

Returns

  • number: The number of seconds in the current session, or 0 if unavailable.

Source: gamemode/framework/meta/sh_player.lua:765


player:GetVisibleZones()

Get all visible (PVS/trace) zones for the player.

Realm: shared

Returns

  • table: Array of zone specs with weight field

Usage

local visible = client:GetVisibleZones()

Source: gamemode/modules/zones/meta/sh_player.lua:26


player:GetZoneBlend()

Get the full zone blend state for the player.

Realm: shared

Returns

  • table: Blend state with physical, visible, and dominant fields

Usage

local blend = client:GetZoneBlend()

Source: gamemode/modules/zones/meta/sh_player.lua:34


player:GetZoneCount()

Get the number of zones the player is currently in.

Realm: shared

Returns

  • number: Number of zones

Usage

local count = client:GetZoneCount()

Source: gamemode/modules/zones/meta/sh_player.lua:267


player:GetZoneData(key)

Get a specific data value from any zone the player is in (highest priority).

Realm: shared

Returns

  • any: The data value or nil

Usage

local spawn = client:GetZoneData("spawn_point")

Source: gamemode/modules/zones/meta/sh_player.lua:196


player:GetZoneNames()

Get all zone names the player is currently in.

Realm: shared

Returns

  • table: Array of zone names

Usage

local names = client:GetZoneNames()

Source: gamemode/modules/zones/meta/sh_player.lua:276


player:GetZones()

Get all physical zones the player is currently in.

Realm: shared

Returns

  • table: Array of zone specs, sorted by priority

Usage

local zones = client:GetZones()

Source: gamemode/modules/zones/meta/sh_player.lua:18


player:GetZonesByType(zoneType)

Get all zones of a specific type the player is in.

Realm: shared

Returns

  • table: Array of zone specs

Usage

local boxes = client:GetZonesByType("box")

Source: gamemode/modules/zones/meta/sh_player.lua:230


player:GetZonesWithFlag(flagName, flagValue)

Get all zones the player is in that have a specific flag.

Realm: shared

Returns

  • table: Array of zone specs

Usage

local pvpZones = client:GetZonesWithFlag("pvp", true)

Source: gamemode/modules/zones/meta/sh_player.lua:132


player:GetZoneTracking()

Get the player's zone tracking state.

Realm: shared

Returns

  • table|nil: Tracking state or nil

Usage

local state = client:GetZoneTracking()

Source: gamemode/modules/zones/meta/sh_player.lua:167


player:HasCurrency(amount, uniqueID)

Returns whether the active character has at least the requested currency amount.

Delegates to Character:HasCurrency.

Returns false when the player has no active character.

Realm: shared

Parameters

Name Type Description
amount number The minimum amount required.
uniqueID string\|nil The unique identifier of the currency. Defaults to the currency module default.

Returns

  • boolean: True if the character can afford the amount, false otherwise.

Usage

if ( client:HasCurrency(1000, "default") ) then
    print("Player can afford this")
end

Source: gamemode/modules/currencies/meta/sh_player.lua:105


player:HasDoorAccess(door, actions)

Returns whether this player has access to a door and optional action permissions.

Checks the door's stored Parallax access group for this player and lets CanPlayerAccessDoor override the result.

When actions is provided, the player's access group must include every requested action bit.

Realm: shared

Parameters

Name Type Description
door Entity The door entity to check.
actions number\|nil Bitmask of required MODULE.AccessGroup_Permissions actions. If nil, any non-none access grants permission.

Returns

  • boolean: True if the player has the requested access, false otherwise.

Usage

if ( client:HasDoorAccess(door, MODULE.Permissions.UNLOCK) ) then
    print("Player can perform this door action.")
end

Source: gamemode/modules/doors/meta/sh_player.lua:15


player:HasFactionWhitelist(iFactionID)

Returns whether the player has been whitelisted for a given faction.

Reads the "whitelists" key from the player's data store. Returns true only when the entry for iFactionID is explicitly true.

Returns false when the faction ID is invalid, unregistered, or the player has no whitelist entry for it.

Realm: shared

Parameters

Name Type Description
iFactionID number The numeric faction index to check.

Returns

  • boolean: True if the player is whitelisted for the faction, false otherwise.

Source: gamemode/framework/meta/sh_player.lua:224


player:HasMoney(amount, uniqueID)

Returns whether the active character has at least the requested money amount.

Convenience alias that delegates to Character:HasMoney.

Realm: shared

Parameters

Name Type Description
amount number The amount to check.
uniqueID string\|nil Optional currency unique ID for non-default money aliases.

Returns

  • boolean: True if the character has at least this amount, false otherwise.

Usage

if ( client:HasMoney(1000) ) then
    print("Can afford purchase")
end

Source: gamemode/modules/currencies/meta/sh_player.lua:195


player:InDevMode(iMinLvl)

Returns whether the local client has developer mode enabled at or above a level.

Reads the developer console variable and compares it against iMinLvl.

Realm: client

Parameters

Name Type Description
iMinLvl number\|nil Minimum developer level required. Defaults to 1.

Returns

  • boolean: True if the developer convar is at least the requested level.

Usage

if ( LocalPlayer():InDevMode(2) ) then
    print("Verbose developer tools enabled.")
end

Source: gamemode/framework/meta/sh_player.lua:753


player:InNoclip()

Returns whether the player is currently in noclip mode.

Checks if the player's move type is MOVETYPE_NOCLIP and if they are not drawing their model (as a proxy for being hidden in noclip).

This is more reliable than just checking the move type, as some gamemodes (like DarkRP) set MOVETYPE_NOCLIP when the player is arrested but they are still solid and visible.

Realm: shared

Returns

  • boolean: True if the player is in noclip mode, false otherwise.

Source: gamemode/framework/meta/sh_player.lua:244


player:IsAdmin()

Returns whether this player has administrator access through Parallax usergroups.

Overrides Garry's Mod's native Player:IsAdmin so custom usergroups inheriting from admin are supported.

Realm: shared

Returns

  • boolean: isAdmin Whether the player is an administrator

Source: gamemode/modules/admin/meta/sh_player.lua:32


player:IsInMultipleZones()

Check if the player is in multiple zones.

Realm: shared

Returns

  • boolean: True if in more than one zone

Usage

if client:IsInMultipleZones() then

Source: gamemode/modules/zones/meta/sh_player.lua:258


player:IsInZone(identifier)

Check if the player is in a specific zone.

Realm: shared

Returns

  • boolean: True if player is in the zone

Usage

if client:IsInZone("Safe Zone") then

Source: gamemode/modules/zones/meta/sh_player.lua:72


player:IsInZoneType(zoneType)

Check if the player is in any zone of a specific type.

Realm: shared

Returns

  • boolean: True if in a zone of that type

Usage

if client:IsInZoneType("box") then

Source: gamemode/modules/zones/meta/sh_player.lua:213


player:IsInZoneWithFlag(flagName, flagValue)

Check if the player is in a zone with a specific flag.

Realm: shared

Returns

  • boolean: True if in a zone with the flag

Usage

if client:IsInZoneWithFlag("pvp", true) then

Source: gamemode/modules/zones/meta/sh_player.lua:114


player:IsRagdolled()

Returns whether the player is currently in a ragdolled state.

Reads the "ragdolled" relay key set by SetRagdolled. Returns false when the relay has not been set or has been cleared.

Realm: shared

Returns

  • boolean: True if the player is currently ragdolled, false otherwise.

Source: gamemode/framework/meta/sh_player.lua:252


player:IsSuperAdmin()

Returns whether this player has super administrator access through Parallax usergroups.

Overrides Garry's Mod's native Player:IsSuperAdmin so custom usergroups inheriting from superadmin are supported.

Realm: shared

Returns

  • boolean: isSuperAdmin Whether the player is a super administrator

Source: gamemode/modules/admin/meta/sh_player.lua:47


player:IsWeaponRaised()

Returns whether this player's active weapon is raised.

The global weapon.raise.alwaysraised config and weapons listed in AX_ALWAYS_RAISED always return true.

Otherwise, reads the ax.weapon.raised relay state set by Player:SetWeaponRaised.

Realm: shared

Returns

  • boolean: True if the weapon should be considered raised, false otherwise.

Usage

if ( client:IsWeaponRaised() ) then
    print("Weapon is raised.")
end

Source: gamemode/modules/safety/meta/sh_player.lua:28


player:LeaveSequence()

Clears this player's currently forced animation sequence.

Runs PrePlayerLeaveSequence before clearing state and PostPlayerLeaveSequence after cleanup.

Removes sequence timers, clears all sequence relay values, sends the sequence.reset net message, and invokes any stored completion callback.

Realm: server

Usage

client:LeaveSequence()

Source: gamemode/modules/animations/meta/sh_player.lua:229


player:Nick()

Returns the player's in-character name when a character is active.

Overrides GMod's built-in Nick() method. When the player has an active character (via GetCharacter()), returns character:GetName().

Falls back to the Steam name via the original Nick implementation (GetNickInternal) when no character is loaded (e.g. during character selection).

Realm: shared

Returns

  • string: The character name, or the Steam display name if no character is active.

Source: gamemode/framework/meta/sh_player.lua:45


player:Notify(text, type, length)

Sends a toast notification to this player.

On the server, delegates to ax.notification:Send.

On the client, delegates to ax.notification:Add.

The type parameter controls the notification style (e.g. "error", "success", "info").

length controls display duration in seconds; the notification system applies a default when omitted.

Realm: shared

Parameters

Name Type Description
text string The notification message to display.
type string\|nil The notification type (e.g. "error", "success", "info").
length number\|nil Display duration in seconds.

Source: gamemode/framework/meta/sh_player.lua:809


player:PerformAction(label, duration, onComplete, onCancel, bAllowRagdolled)

Starts or stops a progress action bar for this player.

When label is nil, cancels any running action bar: invokes onCancel if stored, clears the action bar timer, and sends "player.actionbar.stop" to the client.

When label is provided, starts a new action bar by sending "player.actionbar.start" to the client with the label and duration, and stores onComplete/onCancel on the player's entity table.

On the client, delegates to ax.actionBar:Start or ax.actionBar:Stop.

If the player is ragdolled and bAllowRagdolled is not true, a localised error notification is sent and false is returned.

Realm: shared

Parameters

Name Type Description
label string\|nil The action bar label. Pass nil to cancel the active bar.
duration number\|nil The bar duration in seconds. Defaults to 5.
onComplete function\|nil Called when the bar completes without cancellation.
onCancel function\|nil Called when the bar is cancelled before completion.
bAllowRagdolled boolean\|nil When true, allows the action bar while ragdolled.

Returns

  • false|nil: Returns false if blocked due to ragdoll state; nil otherwise.

Source: gamemode/framework/meta/sh_player.lua:851


player:PerformEntityAction(entity, label, duration, onComplete, onCancel, allowEyeTrace, maxDistance)

Starts an action bar that automatically cancels if the player stops looking at an entity.

Creates a repeating 0.1-second timer that calls CanMaintainEntityAction each tick.

If the entity becomes invalid or the player stops meeting the look/distance requirements, the timer is removed and PerformAction(nil) is called to cancel the bar.

The action bar itself is started via PerformAction with the provided parameters.

Realm: shared

Parameters

Name Type Description
entity Entity The entity the player must keep looking at.
label string The action bar label displayed to the player.
duration number The bar duration in seconds.
onComplete function\|nil Called when the bar completes without cancellation.
onCancel function\|nil Called when the bar is cancelled.
allowEyeTrace boolean\|nil When true, the eye trace is also accepted (see CanMaintainEntityAction).
maxDistance number\|nil Maximum allowed distance to the entity. Ignored when nil.

Source: gamemode/framework/meta/sh_player.lua:942


player:PlayGesture(slot, sequence)

Plays a gesture animation in the given layer slot on this player.

On the server, broadcasts a PVS net message so nearby clients execute the gesture.

On the client, resolves a string sequence name to a numeric ID via LookupSequence, caching the result keyed by "modelPath:sequenceName" to avoid repeated lookups on the same model.

The numeric ID is then passed to AddVCDSequenceToGestureSlot.

Returns nil and prints an error when the slot is out of range (0–6) or the player has no active character.

Realm: shared

Parameters

Name Type Description
slot number The gesture layer slot (0–6) to play the animation in.
sequence string\|number The sequence name (string) or sequence ID (number) to play.

Returns

  • nil: Always returns nil on the server (result via net message); nil on error.

Source: gamemode/framework/meta/sh_player.lua:173


player:RemoveTimer(name)

Removes a timer bound to this player.

Removes the timer created with Player:Timer by applying the same SteamID64 prefix to the logical timer name.

Realm: shared

Parameters

Name Type Description
name string The logical timer name to remove for this player.

Source: gamemode/framework/meta/sh_player.lua:100


player:ResolveForcedSequence(sequence)

Resolves a forced sequence identifier to a client-local sequence ID and duration.

Accepts a numeric sequence ID or string sequence name. String names are looked up against the player's current model and cached per model/sequence pair.

Updates the local sequence.id relay value with the resolved ID so animation hooks can consume it.

Realm: client

Parameters

Name Type Description
sequence string\|number\|nil Sequence name or ID. Defaults to the current sequence.identifier relay value.

Returns

  • number|nil: The resolved sequence ID, or nil when no valid sequence exists.
  • number: The resolved sequence duration in seconds, or 0 when unresolved.

Usage

local sequenceID, duration = client:ResolveForcedSequence("idle_all_01")

Source: gamemode/modules/animations/meta/sh_player.lua:77


player:ResolveForcedSequence(sequence)

Stub for resolving forced sequences outside the client realm.

Server timing is either supplied explicitly or resolved by the client through networking, so this always returns nil and 0.

Realm: server

Parameters

Name Type Description
sequence string\|number\|nil Ignored outside the client realm.

Returns

  • nil: Always nil on the server.
  • number: Always 0 on the server.

Source: gamemode/modules/animations/meta/sh_player.lua:133


player:RestoreRagdollWeapons()

Restores all weapons stripped by StripWeaponsForRagdoll.

Iterates the stored weapon data in axRagdollWeapons.

For inventory-backed items that define an Equip method, Equip is called to re-equip them; otherwise the weapon is re-given via self:Give.

Clip sizes and ammo counts are restored after giving.

After all weapons are restored, re-selects the previously active weapon (or ax_hands as a fallback).

Calls ClearRagdollWeapons when done.

Realm: server

Source: gamemode/framework/meta/sh_player.lua:357


player:Save()

Persists all player variables and data to the database.

Constructs a MySQL UPDATE query targeting the ax_players table, filtered by steamid64.

All registered player vars that declare a field in their schema are included; table values are serialised to JSON.

The data blob is always written as JSON.

Falls back to the registered default when a var has no value set.

Call this after any direct modification to axVars that bypasses the standard SetVar / SetData pathway.

Realm: server

Source: gamemode/framework/meta/sh_player.lua:587


player:SetCurrency(amount, uniqueID, bNoNetworking, recipients)

Sets the active character's amount for a currency.

Delegates to Character:SetCurrency and optionally suppresses networking or limits recipients.

Prints a warning and returns nil when the player has no active character.

Realm: shared

Parameters

Name Type Description
amount number The amount to set.
uniqueID string\|nil The unique identifier of the currency. Defaults to the currency module default.
bNoNetworking boolean\|nil When true, suppresses currency networking.
recipients Player\|table\|nil Optional networking recipients.

Usage

client:SetCurrency(1000, "default")

Source: gamemode/modules/currencies/meta/sh_player.lua:45


player:SetFactionWhitelisted(iFactionID, bStatus)

Sets or clears the player's whitelist status for a given faction.

Updates the "whitelists" key in the player's data store.

Setting bStatus to true grants whitelist access; false removes it (the entry is set to nil).

Validates that iFactionID is a registered faction and that bStatus is a boolean before writing.

Prints an error and returns early on invalid input.

Realm: server

Parameters

Name Type Description
iFactionID number The numeric faction index to whitelist or un-whitelist.
bStatus boolean True to grant whitelist access, false to revoke it.

Source: gamemode/framework/meta/sh_player.lua:560


player:SetMoney(amount, uniqueID, bNoNetworking, recipients)

Sets the active character's money amount.

Convenience alias that delegates to Character:SetMoney.

Realm: shared

Parameters

Name Type Description
amount number The amount to set.
uniqueID string\|nil Optional currency unique ID for non-default money aliases.
bNoNetworking boolean\|nil Optional flag to disable networking.
recipients Player\|table\|nil Optional specific recipients for networking.

Usage

client:SetMoney(1000)

Source: gamemode/modules/currencies/meta/sh_player.lua:138


player:SetPos(pos)

Queues a server-side player position update until FinishMove.

Overrides the raw Entity:SetPos behavior for players to avoid Garry's Mod issue #2447 by applying the position during movement finalization.

Realm: server

Parameters

Name Type Description
pos Vector The target world position.

Usage

client:SetPos(spawnPosition)

Source: gamemode/framework/libraries/thirdparty/dash/sh_player.lua:51


player:SetRagdolled(bRagdolled, bForced)

Sets the player's ragdoll state, creating or destroying a ragdoll dummy.

When bRagdolled is true, creates a prop_ragdoll entity at the player's position inheriting the player's model, skin, bodygroups, and materials.

The player is hidden and made non-solid while a repeating timer keeps their position synced to the ragdoll.

Weapons are stripped via StripWeaponsForRagdoll and stored for later restoration.

When bRagdolled is false (or any non-true value), the ragdoll dummy is removed, the player is restored to MOVETYPE_WALK, and RestoreRagdollWeapons is called.

Fires "CanPlayerRagdoll" before creating the ragdoll unless bForced is true;

returning false from the hook prevents ragdolling. Fires "OnPlayerRagdollCreated" after the dummy is spawned.

Returns the ragdoll entity on creation, false if blocked by the hook, or nil on error.

Realm: server

Parameters

Name Type Description
bRagdolled boolean True to ragdoll the player, false (or any non-true value) to un-ragdoll.
bForced boolean\|nil When true, skips the "CanPlayerRagdoll" hook check.

Returns

  • Entity|false|nil: The ragdoll entity, false if blocked by hook, or nil on failure.

Source: gamemode/framework/meta/sh_player.lua:433


player:SetWeaponRaised(bRaised)

Sets whether this player's active weapon is raised.

Updates the ax.weapon.raised relay state, forwards the state to the active weapon when it implements SetWeaponRaised, and fires PlayerWeaponRaised.

Passing nil defaults to true.

Realm: server

Parameters

Name Type Description
bRaised boolean\|nil True to raise the weapon, false to lower it. Defaults to true.

Usage

client:SetWeaponRaised(false)

Source: gamemode/modules/safety/meta/sv_player.lua:20


player:SteamName()

Returns the player's actual Steam display name, bypassing the character name override.

Delegates directly to GetNickInternal (the original GMod Nick method saved before the Parallax override).

Use this when you specifically need the Steam name rather than the in-character name.

Realm: shared

Returns

  • string: The player's Steam display name.

Source: gamemode/framework/meta/sh_player.lua:19


player:StripWeaponsForRagdoll()

Strips all weapons from the player and saves their state for later restoration.

Records each weapon's class, clip counts, ammo counts, and linked inventory item (resolved via GetWeaponInventoryItem).

For inventory-backed weapons that define an Unequip method, that method is called to mark the item as unequipped.

The active weapon class is stored in axRagdollActiveWeapon.

After recording, all weapons are removed via StripWeapons.

Call RestoreRagdollWeapons to re-give them.

Intended to be called as part of the ragdoll creation flow.

Realm: server

Source: gamemode/framework/meta/sh_player.lua:305


player:SyncRelay()

Syncs all relay data to this player.

Iterates ax.relay.data and calls SetRelay for every key/value pair in the "global" scope, then for every per-entity scope whose entity is still valid.

The false third argument to SetRelay suppresses the normal broadcast so each value is sent only to this player rather than all receivers.

Called when the player becomes ready to ensure they receive the full relay state.

Realm: shared

Source: gamemode/framework/meta/sh_player.lua:822


player:TakeCurrency(amount, uniqueID)

Attempts to remove currency from the active character.

Delegates to Character:TakeCurrency and returns whether the removal succeeded.

Returns false when the player has no active character or insufficient funds.

Realm: shared

Parameters

Name Type Description
amount number The amount to remove.
uniqueID string\|nil The unique identifier of the currency. Defaults to the currency module default.

Returns

  • boolean: True if the currency was removed, false otherwise.

Usage

if ( client:TakeCurrency(100, "default") ) then
    print("Purchase successful")
end

Source: gamemode/modules/currencies/meta/sh_player.lua:85


player:TakeMoney(amount, uniqueID)

Attempts to remove money from the active character.

Convenience alias that delegates to Character:TakeMoney.

Realm: shared

Parameters

Name Type Description
amount number The amount to remove.
uniqueID string\|nil Optional currency unique ID for non-default money aliases.

Returns

  • boolean: True if successful, false if no character or insufficient funds.

Usage

if ( client:TakeMoney(100) ) then
    print("Purchase successful")
end

Source: gamemode/modules/currencies/meta/sh_player.lua:176


player:Timer(name, time, reps, callback, failure)

Creates a timer bound to this player.

Prefixes the timer name with the player's SteamID64 so multiple players can safely use the same logical timer name.

Each tick validates that the player is still valid before running callback with the player as its first argument.

If the player becomes invalid, the optional failure callback is invoked and the timer is removed.

Realm: shared

Parameters

Name Type Description
name string The logical timer name to create for this player.
time number Delay in seconds between timer executions.
reps number Number of repetitions, or 0 to repeat indefinitely.
callback function Called as callback(client) while the player remains valid.
failure function\|nil Called if the player becomes invalid before a timer tick can run.

Source: gamemode/framework/meta/sh_player.lua:79


player:ToggleRagdoll(bForced)

Toggles the player's ragdoll state between ragdolled and un-ragdolled.

Reads the current "ragdolled" relay value and calls SetRagdolled with the inverse.

Passes bForced through to skip the "CanPlayerRagdoll" hook check.

Realm: server

Parameters

Name Type Description
bForced boolean\|nil When true, bypasses the "CanPlayerRagdoll" hook.

Source: gamemode/framework/meta/sh_player.lua:548


player:ToggleWeaponRaise()

Toggles this player's weapon raised state.

Reads the current ax.weapon.raised relay value and applies the inverse via SetWeaponRaised.

Realm: server

Usage

client:ToggleWeaponRaise()

Source: gamemode/modules/safety/meta/sv_player.lua:37