GM

Hooks

CalcView(ply, origin, angles, fov, znear, zfar)

View source »

Hook called to calculate a player's view.

Parameters

  • origin Vector

    View Origin Position

  • angles Angle

    View Oriign Angle

  • fov number

    Field of View.

  • znear number

    Distance to Near Clip Field

  • zfar number

    Distance to Far Clip Field

See Also

CanEntitySetModel(entity, string)

View source »

Called before an entity has their model set via SetModel

Parameters

  • entity

    Entity that had their model set

  • string

    Model path

CanPlayerInteract(client, entity, data)

View source »

Called when a player attempts to use an interaction

Parameters

  • client Player

    The client that used the interaction

  • entity Entity

    The entity that the interaction was used on

  • data tab

    The data of the interaction used, see interactions for data structure

EntitySetModel(entity, string)

View source »

Called after an entity has their model set via SetModel

Parameters

  • entity

    Entity that had their model set

  • string

    Model path

HUDAmmoPickedUp(_ammo, _amt)

View source »

Hook called when ammo is picked up.

Parameters

  • _amt int

    Amount of ammo picked up.

HUDDrawTargetEntity(ent, class, alpha, x, y)

View source »

Draw a Target HUD for the given entity.

Parameters

  • ent Entity

    Entity to draw target HUD for.

  • class string

    Entity Classname.

  • alpha number

    Current draw alpha value.

  • x number

  • y number

HUDDrawTargetID()

View source »

Hook called to draw the entity under cursor HUD.

HUDItemPickedUp(_name)

View source »

Hook called when an item is picked up.

Parameters

  • _name string

    Name of the item which was picked up.

HUDPaint()

View source »

Called every time the HUD should be painted.

HUDWeaponPickedUp(_w)

View source »

Hook called when a weapon is picked up.

Parameters

InitPostEntity()

View source »

Called when all of the map entities have been initialized.

Initialize()

View source »

Hook called when the gamemode initializes.

PlayerArrest(ply, target)

View source »

Called when a player arrests another player.

Parameters

  • ply Player

    Player who initiated the wakeup.

  • target Player

    Wakeup target.

PlayerCanDemote(ply, target)

View source »

Called when a player attempts to demote another player.

Parameters

  • ply Player

    Player issuing the demotion.

  • target Player

    Player being demoted.

PlayerCanJoinTeam(ply, team)

View source »

Called when a player attempts to join a team.

Parameters

  • ply Player

    Player joining the team.

  • team number

    Team Index

PlayerCanOwnDoor(ply, door)

Deprecated

This function is deprecated and may be removed in a future version.

View source »

Called when a player attempts to own a door.

Parameters

  • ply Player

    The player attempting to own the door.

  • door Entity

    The door being owned.

PlayerCanPromote(ply, target)

Deprecated

This function is deprecated and may be removed in a future version.

View source »

Called when a player attempts to promote another player.

Parameters

  • ply Player

    Player issuing the promotion.

  • target Player

    Player being promoted.

PlayerCanSayLOOC(ply, text)

View source »

Called when a player attempts to say something in local OOC.

Parameters

  • ply Player

    Player attempting to speak in local OOC.

  • text string

    Text being said in local OOC.

PlayerCanSayOOC(ply, text)

View source »

Called when a player attempts to say something in OOC.

Parameters

  • ply Player

    Player attempting to speak in OOC.

  • text string

    Text being said in OOC.

PlayerCanUnwarrant(ply, target)

View source »

Called when a player attempts to unwarrant a player.

Parameters

  • ply Player

    Player issuing the unwarrant.

  • target Player

    Player being unwarranted.

PlayerCanUseCommand(ply, cmd, args)

View source »

Called when attempts to use a command.

Parameters

  • ply Player

    The player attempting to use the command.

  • cmd string

    The command being ran.

  • args tab

    The arguments list of the command being ran.

PlayerCanViewDoor(ply, door)

View source »

Called when a player attempts to view a door.

