Raised This Month: $ Target: $400
 0% 

How to check if enemy was killed trough walls?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pob18
Member
Join Date: Jun 2014
Old 07-01-2014 , 14:38   Re: How to check if enemy was killed trough walls?
Reply With Quote #1

Quote:
Originally Posted by Flick3rR View Post
This is your function. All I wanted to say is that you have to be FULLY visible, so is_visible will return possitive result (-> you are visible). If only some part of you is visible, then you are still not visible, and the message will be
"not visible".
Understand.
So isn't possible do what exatly I want
pob18 is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-01-2014 , 15:29   Re: How to check if enemy was killed trough walls?
Reply With Quote #2

If is_visible() isn't working for you, you could also try to fire some traces using the aiming-direction of the killer as the direction vector and then check wether the trace had hit a wall.
mottzi is offline
Send a message via MSN to mottzi
pob18
Member
Join Date: Jun 2014
Old 07-01-2014 , 16:23   Re: How to check if enemy was killed trough walls?
Reply With Quote #3

Would be nice if you show "how to"
pob18 is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 07-01-2014 , 21:22   Re: How to check if enemy was killed trough walls?
Reply With Quote #4

Search the Approved plugins section for No Walls. The plugin prevents players from attacking one another through walls. I've posted an update on the last page - you can get the method from there.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
pob18
Member
Join Date: Jun 2014
Old 07-01-2014 , 23:49   Re: How to check if enemy was killed trough walls?
Reply With Quote #5

Quote:
Originally Posted by hornet View Post
Search the Approved plugins section for No Walls. The plugin prevents players from attacking one another through walls. I've posted an update on the last page - you can get the method from there.
Okay, so now I got what I need.
One more thing, how to check who I'm attacking?

PHP Code:
public CBasePlayer_TraceAttackiVictimiAttackerFloat:flDamageFloat:vDirection], ptrBits )
{
    if( 
get_pcvar_numg_pEnabled ) && iAttacker && get_user_weaponiAttacker ) != CSW_KNIFE )
    {
        static 
Float:vStart], Float:vEnd], Float:flFraction;
        
        
get_tr2ptrTR_vecEndPosvEnd );
        
get_tr2ptrTR_flFractionflFraction );
        
        
xs_vec_mul_scalarvDirection, -1.0vDirection );
        
xs_vec_mul_scalarvDirectionflFraction 9999.0vStart );
        
xs_vec_addvStartvEndvStart );
        
        new 
iTarget trace_lineiVictimvEndvStartvEnd );
        
        if( !
iTarget )
                        
// Show this meesage to the atacker
            
client_print(idprint_chat"You are shooting at %s trough a wall, szVictim")
            
//return HAM_SUPERCEDE;

                      // Show this message to the victim
                      
client_print(idprint_chat"%s is shooting at you trough a wall, szAttacker")

                   
// Show this message when the player killed the victim trought the wall
                   
client_print(0print_chat"%s killed %s trough a wall, szAttacker, szVictim")
    }
    
    return 
HAM_IGNORED;


Last edited by pob18; 07-01-2014 at 23:51.
pob18 is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-02-2014 , 00:23   Re: How to check if enemy was killed trough walls?
Reply With Quote #6

iVictim contains the id of the victim.

That code will defenitely cause an error because the parameters for client_print is included in the text.
__________________

Last edited by Black Rose; 07-02-2014 at 00:23.
Black Rose is offline
pob18
Member
Join Date: Jun 2014
Old 07-02-2014 , 02:57   Re: How to check if enemy was killed trough walls?
Reply With Quote #7

And what is the correctly way to make this?
pob18 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 07-02-2014 , 08:26   Re: How to check if enemy was killed trough walls?
Reply With Quote #8

PHP Code:
client_print(0print_chat"%s killed %s trough a wall, szAttacker, szVictim"
to
PHP Code:
client_print(0print_chat"%s killed %s trough a wall"szAttackerszVictim
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
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 21:13.


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