Added support for different speed methods, defaulted to prop method now. If you don't want to update class settings, use 'zr_classes_speed_method lmv' for backwards compatibility.

This commit is contained in:
Richard Helgeby
2010-07-04 17:58:27 +02:00
parent 4b693385fc
commit eab2333309
12 changed files with 325 additions and 39 deletions

View File

@ -58,16 +58,47 @@ enum SDKHookType
SDKHook_WeaponCanUse,
SDKHook_WeaponDrop,
SDKHook_WeaponEquip,
SDKHook_WeaponSwitch,
SDKHook_ShouldCollide,
SDKHook_PreThinkPost,
SDKHook_PostThinkPost,
SDKHook_ThinkPost
};
/*
Alphabetized for easy readability
SDKHook_EndTouch
SDKHook_FireBulletsPost
SDKHook_OnTakeDamage
SDKHook_OnTakeDamagePost
SDKHook_PreThink
SDKHook_PreThinkPost
SDKHook_PostThink
SDKHook_PostThinkPost
SDKHook_SetTransmit
SDKHook_ShouldCollide
SDKHook_Spawn
SDKHook_StartTouch
SDKHook_Think
SDKHook_ThinkPost
SDKHook_Touch
SDKHook_TraceAttack
SDKHook_TraceAttackPost
SDKHook_WeaponCanSwitchTo
SDKHook_WeaponCanUse
SDKHook_WeaponDrop
SDKHook_WeaponEquip
SDKHook_WeaponSwitch
}
*/
funcenum SDKHookCB
{
// PreThink
// PostThink
// PreThink/Post
// PostThink/Post
public(client),
// Spawn
// Think
// Think/Post
public(entity),
// EndTouch
// StartTouch
@ -90,8 +121,10 @@ funcenum SDKHookCB
// TraceAttack
Action:public(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup),
// TraceAttackPost
public(victim, attacker, inflictor, Float:damage, damagetype, ammotype, hitbox, hitgroup)
}
public(victim, attacker, inflictor, Float:damage, damagetype, ammotype, hitbox, hitgroup),
// ShouldCollide
Action:public(entity, &collisiongroup, &contentsmask, &bool:result)
};
/**
@ -138,6 +171,16 @@ forward Action:OnLevelInit(const String:mapName[], String:mapEntities[2097152]);
*/
native SDKHook(entity, SDKHookType:type, SDKHookCB:callback);
/**
* @brief Hooks an entity
*
* @param entity Entity index
* @param type Type of function to hook
* @param callback Function to call when hook is called
* @return bool Hook Successful
*/
native bool:SDKHookEx(entity, SDKHookType:type, SDKHookCB:callback);
/**
* @brief Unhooks an entity
*
@ -164,4 +207,4 @@ public Extension:__ext_sdkhooks =
#else
required = 0,
#endif
};
};