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

[Rushblocker] detect which face of a box in fw_touch


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
desten
New Member
Join Date: Jan 2015
Old 01-20-2015 , 19:01   [Rushblocker] detect which face of a box in fw_touch
Reply With Quote #1

Hey, can we detect which face of a box the player have collided with <fakemeta> functions ?

PHP Code:
register_forward(FM_Touch"fw_touch")

public 
fw_touch(entity_toucherentity_touched) {
        if (...)
        {
            
// collide with left face
        
}
        else if (...)
        {
            
// collide with right face
        
}
        else if (...)
        {
            
// collide with front face
        
}
        else if (...)
        {
            
// collide with back face
        
}
        else if (...)
        {
            
// collide with bottom face
        
}
        else if (...)
        {
            
// collide with top face
        
}

// amxmodx-1.8.3-dev-git4537-cstrike-windows
// amxmodx-1.8.3-dev-git4537-base-windows

Thanks.

Last edited by desten; 01-27-2015 at 10:56.
desten is offline
desten
New Member
Join Date: Jan 2015
Old 01-26-2015 , 20:50   Re: [Rushblocker] detect which face of a box in fw_touch
Reply With Quote #2

up
desten is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-27-2015 , 09:11   Re: [Rushblocker] detect which face of a box in fw_touch
Reply With Quote #3

What this box is ? A custom ent created by you ?
__________________
HamletEagle is offline
desten
New Member
Join Date: Jan 2015
Old 01-27-2015 , 10:55   Re: [Rushblocker] detect which face of a box in fw_touch
Reply With Quote #4

Yes

PHP Code:
public CreateZone(Float:position[3], Float:mins[3], Float:maxs[3], zm) {
    new 
entity fm_create_entity("info_target")
    
set_pev(entitypev_classname"walkguardzone")
    
fm_entity_set_model(entity"models/gib_skull.mdl")
    
fm_entity_set_origin(entityposition)
    
set_pev(entitypev_movetypeMOVETYPE_FLY)
    new 
id pev(entityZONEID)
    
set_pev(entitypev_solidSOLID_TRIGGER)
    
fm_entity_set_size(entityminsmaxs)
    
fm_set_entity_visibility(entity0)
    
set_pev(entityZONEIDzm)  
    return 
entity
}

public 
CreateNewZone(Float:position[3])
{
    new 
Float:mins[3] = { -32.0, -32.0, -32.0 }
    new 
Float:maxs[3] = { 32.032.032.0 }
    return 
CreateZone(positionminsmaxs010); // ZM_NONE
}

public 
CreateZoneOnPlayer(player)
{
    new 
Float:position[3]
    
pev(playerpev_originposition)
    
    new 
entity CreateNewZone(position)
    
FindAllZones()
    
    for(new 
0maxzonesi++) if (zone[i] == entityindex i;


Last edited by desten; 01-28-2015 at 19:24.
desten 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 00:18.


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