Raised This Month: $ Target: $400
 0% 

[TF2] Is Player In Spawn?


Post New Thread Reply   
 
Thread Tools Display Modes
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 10-02-2014 , 15:36   Re: [TF2] Is Player In Spawn?
Reply With Quote #11

Quote:
Originally Posted by sheo View Post
Uh ddhoward, thanks for that functions, they are exactly that i was looking for. But why TF2Spawn_EnterSpawn(client, spawn) is called every tick while the player stands in the spawn area? 66 times per sec lol.
It's because both instances of this:

PHP Code:
        SDKHook(entitySDKHook_TouchSpawnTouch);
        
SDKHook(entitySDKHook_TouchSpawnStartTouch);
        
SDKHook(entitySDKHook_EndTouchSpawnEndTouch); 
Should instead be this:
PHP Code:
        SDKHook(entitySDKHook_TouchSpawnTouch);
        
SDKHook(entitySDKHook_StartTouchSpawnStartTouch);
        
SDKHook(entitySDKHook_EndTouchSpawnEndTouch); 
This will be fixed sometime today.
__________________

Last edited by ddhoward; 10-02-2014 at 15:36.
ddhoward is offline
sheo
SourceMod Donor
Join Date: Jul 2013
Location: Russia, Moscow
Old 10-03-2014 , 02:53   Re: [TF2] Is Player In Spawn?
Reply With Quote #12

Well, i tried to fix your version and there are thins that i noticed that should be changed:

Why do you use GetForwardFunctionCount? Your code simply does not work, because you don`t call Call_StartForward, but push cells to it.

You don`t need SDKHook_Touch at all. SDKHook_StartTouch paired with SDKHook_EndTouch is enough and works fine in any case (teleporting, spawning not in spawn area)

"teamplay_round_start" is not a good point to find a spawn room entity, because in TF2 this event is not the only one for round starts. OnEntityCreated is not that expensive to avoid using it. Or just list all round start events. (teamplay_round_stalemate, arena_round_start)
__________________

Last edited by sheo; 10-03-2014 at 02:55.
sheo is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 10-03-2014 , 06:25   Re: [TF2] Is Player In Spawn?
Reply With Quote #13

Quote:
Why do you use GetForwardFunctionCount?
So I do not start a call that is not needed.

Quote:
Your code simply does not work, because you don`t call Call_StartForward, but push cells to it.
Whoops.

Quote:
You don`t need SDKHook_Touch at all. SDKHook_StartTouch paired with SDKHook_EndTouch is enough and works fine in any case (teleporting, spawning not in spawn area)
It does not work in the rare event that some map maker created two overlapping func_respawnroom entities. Although yeah, it's really not my responsibility to be cleaning up after bad map makers...

Quote:
"teamplay_round_start" is not a good point to find a spawn room entity, because in TF2 this event is not the only one for round starts.
I have used this and only this event for all my entity hooking in several plugins, and no one seems to have ever complained about something not working. I will look into this in the coming days.

Quote:
OnEntityCreated is not that expensive to avoid using it.
Then enable the cvar lol.

Plugin has been updated. For the sake of consistency with native and forward names, the new version breaks compatibility with previous versions, as the TF2_IsInSpawn() has been renamed to TF2Spawn_IsClientInSpawn(). Will be updating the first post shortly.
__________________
ddhoward is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 01-21-2018 , 22:50   Re: [TF2] Is Player In Spawn?
Reply With Quote #14

Updated to 18.0121.0. Updated to new syntax, fixed download and update URLs, etc.
__________________

Last edited by ddhoward; 01-21-2018 at 22:51.
ddhoward 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:22.


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