Raised This Month: $ Target: $400
 0% 

Catch when player touches a wall which blocks you


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 12-29-2010 , 15:54   Re: Catch when player touches a wall, but not the floor
Reply With Quote #5

Quote:
Originally Posted by ConnorMcLeod View Post
Why do you want to detect that ?
I'm doing something like l4d's charger infected. The only thing that I want to do is to catch when while charging he touches a wall for stopping his speed boost.

Another good way that I was thinking is to detect if something is in front of him... but this didn't worked at all:

PHP Code:
register_touch("player""*""fw_Player_Touch")
public 
fw_Player_Touch(iIdiOther)
{
    if(
g_bIsAlive[iId] && g_bBoostActivated[iId] && !IsAlive(iOther))
    {
        
// debug print added here, it's called correctly.
        
static Float:vecOrigin[3], Float:vecDirection[3]
        
entity_get_vector(iIdEV_VEC_originvecOrigin)
        
velocity_by_aim(iId16vecDirection// a little bit ahead him
        
xs_vec_add(vecOriginvecDirectionvecOrigin)
        
        
engfunc(EngFunc_TraceHullvecOriginvecOrigin0HULL_HUMAN /* or HULL_HEAD? */iId0)
    
        if(
get_tr2(0TR_StartSolid) || get_tr2(0TR_AllSolid) || !get_tr2(0TR_InOpen))
        {
                
// Disabling...
        
}
    }

__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
 



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 01:57.


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