Raised This Month: $12 Target: $400
 3% 

TF2 blocking player respawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
foon
Member
Join Date: Dec 2018
Old 12-31-2019 , 07:15   TF2 blocking player respawn
Reply With Quote #1

Is there any way to block a player from respawning? I know I can set m_TeamRespawnWaveTimes to something crazy, but that wont work with what I am trying to make. Ive looked around for somthing that I could use but couldnt find anything, maybe my googlefu isnt good enough.

I tried this, but I know it wont do anything since its only blocking the event for the client.
Code:
HookEvent("player_spawn", Event_Player_Spawn, EventHookMode_Pre);

public void Event_Player_Spawn(Event hEvent, const char[] name, bool dontBroadcast)
{
	return;
}

Last edited by foon; 12-31-2019 at 09:54.
foon is offline
MAGNAT2645
Senior Member
Join Date: Nov 2015
Location: AlliedMods.net
Old 12-31-2019 , 07:26   Re: TF2 blocking player respawn
Reply With Quote #2

The thing is that you can't block event execution with HookEvent:
1) You're using EventHookMode_Post which executes after event.
2) Even with EventHookMode_Pre you can't block event from execution. If you return Plugin_Handled (using _Pre mode) you just can block event broadcasting (for example, "player_death" shows top-right label "{NAME1} killed {NAME2}", so you can just block event broadcasting for clients but the event itself will still happen on server-side)

If you really want to somehow block Source-engine events, you need to write your own C++ extension, i think.
__________________

Last edited by MAGNAT2645; 12-31-2019 at 09:05.
MAGNAT2645 is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 12-31-2019 , 07:44   Re: TF2 blocking player respawn
Reply With Quote #3

Use https://sm.alliedmods.net/new-api/sd...oks_TakeDamage
__________________
Ilusion9 is offline
Reply


Thread Tools
Display Modes

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:06.


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