Functions

hamsandwich.inc

Function Type Description
CreateHamItemInfo native Creates an ItemInfo handle. This value should never be altered.
The handle can be used in Get/SetHamItemInfo.

NOTE: You must call FreeHamItemInfo() on every handle made with CreateHamItemInfo().
DisableHamForward native Stops a ham forward from triggering.
Use the return value from RegisterHam as the parameter here!
EnableHamForward native Starts a ham forward back up.
Use the return value from RegisterHam as the parameter here!
ExecuteHam native Executes the virtual function on the entity.
Look at the Ham enum for parameter lists.
ExecuteHamB native Executes the virtual function on the entity, this will trigger all hooks on that function.
Be very careful about recursion!
Look at the Ham enum for parameter lists.
FreeHamItemInfo native Frees an ItemIndo handle created with CreateHamItemInfo(). Do not call
this more than once per handle, or on handles not created through
CreateHamItemInfo().
GetHamItemInfo native Gets a parameter on the fly of the current hook.
Use this on parameters that are iteminfo result handles.
GetHamReturnEntity native Gets the return value of a hook for hooks that return entities.
GetHamReturnFloat native Gets the return value of a hook for hooks that return float.
GetHamReturnInteger native Gets the return value of a hook for hooks that return integers or booleans.
GetHamReturnStatus native Gets the return status of the current hook.
This is useful to determine what return natives to use.
GetHamReturnString native Gets the return value of a hook for hooks that return strings.
GetHamReturnVector native Gets the return value of a hook for hooks that return Vectors.
GetOrigHamReturnEntity native Gets the original return value of a hook for hooks that return entities.
GetOrigHamReturnFloat native Gets the original return value of a hook for hooks that return floats.
GetOrigHamReturnInteger native Gets the original return value of a hook for hooks that return integers or booleans.
GetOrigHamReturnString native Gets the original return value of a hook for hooks that return strings.
GetOrigHamReturnVector native Gets the original return value of a hook for hooks that return Vectors.
IsHamValid native Returns whether or not the function for the specified Ham is valid.
Things that would make it invalid would be bounds (an older module version
may not have all of the functions), and the function not being found in
the mod's hamdata.ini file.
RegisterHam native Hooks the virtual table for the specified entity class.
An example would be: RegisterHam(Ham_TakeDamage, "player", "player_hurt");
Look at the Ham enum for parameter lists.
RegisterHamFromEntity native Hooks the virtual table for the specified entity's class.
An example would be: RegisterHam(Ham_TakeDamage, id, "player_hurt");
Look at the Ham enum for parameter lists.
Note: This will cause hooks for the entire internal class that the entity is
not exclusively for the provided entity.
SetHamItemInfo native Sets a parameter on the fly of the current hook.
Use this on parameters that are iteminfo result handles.
SetHamParamEntity native Sets a parameter on the fly of the current hook. This has no effect in post hooks.
Use this on parameters that are entities.
SetHamParamEntity2 native Sets a parameter on the fly of the current hook. This has no effect in post hooks.
Use this on parameters that are entities.
SetHamParamFloat native Sets a parameter on the fly of the current hook. This has no effect in post hooks.
Use this on parameters that are floats.
SetHamParamInteger native Sets a parameter on the fly of the current hook. This has no effect in post hooks.
Use this on parameters that are integers.
SetHamParamItemInfo native Sets a parameter on the fly of the current hook. This has no effect in post hooks.
Use this on parameters that are trace result handles.
SetHamParamString native Sets a parameter on the fly of the current hook. This has no effect in post hooks.
Use this on parameters that are strings.
SetHamParamTraceResult native Sets a parameter on the fly of the current hook. This has no effect in post hooks.
Use this on parameters that are trace result handles.
SetHamParamVector native Sets a parameter on the fly of the current hook. This has no effect in post hooks.
Use this on parameters that are Vectors.
SetHamReturnEntity native Sets the return value of a hook that returns an entity. Set to -1 for null.
This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
SetHamReturnFloat native Sets the return value of a hook that returns a float.
This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
SetHamReturnInteger native Sets the return value of a hook that returns an integer or boolean.
This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
SetHamReturnString native Sets the return value of a hook that returns a string.
This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
SetHamReturnVector native Sets the return value of a hook that returns a Vector.
This needs to be used in conjunction with HAM_OVERRIDE or HAM_SUPERCEDE.
get_pdata_cbase native This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}.
This requires the mod to have the pev and base fields set in hamdata.ini.
Note this dereferences memory! Improper use of this will crash the server.
This will return an index of the corresponding cbase field in private data.
Returns -1 on a null entry.
get_pdata_cbase_safe native This is similar to the get_pdata_cbase, however it does not dereference memory.
This is many times slower than get_pdata_cbase, and this should only be used
for testing and finding of offsets, not actual release quality plugins.
This will return an index of the corresponding cbase field in private data.
Returns -1 on a null entry. -2 on an invalid entry.
set_pdata_cbase native This is used to compliment fakemeta's {get,set}_pdata_{int,float,string}.
This requires the mod to have the pev and base fields set in hamdata.ini.
This will set the corresponding cbase field in private data with the index.
Pass -1 to null the entry.
RegisterHamPlayer stock Hooks the virtual table for the player class.
An example would be: RegisterHam(Ham_TakeDamage, "player_hurt");
Look at the Ham enum for parameter lists.