Parameters

  • ply Player

    The player attempting to view the door.

  • door Entity

    The door being viewed.

PlayerDemote(ply, target, team, reason)

View source »

Called after a player demotes another player.

Parameters

  • ply Player

    Player who issued the demotion.

  • target Player

    Demotion target.

  • team number

    Team the target has been demoted from. test

  • reason string optional

    The reason the player was demoted for.

PlayerHostage(ply, target)

View source »

Called when a player hostage another player.

Parameters

  • ply Player

    Player who initiated the hostage.

  • target Player

    Hostage target.

PlayerInteracted(client, entity, data)

View source »

Called when a player uses an interaction

Parameters

  • client Player

    The client that used the interaction

  • entity Entity

    The entity that the interaction was used on

  • data tab

    The data of the interaction used, see interactions for data structure

PlayerItemAttemptDropped(ply, uid, amount, last, item)

View source »

Called when a player has attempted to drop an item, but is blocked by onDrop.

Parameters

  • ply Player

    Player attempting to drop the item.

  • amount int

    Number of items being dropped.

  • last bool

    If this drop contains the last item of class the player owns.

  • item ITEM

    Item being dropped.

PlayerItemAttemptGave(ply, uid, target, amount, last, item)

View source »

Called when a player has attempted to drop an item, but is blocked by onDrop.

Parameters

  • ply Player

    Player attempting to drop the item.

  • target Player

    Player receiving the items.

  • amount int

    Number of items being dropped.

  • last bool

    If this drop contains the last item of class the player owns.

  • item ITEM

    Item being dropped.

PlayerItemAttemptUsed(ply, uid, item)

View source »

Called when a player has attempted to use an item, but is blocked by onUse.

Parameters

  • ply Player

    Player who attempted the use.

  • item ITEM

    Item being used.

PlayerItemDrop(ply, uid, amount, last, item)

View source »

Called when a player attempts to drop an item.

Parameters

  • ply Player

    Player attempting to drop the item.

  • amount int

    Number of items being dropped.

  • last bool

    If this drop contains the last item of class the player owns.

  • item ITEM

    Item being dropped.

PlayerItemDropped(ply, uid, amount, last, item)

View source »

Called when a player has dropped an item and is having it removed from their inventory.

Parameters

  • ply Player

    Player attempting to drop the item.

  • amount int

    Number of items being dropped.

  • last bool

    If this drop contains the last item of class the player owns.

  • item ITEM

    Item being dropped.

PlayerItemGave(ply, uid, target, amount, last, item)

View source »

Called when a player has given an item.

Parameters

  • ply Player

    Player attempting to give the item.

  • target Player

    Player receiving the items.

  • amount int

    Number of items being dropped.

  • last bool

    If this drop contains the last item of class the player owns.

  • item ITEM

    Item being dropped.

PlayerItemGive(ply, uid, target, amount, last, item)

View source »

Called when a player attempts to give an item.

Parameters

  • ply Player

    Player attempting to give the item.

  • target Player

    Player receiving the items.

  • amount int

    Number of items being given.

  • last bool

    If this give contains the last item of class the player owns.

  • item ITEM

    Item being given.

PlayerItemRemove(ply, uid, item)

View source »

Called when a player attempts to remove an item.

Parameters

  • ply Player

    Player attempting to remove the item.

  • item ITEM

    Item being removed.

PlayerItemRemoved(ply, uid, item)

View source »

Called when a player has removed an item.

Parameters

  • ply Player

    Player who attempted the use.

  • item ITEM

    Item being used.

PlayerItemUse(ply, uid, item)

View source »

Called when a player attempts to use an item.

Parameters

  • ply Player

    Player attempting to use the item.

  • item ITEM

    Item being used.

PlayerItemUsed(ply, uid, item)

View source »

Called when a player has used an item and is having it removed from their inventory.

Parameters

  • ply Player

    Player who attempted the use.

  • item ITEM

    Item being used.

PlayerKnockOut(ply, target)

View source »

Called after a player knocks out another player. test

