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

CSS check if space infront is empty?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D.Moder
I uploaded 2 great gameplay plugins here
Join Date: Sep 2009
Location: Sin city
Old 04-04-2015 , 06:02   CSS check if space infront is empty?
Reply With Quote #1

I'm trying to spawn something infront of player and first I have to check if player has clear space infront.
All I know is it invloves using trace hull function, but I have no idea how to use it.
All I need is to check a space with size of 35x35x70 is empty infront of player.
__________________
Creator of COD-Life (Half COD, Half Life)
https://forums.alliedmods.net/showthread.php?t=261162
twitter: @D_Moder_61216

Last edited by D.Moder; 04-05-2015 at 03:41.
D.Moder is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 04-04-2015 , 07:25   Re: CSS check if space infront is empty?
Reply With Quote #2

PHP Code:
bool:traceobject(const Float:origin[3])
{
    const 
35.0;
    const 
35.0;
    const 
70.0;
    
    new 
Float:mins[3], maxs[3];
    
mins[0] = -(x/2);
    
mins[1] = -(y/2);
    
mins[2] = 0.0;
    
maxs[0] = x/2;
    
maxs[1] = y/2;
    
maxs[2] = z;
    
TR_TraceHull(originoriginminsmaxsMASK_SOLID);
    return (
TR_DidHit());

try that
Miu 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 06:33.


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