Raised This Month: $ Target: $400
 0% 

Get player touch with different player on death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-15-2013 , 11:19   Re: Get player touch with different player on death
Reply With Quote #1

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(victimkiller)
{
    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(victimEV_VEC_originVecVictimOrigin);
    
entity_get_vector(killerEV_VEC_originVecKillerOrigin);
    
    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 ...

Last edited by didoWEE; 04-15-2013 at 11:20.
didoWEE is offline
FromTheFuture
Senior Member
Join Date: Jan 2013
Old 04-15-2013 , 11:47   Re: Get player touch with different player on death
Reply With Quote #2

Quote:
Originally Posted by didoWEE View Post
Hi. I decided to try to make the check.
Here's the code:

BTW, I don't know if it is working ...
Thank You, I need it, but I want to check who from my team was touching me and I must do it with cycle, it will be hard to server?
Or better will be if I do this with register_touch forward?
FromTheFuture is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:55.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode