AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   CSS check if space infront is empty? (https://forums.alliedmods.net/showthread.php?t=260977)

D.Moder 04-04-2015 06:02

CSS check if space infront is empty?
 
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.

Miu 04-04-2015 07:25

Re: CSS check if space infront is empty?
 
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


All times are GMT -4. The time now is 06:04.

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