Hi. I decided to try to make the check.
Here's the code:
PHP Code:
#include <amxmodx>
#include <engine>
#include <hamsandwich>
public plugin_init()
{
register_plugin("test", "1", "didoWEE");
RegisterHam(Ham_Killed, "player", "HookKill", 1);
}
public HookKill(victim, killer)
{
if(!is_user_connected(killer)) return HAM_IGNORED;
if(!is_user_connected(victim)) return HAM_IGNORED;
new Float:VecVictimOrigin[3];
new Float:VecKillerOrigin[3];
entity_get_vector(victim, EV_VEC_origin, VecVictimOrigin);
entity_get_vector(killer, EV_VEC_origin, VecKillerOrigin);
if(VecVictimOrigin[0] - VecKillerOrigin[0] == 16.0 /* If they touch on X axis */
|| VecKillerOrigin[0] - VecVictimOrigin[0] == 16.0 /* If they touch on X axis */
|| VecVictimOrigin[1] - VecKillerOrigin[1] == 16.0 /* If they touch on Y axis */
|| VecKillerOrigin[1] - VecVictimOrigin[1] == 16.0 /* If they touch on Y axis */
|| VecVictimOrigin[2] - VecKillerOrigin[2] == 72.0 /* If they touch on Z axis, no duck*/
|| VecKillerOrigin[2] - VecVictimOrigin[2] == 72.0 /* If they touch on Z axis, no duck*/
|| VecVictimOrigin[2] - VecKillerOrigin[2] == 54.0 /* If they touch on Z axis, one of them is ducking*/
|| VecKillerOrigin[2] - VecVictimOrigin[2] == 54.0 /* If they touch on Z axis, one of them is ducking*/
|| VecVictimOrigin[2] - VecKillerOrigin[2] == 36.0 /* If they touch on Z axis, they both are ducking*/
|| VecKillerOrigin[2] - VecVictimOrigin[2] == 36.0) /* If they touch on Z axis, they both are ducking*/
{
// do something if they are touching
}
else
{
// do something if they are not touching
}
return HAM_IGNORED;
}
BTW, I don't know if it is working ...