Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement missing Garry's Mod hooks for compatibility #5

Open
luttje opened this issue Jun 6, 2024 · 0 comments
Open

Implement missing Garry's Mod hooks for compatibility #5

luttje opened this issue Jun 6, 2024 · 0 comments

Comments

@luttje
Copy link
Collaborator

luttje commented Jun 6, 2024

Warning

Before implementing a hook, please double-check that isn't a hook called from the Garry's Mod base/sandbox gamemode

Here's a list of hooks in my gamemode, generated by this script. Some hooks may be double, some may be called from Lua (in the base or sandbox gamemode).

  • function GM:Initialize() -- shared

  • function GM:InitPostEntity() -- shared

  • function GM:EntityKeyValue(Entity entity, string key, string value) -- shared

  • function GM:ShutDown() -- shared

  • function GM:GetGameDescription()

  • function GM:CreateTeams()

  • function GM:PreGamemodeLoaded()

  • function GM:PostGamemodeLoaded()

  • function GM:OnGamemodeLoaded()

  • function GM:OnReloaded()

  • function GM:Restored()

  • function GM:Saved()

  • function GM:EntityRemoved(Entity entity)

  • function GM:OnEntityCreated(Entity entity)

  • function GM:NetworkEntityCreated(Entity entity) -- shared

  • function GM:CreateEntityRagdoll( entity, ragdoll) -- server

  • function GM:CreateClientsideRagdoll(Entity entity, Entity ragdoll )

  • function GM:Think() -- shared

  • function GM:Tick()

  • function GM:NetworkIDValidated( name, steamid)

  • function GM:PlayerAuthed(Player client, SteamID, UniqueID)

  • function GM:PlayerPostThink(Player client)

  • function GM:PlayerDisconnected(Player client)

  • function GM:PlayerConnect( name, address)

  • function GM:PlayerSpawn(Player client, transiton)

  • function GM:PlayerInitialSpawn(Player client, transiton)

  • function GM:PlayerSpawnAsSpectator(Player client)

  • function GM:PlayerSetHandsModel(Player client, Entity entity)

  • function GM:PlayerSelectTeamSpawn( TeamID,Player client)

  • function GM:PlayerLoadout(Player client)

  • function GM:IsSpawnpointSuitable(Player client, spawnpointent, bMakeSuitable)

  • function GM:SetupPlayerVisibility( pPlayer, pViewEntity)

  • function GM:PlayerSelectSpawn(Player client, transiton)

  • function GM:PlayerCanJoinTeam(Player client, teamid)

  • function GM:PlayerSetModel(Player client)

  • function GM:PlayerJoinTeam(Player client, teamid)

  • function GM:OnPlayerChangedTeam(Player client, oldteam, newteam)

  • function GM:PlayerFootstep(Player client, vPos, iFoot, strSoundName, fVolume, pFilter)

  • function GM:PlayerStepSoundTime(Player client, iType, bWalking)

  • function GM:SetPlayerSpeed(Player client, walk, run)

  • function GM:PlayerTick(Player client, mv)

  • function GM:PlayerRequestTeam(Player client, teamid)

  • function GM:AddDeathNotice(string attacker, number attackerTeam, string inflictor, string victim, number victimTeam)

  • function GM:DrawDeathNotice(integer x, integer y)

  • function GM:EntityFireBullets(Entity entity, bullets)

  • function GM:HandlePlayerArmorReduction(Player client, dmginfo)

  • function GM:SendDeathNotice( attacker, inflictor, victim, flags)

  • function GM:GetDeathNoticeEntityName(Entity entity)

  • function GM:OnNPCKilled(Entity entity, attacker, inflictor)

  • function GM:ScaleNPCDamage( npc, hitgroup, dmginfo)

  • function GM:PlayerTraceAttack(Player client, dmginfo, dir, trace)

  • function GM:PlayerDeathThink(Player client)

  • function GM:PlayerSilentDeath( Victim)

  • function GM:PlayerDeath(Player client, inflictor, attacker)

  • function GM:ScalePlayerDamage(Player client, hitgroup, dmginfo)

  • function GM:PlayerDeathSound()

  • function GM:CanPlayerSuicide(Player client)

  • function GM:OnDamagedByExplosion(Player client, dmginfo)

  • function GM:OnPlayerHitGround(Player client, bInWater, bOnFloater, flFallSpeed)

  • function GM:EntityTakeDamage(Entity entity, damageInfo) -- server

  • function GM:DoPlayerDeath(Player client, attacker, dmginfo) -- server

  • function GM:PlayerHurt(Player client, attacker, healthleft, healthtaken) -- server

  • function GM:PropBreak(Player attacker, Entity prop)

  • function GM:PlayerNoClip(Player client, state) -- shared

  • function GM:FindUseEntity(Player client, Entity entity)

  • function GM:PlayerSpray(Player client)

  • function GM:PlayerStartTaunt(Player client, actid, length)

  • function GM:PlayerSwitchWeapon(Player client, oldwep, newwep)

  • function GM:PlayerCanPickupItem(Player client, entity)

  • function GM:PlayerCanPickupWeapon(Player client, entity)

  • function GM:PlayerDroppedWeapon(Player client, weapon)

  • function GM:PlayerCanPickupWeapon(Player client, Weapon weapon) -- server

  • function GM:AllowPlayerPickup(Player client, Entity entity) -- server

  • function GM:WeaponEquip(Weapon weapon, Player client) -- server

  • function GM:PlayerSwitchFlashlight(Player client, on) -- server

  • function GM:PlayerShouldTakeDamage(Player client, attacker) -- server

  • function GM:GetFallDamage(Player client, speed) -- server

  • function GM:PlayerCanHearPlayersVoice(Player listener, Player speaker) -- server

  • function GM:PlayerStartVoice(Player client)

  • function GM:PlayerEndVoice(Player client)

  • function GM:PlayerSay(Player client, text) -- server

  • function GM:TranslateActivity(Player client, number act) -- shared

  • function GM:CalcMainActivity(Player client, Vector velocity) -- shared

  • function GM:UpdateAnimation(Player client, Vector velocity, number maxSeqGroundSpeed) -- shared

  • function GM:HandlePlayerJumping(Player client, velocity, plyTable)

  • function GM:HandlePlayerNoClipping(Player client, velocity, plyTable)

  • function GM:HandlePlayerVaulting(Player client, velocity, plyTable)

  • function GM:HandlePlayerDucking(Player client, velocity, plyTable)

  • function GM:HandlePlayerSwimming(Player client, velocity, plyTable)

  • function GM:HandlePlayerLanding(Player client, velocity, WasOnGround)

  • function GM:HandlePlayerDriving(Player client, plyTable)

  • function GM:MouthMoveAnimation(Player client)

  • function GM:DoAnimationEvent(Player client, event, data)

  • function GM:PlayerUse(Player client, Entity entity) -- server

  • function GM:ShowHelp(Player client)

  • function GM:ShowTeam(Player client) -- server

  • function GM:HideTeam() -- client

  • function GM:PreventScreenClicks()

  • function GM:GUIMousePressed(number mouseCode, Vector aimVector)

  • function GM:GUIMouseReleased(number mouseCode, Vector aimVector)

  • function GM:PlayerBindPress(Player client, string bind, bool isPressed, BUTTON_CODE buttonCode) -- client

  • function GM:GUIMouseDoublePressed(MOUSE mouseCode, Vector aimVector) -- client

  • function GM:AdjustMouseSensitivity(float default) -- client

  • function GM:PlayerButtonDown(Player client, BUTTON_CODE buttonCode) -- shared

  • function GM:PlayerButtonUp(Player client, BUTTON_CODE buttonCode) -- shared

  • function GM:KeyRelease(Player client, key) -- shared

  • function GM:KeyPress(Player client, key) -- shared

  • function GM:InputMouseApply(CUserCmd command, number x, number y, Angle angle)

  • function GM:StartCommand(PlayerPlayer client, CUserCmd ucmd) -- shared

  • function GM:Move(Player client, CMoveData moveData) -- shared

  • function GM:CreateMove(CUserCmd command)

  • function GM:ShouldCollide(Entity ent1, Entity ent2) -- shared

  • function GM:FinishMove(Player client, mv)

  • function GM:SetupMove(Player client, mv,CUserCmd command)

  • function GM:GravGunOnDropped(Player client, Entity entity)

  • function GM:GravGunOnPickedUp(Player client, Entity entity)

  • function GM:GravGunPickupAllowed(Player client, Entity entity) -- server

  • function GM:GravGunPunt(Player client, Entity entity) -- shared

  • function GM:PlayerSay(Player client, text, teamonly)

  • function GM:OnPlayerChat(Player client, string text, bool isTeamOnly, bool isDead) -- client

  • function GM:PlayerCanSeePlayersChat( strText, bTeamOnly, pListener, pSpeaker)

  • function GM:StartChat(bool isTeamOnly) -- client

  • function GM:FinishChat() -- client

  • function GM:ChatTextChanged(string text) -- client

  • function GM:OnChatTab(string currentChatText) -- client

  • function GM:ChatText(integer playerIndex, string playerName, string text, string filterType) -- client
    joinleave - Player join and leave messages
    namechange - Player name change messages
    servermsg - Server messages such as convar changes
    teamchange - Team changes?
    chat - (Obsolete?) Player chat? Seems to trigger when server console uses the say command
    none - A fallback value

  • function GM:RenderScreenspaceEffects() -- client

  • function GM:HUDPaint()

  • function GM:PostRenderVGUI()

  • function GM:CalcView(Player client, origin) -- client

  • function GM:HUDWeaponPickedUp(Weapon weapon) -- client

  • function GM:HUDItemPickedUp(string itemName) -- client

  • function GM:HUDAmmoPickedUp(string itemName, amount) -- client

  • function GM:HUDDrawPickupHistory() -- client

  • function GM:HUDShouldDraw(string name) -- client

  • function GM:GetTeamColor(Entity entity) -- client

  • function GM:GetTeamNumColor(integer teamIndex) -- client

  • function GM:HUDPaintBackground() -- client

  • function GM:PostProcessPermitted(string effectClassName) -- client

  • function GM:PreRender()

  • function GM:PostRender() -- client

  • function GM:PostRenderVGUI() -- client

  • function GM:RenderScene(Vector origin, Angle angle, integer fov) -- client

  • function GM:PrePlayerDraw(Player client)

  • function GM:ShouldDrawLocalPlayer(Player client) -- client

  • function GM:PostPlayerDraw(Player client, STUDIO studioFlags)

  • function GM:GetMotionBlurValues(number horizontal, number vertical, number forward, number spin) -- client

  • function GM:PreDrawSkyBox()

  • function GM:PostDrawSkyBox()

  • function GM:PostDraw2DSkyBox()

  • function GM:PreDrawTranslucentRenderables(bool isDrawingDepth, bool isDrawingSkybox, bool isDraw3DSkybox) -- client

  • function GM:PreDrawOpaqueRenderables(bool isDrawingDepth, bool isDrawingSkybox, bool isDraw3DSkybox) -- client

  • function GM:PostDrawOpaqueRenderables(bool isDrawingDepth, bool isDrawingSkybox, bool isDraw3DSkybox) -- client

  • function GM:PostDrawTranslucentRenderables(bool isDrawingDepth, bool isDrawingSkybox, bool isDraw3DSkybox) -- client

  • function GM:PreDrawViewModel(Entity viewModel, Player client, Weapon weapon)

  • function GM:PostDrawViewModel(Entity viewModel, Player client, Weapon weapon)

  • function GM:OnViewModelChanged( vm, old, new)

  • function GM:PreDrawHUD()

  • function GM:PostDrawHUD()

  • function GM:DrawMonitors()

  • function GM:PreDrawEffects()

  • function GM:PostDrawEffects()

  • function GM:PreDrawHalos()

  • function GM:PostDrawHalos()

  • function GM:ScoreboardShow()

  • function GM:ScoreboardHide()

  • function GM:HUDDrawScoreBoard()

  • function GM:DrawOverlay()

  • function GM:HUDDrawTargetID()

