Raised This Month: $51 Target: $400
 12% 

If Entity is touched or shot at destroy.


Post New Thread Reply   
 
Thread Tools Display Modes
Elusive138
Senior Member
Join Date: Dec 2010
Old 02-26-2011 , 01:35   Re: If Entity is touched or shot at destroy.
Reply With Quote #11

Nope. If gszCowClass is the entity that was killed, it will always be this. Whatever killed it, and that could be the player or some trigger_hurt or whatever, would be idattacker. Because it doesn't have to be a player that killed it, you should check it with is_user_connected(idattacker).
Elusive138 is offline
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 02-26-2011 , 07:38   Re: If Entity is touched or shot at destroy.
Reply With Quote #12

PHP Code:
RegisterHam(Ham_Killed"info_target""Bacon_Killed");

//...

public Bacon_Killed(iEnt)
{
    if(!
is_valid_ent(iEnt))
        return;

    new 
className[32];
    
entity_get_string(iEntEV_SZ_classnameclassNamecharsmax(className))
    
    if(!
equali(classNamegszCowClass))
        return; 

//Do your stuff here.... 
http://forums.alliedmods.net/showpos...5&postcount=11
__________________
It's a mystery.
Mini_Midget is offline
infek
Senior Member
Join Date: May 2009
Location: Behind you
Old 02-26-2011 , 15:26   Re: If Entity is touched or shot at destroy.
Reply With Quote #13

Thanks mini :]
__________________
"Domo Arigato, Mr. Roboto!"
PM me if you want to know a secret
infek 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 20:36.


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