This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

TF2 - How to check if a player is in the spawn room


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Afronanny
Veteran Member
Join Date: Aug 2009
Old 05-30-2010 , 20:03   TF2 - How to check if a player is in the spawn room
Reply With Quote #1

Does anyone know of a [not-hardcoded-coordinates] way to check whether or not a player is in the spawn room or not?

Last edited by Afronanny; 05-30-2010 at 20:51.
Afronanny is offline
Kevin_b_er
SourceMod Donor
Join Date: Feb 2009
Old 05-30-2010 , 21:28   Re: TF2 - How to check if a player is in the spawn room
Reply With Quote #2

You could try to calculate a set of bounding boxs that correspond to func_respawnroom.

How are these brush entities calculated as being internal vs external? Good question.


Alternatively, if we believe bl4nk and pheadxdll, then around September of last year there was a CFuncRespawnRoom :: PointIsWithin(Vector const&) function which could be used to test if a point were within a given func_respawnroom entity.

The signature for it given in http://forums.alliedmods.net/showthread.php?t=102731 may no longer be valid and is not part of that extension so it was likely not maintained.
__________________
Kevin_b_er is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 05-30-2010 , 21:55   Re: TF2 - How to check if a player is in the spawn room
Reply With Quote #3

Better yet, came across this static function while creating the buildings extension:

PointInRespawnRoom(CBaseEntity *, Vector const&)

It loops through all the respawn rooms and checks them. But it's probably easier to just write that code, instead of having to lookup and maintain a signature to call.
__________________

Last edited by pheadxdll; 05-30-2010 at 21:59.
pheadxdll is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 05-30-2010 , 22:19   Re: TF2 - How to check if a player is in the spawn room
Reply With Quote #4

Quote:
Originally Posted by pheadxdll View Post
Better yet, came across this static function while creating the buildings extension:

PointInRespawnRoom(CBaseEntity *, Vector const&)

It loops through all the respawn rooms and checks them. But it's probably easier to just write that code, instead of having to lookup and maintain a signature to call.
I'm going to try to write a stock for this, but do you know what the CBaseEntity * parameter is for? I'm assuming Vector const& is the point we want to see is in the spawn room or not.
Afronanny is offline
Weenie
Junior Member
Join Date: Sep 2011
Location: Australia
Old 01-20-2012 , 19:48   Re: TF2 - How to check if a player is in the spawn room
Reply With Quote #5

I'm aware this is a huge necropost, but I'm also trying to write something which checks for players in respawn rooms. I can't say I have a huge amount of experience writing SourcePawn (I learn mostly by reading examples of others' work) so if someone could please explain how I'd use "PointInRespawnRoom(CBaseEntity *, Vector const&)" I'd be very grateful.
Weenie 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 21:54.


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