Just to say one more thing:
in hamsandwich the offsets are relative to the hooked class. So the offset can be mixed for entities. Since the ResetMaxSpeed is 69 we can use another offset with the same value supposed to be used for another entity. It's not a good practice to do this but is better than nothing:
PHP Code:
new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame
Example:
PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#define PLUGIN "New Plugin"
#define AUTHOR "Unknown"
#define VERSION "1.0"
new Ham:Ham_Player_ResetMaxSpeed = Ham_Item_PreFrame
new maxSpeedFactorCvar
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
RegisterHam(Ham_Player_ResetMaxSpeed,"player","playerResetMaxSpeed",1)
maxSpeedFactorCvar = register_cvar("maxspeed_factor","50.0")
}
public playerResetMaxSpeed(id)
{
static Float:maxspeed
pev(id,pev_maxspeed,maxspeed)
if(maxspeed != 1.0)
{
set_pev(id,pev_maxspeed,maxspeed + get_pcvar_float(maxSpeedFactorCvar))
}
}
__________________