AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   PointContents (https://forums.alliedmods.net/showthread.php?t=6221)

twistedeuphoria 09-24-2004 16:13

PointContents
 
Is this usage correct?
Code:
new Float:origin[3],contents origin = {0.0,0.0,0.0} //just random contents = PointContents(origin)

So contents would equal these numbers?:

Contents Constants

#define CONTENTS_EMPTY -1
#define CONTENTS_SOLID -2
#define CONTENTS_WATER -3
#define CONTENTS_SLIME -4
#define CONTENTS_LAVA -5
#define CONTENTS_SKY -6
#define CONTENTS_ORIGIN -7
#define CONTENTS_CLIP -8
#define CONTENTS_CURRENT_0 -9
#define CONTENTS_CURRENT_90 -10
#define CONTENTS_CURRENT_180 -11
#define CONTENTS_CURRENT_270 -12
#define CONTENTS_CURRENT_UP -13
#define CONTENTS_CURRENT_DOWN -14
#define CONTENTS_TRANSLUCENT -15
#define CONTENTS_LADDER -16

Thanks in advance.

Johnny got his gun 09-24-2004 17:28

Almost. Read the include files for correct syntax:

Code:
/* Will return the contents of a point (inside map? in sky? outside map? etc.). */ native point_contents(Float:fCheckAt[3]);

twistedeuphoria 09-24-2004 18:33

Thanks, but could you explain what CONTENTS_CLIP, the CURRENT ones, and TRANSLUCENT are? Or point me to where to find them.

Freecode 09-24-2004 19:07

try like this

Code:
   new Float:vec[3]    vec[0] = 0.0    vec[1] = 0.0    vec[2] = 0.0    new stuff = point_contents(vec);    if(stuff&CONTENTS_EMPTY)    {       //code here    }

Johnny got his gun 09-24-2004 20:23

I have no idea... float around in spectator mode and do a pointcontent on where you are and see for yourself.

twistedeuphoria 09-25-2004 01:25

Mmm...alright I'll get back to you.

Twilight Suzuka 09-25-2004 09:06

Ooh....I can make a good "is_user_inside" with this...


All times are GMT -4. The time now is 17:11.

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