GM/FindUseEntity

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Validated and added version locked of the official link from source2013, I honestly doubt +use would change at all between versions)
(Call behaviour)
Line 1: Line 1:
 
{{Hook
 
{{Hook
|Description=This hook polls the entity the player use action should be applied to. The default behavior of this hook is on [https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/shared/baseplayer_shared.cpp#L1068-L1270 CBasePlayer::FindUseEntity()].
+
|Description=This hook polls the entity the player use action should be applied to.
 +
 
 +
{{Note|The default behavior of this hook is on [https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/mp/src/game/shared/baseplayer_shared.cpp#L1068-L1270 CBasePlayer::FindUseEntity]. Despite CBasePlayer::FindUseEntity being defined shared, it is only called serverside in practice, so this hook will be only called serverside, as well. It is possible for modules to call it clientside, so the Lua code should still be treated as shared.}}
 
|Realm=Shared
 
|Realm=Shared
 
|Predicted=No
 
|Predicted=No

Revision as of 09:16, 13 November 2019

 GM:FindUseEntity( )

Contents

Description

This hook polls the entity the player use action should be applied to.

NOTE

The default behavior of this hook is on CBasePlayer::FindUseEntity. Despite CBasePlayer::FindUseEntity being defined shared, it is only called serverside in practice, so this hook will be only called serverside, as well. It is possible for modules to call it clientside, so the Lua code should still be treated as shared.

Arguments

Player ply

The player who initiated the use action.

Arguments

Entity defaultEnt

The entity that was chosen by the engine.

Returns

Entity

The entity to use instead of default entity
Personal tools
Navigation