General

Hooks that can be used in a Plugin or a Schema

Functions

GENERAL:CanEditDoor(ply, door)

Called to decide if a player can edit a door

Parameters

Returns

  • bool

    Can edit

GENERAL:CanPlayerChangeTeam(ply, team)

Called to decide if a player can change team

Parameters

  • team int

    The team to switch to

Returns

  • bool

    Can we switch team?

GENERAL:CanStoreItem(ply, storage, itemclass, from)

Called to decide if a player can store/unstore an item

Parameters

  • storage Entity

    The storage box

  • itemclass string

    The item class

  • from int

    Is this to or from the players inventory?

Returns

  • bool

    Allow the item to be stored or unstored?

GENERAL:CanUseInventory(ply)

Controls wether a player can use their inventory, returning false stops all inventory interaction and stops the inventory from displaying

Parameters

  • ply Entity

    The player that is trying to use their inventory

Returns

  • bool

    Can use inventory

GENERAL:ChatClassMessageSend(chatClass, sender, message)

Called when an chat class message is sent

Parameters

  • chatClass int

    ID of the chat class

Returns

GENERAL:ChatStateChanged(ply, oldState, newState)

Called when a players chat state changes

Parameters

  • oldState boolean

    The old chat state

  • newState boolean

    The new chat state

GENERAL:CheckMenuInput()

Called every tick, use this to check for key presses to open user interface elements (input.IsKeyDown)

GENERAL:ContainerPasscodeSet(ply, container)

Called when a player sets a container passcode

Parameters

  • container Entity

    The container

GENERAL:CreateMenuMessages()

Called when the menu is active and MenuMessages are ready to be created

See Also

GENERAL:CreateSubMenu(identifier)

Called when a new menu panel is opened.

Parameters

  • identifier string

    Submenu identifier.

Returns

  • func

    Panel creation function.

GENERAL:DefineSettings()

Called when you can define settings, all settings you want to define should be done inside this hook

See Also

GENERAL:DisplayMenuMessages()

Internal

This is an internal function! You are able to use it, but you risk unintended side effects if used incorrectly.

Called when the menu is active and MenuMessages are ready to be displayed

See Also

GENERAL:DoInventorySearch(ply, target)

Called when a player inventory searches another player

Parameters

  • ply Entity

    The searcher player

  • target Entity

    The target player

GENERAL:GetDeathSound()

Returns a custom death sound to override the default impulse one

Returns

GENERAL:LoadAnimationClasses()

Called when animation classes have been loaded

GENERAL:OnSchemaLoaded()

Called when the schema has loaded fully

GENERAL:OnSyncUpdate(varID, targetID, any)

Called when a Sync variable is updated

Parameters

  • varID int

    The sync variable ID

  • targetID int

    The entity ID of the target

  • any

    The new value

GENERAL:PlayerAddUserToDoor(ply, owners)

Called when a player adds a user to a door

Parameters

  • owners

    Table of owners

GENERAL:PlayerArrested(convict, officer)

Called when a player is arrested

Parameters

  • convict Entity

    The player that has been arrested

  • officer Entity

    The officer who arrested the player

GENERAL:PlayerBuyablePurchase(ply, buyable)

Called when a player purchases a buyable

Parameters

  • buyable string

    The buyable name

GENERAL:PlayerCanHearCheck(listener, speaker)

Called to check if one player can hear another

Parameters

  • listener Entity

    The player listening

  • speaker Entity

    The player speaking

Returns

  • bool

    Can the listener hear the speaker?

GENERAL:PlayerChangeRPName(ply, name)

Called when a player changes their RP name

Parameters

GENERAL:PlayerConfiscateItem(ply, targ, itemclass)

Called when a player confiscates an item

Parameters

  • ply Entity

    The player who is confiscating

  • targ Entity

    The player who is being targeted

  • itemclass string

    The item class of the confiscated item

GENERAL:PlayerCraftItem(ply, output)

Called when a player crafts an item

Parameters

  • output string

    The item class of the output

GENERAL:PlayerDropDeathItems(ply, killer, pos, dropped, inv)

