Raised This Month: $ Target: $400
 0% 

PointContents? What do the numbers mean?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 04-17-2004 , 20:12   PointContents? What do the numbers mean?
Reply With Quote #1

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


OK what does it mean when it returns -1,-2,-6,etc...

I think -1 means its ok, ur in the map,and anything else is bad?

I looked in the HLSDK but couldn't find any constants declared. Can anyone shed some light on this?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-17-2004 , 20:43  
Reply With Quote #2



or in this case... RTFIF... (Read the fucking inc files)

Quote:
Originally Posted by engine_const.inc
#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 /* removed at csg time */
#define CONTENTS_CLIP -8 /* changed to contents_solid */
#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
Also another usefull thingy u can use for contents are

ViewContents(id).. This will get the contents of the point a user is aiming at

and here is a test script

Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("Point At","1.0","AssKicR") } public server_frame() {     for (new id=0;id<=32;id++){         if (is_user_connected(id)) {             new CONTENTS = ViewContents(id)             switch (CONTENTS) {                 case CONTENTS_SKY:          client_print(id,print_center,"You are looking at the sky (CONTENTS_SKY)")                 case CONTENTS_EMPTY:        client_print(id,print_center,"You are not looking at anything (CONTENTS_EMPTY)")                 case CONTENTS_SOLID:        client_print(id,print_center,"You are looking at something solid (CONTENTS_SOLID)")                 case CONTENTS_WATER:        client_print(id,print_center,"You are looking at water (CONTENTS_WATER)")                 case CONTENTS_SLIME:        client_print(id,print_center,"You are looking at slime (CONTENTS_SLIME)")                 case CONTENTS_LAVA:         client_print(id,print_center,"You are looking at lava (CONTENTS_LAVA)")                 case CONTENTS_LADDER:       client_print(id,print_center,"You are looking at a ladder (CONTENTS_LADDER)")                 case CONTENTS_TRANSLUCENT:  client_print(id,print_center,"You are looking at a something translucent (CONTENTS_TRANSLUCENT)")             }         }     } }
__________________
My Plugins

Got ??
AssKicR is offline
IceMouse[WrG]
Senior Member
Join Date: Mar 2004
Old 04-17-2004 , 20:54  
Reply With Quote #3

Negative, AssKicr... Your example will always return CONTENTS_SOLID
Try and guess why

I'll give you a hint: They wouldn't be looking at it
IceMouse[WrG] is offline
Send a message via AIM to IceMouse[WrG] Send a message via MSN to IceMouse[WrG] Send a message via Yahoo to IceMouse[WrG]
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-17-2004 , 20:55  
Reply With Quote #4

Quote:
Originally Posted by IceMouse[WrG
]Negative, AssKicr... Your example will always return CONTENTS_SOLID
Try and guess why

I'll give you a hint: They wouldn't be looking at it
the script is tested IceMouse so ur wrong
__________________
My Plugins

Got ??
AssKicR is offline
IceMouse[WrG]
Senior Member
Join Date: Mar 2004
Old 04-17-2004 , 20:57  
Reply With Quote #5

Then your explanation is incorrect...Using your script, you pass the origin of the user into PointContents. And obviously, if you've

Oh wait

I missed the 3... Sheesh I can't see a thing in Freecode's forum skin
IceMouse[WrG] is offline
Send a message via AIM to IceMouse[WrG] Send a message via MSN to IceMouse[WrG] Send a message via Yahoo to IceMouse[WrG]
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-17-2004 , 20:58  
Reply With Quote #6

hehe... it takes a little getting used to.. btw i simplified the code a little
__________________
My Plugins

Got ??
AssKicR is offline
IceMouse[WrG]
Senior Member
Join Date: Mar 2004
Old 04-18-2004 , 02:06  
Reply With Quote #7

What? Simplified crashing HL? :\ Outputting text on every server frame for every person connected... Sheesh
IceMouse[WrG] is offline
Send a message via AIM to IceMouse[WrG] Send a message via MSN to IceMouse[WrG] Send a message via Yahoo to IceMouse[WrG]
AssKicR
Veteran Member
Join Date: Mar 2004
Location: Norway-Europe(GTM+1)
Old 04-18-2004 , 08:01  
Reply With Quote #8

Quote:
Originally Posted by IceMouse[WrG
]What? Simplified crashing HL? :\ Outputting text on every server frame for every person connected... Sheesh
Well this isn't a plugin that is gonna run on a full 32 player server.... it is merly a test script to see how the function PointContens and ViewContents work
__________________
My Plugins

Got ??
AssKicR is offline
IceMouse[WrG]
Senior Member
Join Date: Mar 2004
Old 04-18-2004 , 12:39  
Reply With Quote #9

;) I know...
IceMouse[WrG] is offline
Send a message via AIM to IceMouse[WrG] Send a message via MSN to IceMouse[WrG] Send a message via Yahoo to IceMouse[WrG]
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 15:59.


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