Parameters

  • ply Player

    Player who initiated the knockout.

  • target Player

    Knockout target.

PlayerKnockedOut(Player, int)

View source »

Called when a player is knocked out for any reason (ragdolled)

Parameters

  • Player

    client The player who has been ragdolled

  • int optional

    |nil Seconds The time in seconds the player is ragdolled for (optional, infinite if nil)

PlayerLocalVarUpdated(key, value)

View source »

Called when a local player variable is updated

Parameters

  • value

    New Value

PlayerSay(ply, text, isTeamChat)

View source »

Called when a player says something.

Parameters

  • ply Player

    Player messaging.

  • text string

    Message being sent.

  • isTeamChat bool

    If the message is intended for a team chat, or globally.

PlayerSpray(ply)

View source »

Called when a player attempts to spray

Parameters

PlayerSwitchFlashlight(ply, on)

View source »

Called when a player switches their flashlight on or off.

Parameters

  • ply Player

    The player switching their flashlight.

  • on bool

    The requested flashlight state.

PlayerUnarrest(ply, target)

View source »

Called when a player unarrests another player.

Parameters

  • ply Player

    Player who initiated the unarrest.

  • target Player

    Unarrest target.

PlayerUnwarrant(ply, target)

View source »

Called when a player unwarrants another player.

Parameters

  • ply Player

    Player who initiated the unwarrant.

  • target Player

    Unwarranted target.

PlayerUse(ply, ent)

View source »

Called when a player attempts to use an entity.

Parameters

  • ply Player

    Player attempting to use the entity.

  • ent Entity

    Entity being used.

PlayerWakeUp(ply, target)

View source »

Called when a player wakes up another player.

Parameters

  • ply Player

    Player who initiated the wakeup.

  • target Player

    Wakeup target.

PlayerWarrant(ply, target, class)

View source »

Called when a player warrants another player.

Parameters

  • ply Player

    Player who initiated the warrant.

  • target Player

    Warrant target.

ScreenResolutionChanged(oldW, oldH)

View source »

Function called when the screen resolution changes.

Parameters

  • oldW int

    Old Screen Width

  • oldH int

    Old Screen Height

StartChat()

View source »

Called when a player begins typing.

Functions

ConnectToDatabase()

View source »

Function to connect to the database.

PlayerCanHearPlayersVoice(listener, talker)

View source »

Check if a player can hear another player's voice.

Parameters

  • listener Player

    The player listening to the talker.

  • talker Player

    The player talking.

Returns

  • bool

    If the talking can be heard.

  • bool

    If we should be using 3d audio.

PlayerCanSayIC(ply, text)

View source »

Called when a player attempts to say something in-character.

Parameters

  • ply Player

    The player talking.

  • text string

    The text being said.

Returns

  • bool

    If the chat is allowed.

PlayerNSAccessor(name, key, iForce, default, readPrefix, optional)

View source »

Add a pair of getter/setters to the player metatable.

Parameters

  • name

  • key

  • iForce

  • default

  • readPrefix

  • optional

PlayerNSReader(name, key, FORCE, default, prefix)

View source »

Add a Getter to the Player metatable.

Parameters

  • name string

    The name to set for the getter.

  • key string

    The NSVar key to read.

  • FORCE int optional

    enum to use.

  • default

    Default value.

  • prefix string

    Prefix to use for the getter, if Get/Is isn't allowable.

PlayerNSWriter(name, key, FORCE)

View source »

Add a Setter to the Player metatable.

Parameters

  • name string

    The name to set for the setter.

  • key string

    The NSVar key to write.

  • FORCE int optional

    enum to use.

Tables

CommandRestrictions

View source »

Dictionary of command restrictions.

Fields

  • sleep

  • wakeup

  • y

  • w

  • hr

  • h

  • help

  • helpr

  • hud

  • me

  • it

  • team

  • afk

Fields

cachedQueries

Deprecated

This function is deprecated and may be removed in a future version.

View source »

A list of cached queries to call.

entities

View source »

A table which holds map-start entities