Called when a player dies, you can drop loot in this hook

Parameters

  • ply Entity

    The player who died

  • pos

    The pos to spawn any droppable items at

  • dropped

    A table of dropped items

  • inv

    The players inventory on death

GENERAL:PlayerDropItem(ply, itemData, invID)

Called when a player drops an item

Parameters

  • itemData

    A table of item data

  • invID int

    The inventory ID of the item

GENERAL:PlayerDropMoney(ply, money)

Called when a player drops money

Parameters

GENERAL:PlayerGetJailData(endTime, jailData)

Called when the local player is sent to jail, provides jail sentence data

Parameters

  • endTime int

    When the jail sentence will end

  • jailData

    Data regarding the sentence including crimes commited

GENERAL:PlayerGetKnownName(ply)

Called to decide what the known name of a player should be

Parameters

  • ply Entity

    The player to get the name of

Returns

GENERAL:PlayerGetXP(ply, xp)

Called when a player gains XP

Parameters

  • xp int

    The amount gained

GENERAL:PlayerInitialSpawnLoaded(ply)

Called when the player has fully loaded into the server after connecting

Parameters

  • ply Entity

    Player who is now fully connected

GENERAL:PlayerOpenStorage(ply, box)

Called when a player opens their storage box

Parameters

  • ply Entity

    The player that has opened their storage

GENERAL:PlayerOpenStorage(ply, storage)

Called when the player accesses their storage container

Parameters

  • ply Entity

    The player who opened their storage

  • storage Entity

    The storage box

GENERAL:PlayerPurchaseDoor(ply, door)

Called when a player purchases a door

Parameters

GENERAL:PlayerRagdollPreSpawn(ragdoll, ply, attacker)

Called before a players death ragdoll spawns

Parameters

  • ragdoll Entity

    The ragdoll entity

  • ply Entity

    The player who died

GENERAL:PlayerSellDoor(ply, door)

Called when a player sells a door

Parameters

GENERAL:PlayerShouldBreakLegs(ply, damage)

Called to decide if a player should break their legs

Parameters

  • damage int

    The fall damage

Returns

  • bool

    Should their legs break?

GENERAL:PlayerShouldGetHungry(ply)

Called to decide if a player should get hungry

Parameters

Returns

  • bool

    Should they get hungry?

GENERAL:PlayerUnArrested(convict, officer)

Called when a player is un-arrested

Parameters

  • convict Entity

    The player that has been un-arrested

  • officer Entity

    The officer who un-arrested the player

GENERAL:PlayerUnJailed(ply)

Called when a player is unjailed

Parameters

GENERAL:PlayerVendorBuy(ply, vendor, itemclass, cost)

Called when a player buys an item from a vendor

Parameters

  • itemclass string

    The item class of the bought item

  • cost int

    The cost of the purchase

GENERAL:PlayerZoneChanged(ply, id)

Called when a player changes zone

Parameters

  • id int

    The new zone ID

GENERAL:PostChatClassMessageSend(chatClass, message, sender)

Called after a chat class message is sent

Parameters

  • chatClass int

    ID of the chat class

GENERAL:PostConfigLoad()

Called after the config has loaded

GENERAL:PostInitPostEntity()

Called after impulse has setup it's entities

GENERAL:PostInventorySetup(ply)

Called after a players inventory has been setup

Parameters

GENERAL:PostSetupPlayer(ply)

Called after a player has been fully setup by impulse

Parameters

GENERAL:PreEarlyInventorySetup(ply)

Called before a players inventory is queried from the database

Parameters

GENERAL:ProcessICChatMessage(sender, message)

Called when an in-character chat message is sent

Parameters

Returns

GENERAL:ProcessOOCMessage(message)

Called when an OOC message is sent

Parameters

GENERAL:RadioMessageFallback(ply, message)

Called when a player tries to use /r or /radio, but is not a CP

Parameters

GENERAL:ShouldDrawHUDBox()

Called after a chat class message is sent

Returns

  • bool

    Should we draw the HUD box?