Block Player Spawn on NewRound
Just a question.
Can i block player spawn on new round? It tried to return HAM_SUPERCEDE on spawn event but no way. https://forums.alliedmods.net/showpo...16&postcount=6 I can do it with client_silentkill or to transfer to spectate fast and then back but it's weird. So is there any way? |
Re: Block Player Spawn on NewRound
Quote:
|
Re: Block Player Spawn on NewRound
Tried, doesnt work Exolent's code.
|
Re: Block Player Spawn on NewRound
You should hook CHalfLifeMultiplay::FPlayerCanRespawn and make it always return false(OrpheuSetReturn). It's a virtual function, so you can hook it from g_pGameRules object, with orpheu.
https://github.com/Arkshine/CSSDK/bl...ules.cpp#L2599 Here's how the function works:
Spoiler
I was going to say it's enough to set m_iNumSpawns to 1 in HLTV to block players from spawning, but HLTV is fired right before the offset is set to 0 by the game, it will overwrite your value and it won't work. |
Re: Block Player Spawn on NewRound
I need to block respawn only to a specified player. Like
if(is_blocked[id]) return; I don't need to block spawn on connect in first 20 seconds. I want to block respawn every round on specified player and make it stand dead as long as i want. Its like a player which is downloading resources and it shows him dead because he's not connected. Maybe i can set is connecting flags to trick amxx or set him spectate for a while? |
Re: Block Player Spawn on NewRound
This is the solution I gave you, hook CHalfLifeMultiplay::FPlayerCanRespawn, do your checks and alter the return value. The "How it works" part is only what the game is doing.
|
Re: Block Player Spawn on NewRound
Quote:
Can you help me? EDIT : Why to use Orpheu if i can use ham ? https://forums.alliedmods.net/showthread.php?t=191815 |
Re: Block Player Spawn on NewRound
That's something else, it forces the game to spawn the player on first connect, even if not all the conditions I explained above are not met. You want to block players from spawning, or at least this is what I understand from your posts.
Also, orpheu is not c++, you just hook a function(like you do with ham) and add some code. The difference is that ham comes with some predefined functions, while with orpheu you can hook any function. Yeah, I can help you to use orpheu. |
Re: Block Player Spawn on NewRound
Quote:
Can you show me the code needed? |
Re: Block Player Spawn on NewRound
Solved. Here's the solution
PHP Code:
Here "HAM" is not needed because i tested newround , resethud and ham spawn , in which order they go and here's the order: 1.NewRound 2.ResetHUD 3.HamSpawn I think ham_spawn didn't work because it's called after the player's spawn. And here we go. Resethud works nice. Note: Here's also a small bug. After dead flags are set the player doesnt respawn (he's remains dead spectator in his team) but a floating model is respawned. I want to fix that. I'll find and come with an edit but if someone knows how to delete that floating model i'll accept ur help. EDIT: FOUND how to remove that flying model . Code UPDATED! |
| All times are GMT -4. The time now is 18:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.