-- - [ ] `function GM:CheckPassword( steamid, networkid, server_password, password, name)`
-- - [ ] `function GM:CalcVehicleView(Vehicle vehicle, Player client, table viewTable) -- client`
-- - [ ] `function GM:VehicleMove(Player client, vehicle, mv)`
-- - [ ] `function GM:CheckPassword( steamid, networkid, server_password, password, name)`
-- - [ ] `function GM:PlayerClassChanged(Player client, newID)`
-- - [ ] `function GM:PlayerShouldTaunt(Player client, actid)`
-- - [ ] `function GM:GrabEarAnimation(Player client, plyTable)`
-- - [ ] `function GM:PlayerDriveAnimate(Player client)`
-- - [ ] `function GM:PlayerClassChanged(Player client, newID)`
-- - [ ] `function GM:PlayerShouldTaunt(Player client, actid)`
-- - [ ] `function GM:GrabEarAnimation(Player client, plyTable)`
-- - [ ] `function GM:PlayerDriveAnimate(Player client)`

-- function GM:CloseDermaMenus()
-- function GM:ForceDermaSkin()
-- function GM:OnAchievementAchieved(Player client, achid)

-- function GM:PlayerLeaveVehicle(Player client, Vehicle vehicle) -- server
-- function GM:PlayerEnteredVehicle(Player client, Vehicle vehicle, role)
-- function GM:CanPlayerEnterVehicle(Player client, vehicle, role)
-- function GM:CanExitVehicle( vehicle, passenger)

