Force observing a team as spectator
Hi, I want to force non-admin Spectators to only spectate CT players in a Hide'n'Seek day (Jailbreak mod).
What I'm doing right now is hooking CBasePlayer_Observer_IsValidTarget and doing this: PHP Code:
PS: Another thing to note is that I'm changing "mp_forcechasecam" to 2 only in HNS day, normally it is set to 0. |
Re: Force observing a team as spectator
learn to use get_players instead looping the player entity
|
Re: Force observing a team as spectator
Does that solve my problem?
I'm only doing as suggested here: https://forums.alliedmods.net/showpo...50&postcount=2 |
Re: Force observing a team as spectator
use this as an example: https://amxx-bg.info/forum/viewtopic.php?f=18&t=1009
use flags parameters from get_players to get only ct team players, it's a better practice than loop every entity from the map |
Re: Force observing a team as spectator
I appreciate your help, but that's not the problem here.
This code is working if the observing player is in a team (T or CT) but, for some reason, doesn't work for Spectators. I'm only interested in knowing why and what I can do to force ALL players, including spectators, to spectate only the CT team. |
Re: Force observing a team as spectator
there.....
PHP Code:
|
Re: Force observing a team as spectator
where is used "bSameTeam"? xd
cs_get_user_team(iPlayerIndex) = cs_get_user_team(iTarget) ? |
Re: Force observing a team as spectator
Quote:
Code:
|
Re: Force observing a team as spectator
I have yet to test it but I trust it's working perfectly!
Just to understand: the problem was that I was not returning "false" on bSameTeam? Or it has something to do with the PDATA_SAFE thingy? I deduce that this PDATA_SAFE condition is just a way to check if iTarget is a player, right? Thank you very much Natsheh for the correct solution, and WaLkMaN for the small edit! :fox: |
Re: Force observing a team as spectator
Guys, for some reason it is working but exactly the opposite of what it should: we can only spectate Terrorists and not CTs
|
All times are GMT -4. The time now is 16:52. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.