-- function GM:OnPhysgunPickup(Player client, entity) -- server
-- function GM:OnPhysgunReload(Weapon weapon, client) -- server
-- function GM:PhysgunDrop(Player client, entity) -- shared
-- function GM:PhysgunPickup(Player client, entity) -- shared
-- function GM:DrawPhysgunBeam(Player client, weapon, bOn, target, boneid, pos)
-- function GM:OnPhysgunFreeze( weapon, phys, Entity entity,Player client)
-- function GM:CanPlayerUnfreeze(Player client, entity, physobject)

-- function GM:PlayerUnfrozeObject(Player client, entity, physobject)
-- function GM:PlayerFrozeObject(Player client, entity, physobject)
-- function GM:CanPlayerUnfreeze(Player client, entity, physobject)

-- function GM:PlayerSpawnObject(Player client)
-- function GM:PlayerSpawnProp(Player client, model)
-- function GM:PlayerSpawnEffect(Player client, model)
-- function GM:PlayerSpawnNPC(Player client, npc_type, equipment)
-- function GM:PlayerSpawnRagdoll(Player client, model)
-- function GM:PlayerSpawnSENT(Player client, name)
-- function GM:PlayerSpawnSWEP(Player client, wname, wtable)
-- function GM:PlayerSpawnVehicle(Player client, model, vname, vtable)
-- function GM:PlayerSpawnedEffect(Player client, model, Entity entity)
-- function GM:PlayerSpawnedNPC(Player client, entity) -- server
-- function GM:PlayerSpawnedRagdoll(Player client, model, Entity entity)
-- function GM:PlayerSpawnedSENT(Player client, Entity entity)
-- function GM:PlayerSpawnedSENT(Player client, entity) -- server
-- function GM:PlayerSpawnedSWEP(Player client, Entity entity)
-- function GM:PlayerSpawnedSWEP(Player client, entity) -- server
-- function GM:PlayerSpawnedVehicle(Player client, entity) -- server
-- function GM:PlayerSpawnedProp(Player client, model, Entity entity)
-- function GM:PlayerGiveSWEP(Player client, wname, wtable)
-- function GM:AddHint( name, delay)
-- function GM:SuppressHint( name)

-- function GM:SpawnMenuCreated(spawnmenu)
-- function GM:SpawnMenuEnabled()
-- function GM:SpawnMenuOpen()
-- function GM:SpawnMenuOpened()
-- function GM:SpawnMenuClosed()
-- function GM:ContextMenuEnabled()
-- function GM:ContextMenuOpened()
-- function GM:ContextMenuOpen()
-- function GM:ContextMenuClosed()
-- function GM:ContextMenuCreated()
-- function GM:OnSpawnMenuOpen()
-- function GM:OnSpawnMenuClose()
-- function GM:OnContextMenuClose()
-- function GM:OnContextMenuOpen()

-- function GM:CanTool(Player client, trace, mode, tool, button)
-- function GM:GetSpawnmenuTools( name)
-- function GM:AddSTOOL( category, itemname, text, command, controls, cpanelfunction)
-- function GM:AddGamemodeToolMenuTabs()
-- function GM:AddGamemodeToolMenuCategories()
-- function GM:AddToolMenuCategories()
-- function GM:PreReloadToolsMenu()
-- function GM:PopulateToolMenu()
-- function GM:PostReloadToolsMenu()
-- function GM:AddToolMenuTabs()
-- function GM:PopulatePropMenu()
-- function GM:OnUndo( name, strCustomString)
-- function GM:PostUndo( undo, count)
-- function GM:OnCleanup( name)
-- function GM:UnfrozeObjects( num)
-- function GM:LimitHit( name)

-- function GM:AddNotify( str, type, length)
-- function GM:PaintNotes()
-- function GM:PaintWorldTips()
@luttje luttje changed the title hooks Implement missing Garry's Mod hooks for compatibility Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant