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

Solved Force observing a team as spectator


Post New Thread Reply   
 
Thread Tools Display Modes
WaLkMaN
Senior Member
Join Date: Oct 2010
Location: Varna, Bulgaria
Old 07-02-2023 , 12:42   Re: Force observing a team as spectator
Reply With Quote #11

I've tested the edited code (with bots) that I gave and I didn't catch this kind of issue.
__________________

Last edited by WaLkMaN; 07-02-2023 at 13:18.
WaLkMaN is offline
pokezao
Member
Join Date: Oct 2014
Old 07-02-2023 , 15:20   Re: Force observing a team as spectator
Reply With Quote #12

Well, can it be because of the "mp_forcechasecam" set to 2?

Another thing I wanted to add is that the code that I posted was effectively working but only with SetHookChainReturn(ATYPE_INTEGER, id). When I used SetHookChainArg(2, ATYPE_INTEGER, id) it was doing the same thing as now (forcing to spectate Terrorists).
Is there a difference between these 2?
pokezao is offline
pokezao
Member
Join Date: Oct 2014
Old 07-03-2023 , 14:09   Re: Force observing a team as spectator
Reply With Quote #13

Quote:
Originally Posted by pokezao View Post
Well, can it be because of the "mp_forcechasecam" set to 2?

Another thing I wanted to add is that the code that I posted was effectively working but only with SetHookChainReturn(ATYPE_INTEGER, id). When I used SetHookChainArg(2, ATYPE_INTEGER, id) it was doing the same thing as now (forcing to spectate Terrorists).
Is there a difference between these 2?
Confirmed! WaLkMaN's code is working but only with SetHookChainReturn(ATYPE_INTEGER, players[currentPlayerId]) instead of SetHookChainArg(2, ATYPE_INTEGER, players[currentPlayerId]).
Can someone see a reason for this?
pokezao is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 07-03-2023 , 16:53   Re: Force observing a team as spectator
Reply With Quote #14

https://amxx-bg.info/api/reapi/SetHookChainArg
lexzor is offline
pokezao
Member
Join Date: Oct 2014
Old 07-03-2023 , 17:40   Re: Force observing a team as spectator
Reply With Quote #15

OMG that's it... I'm registering the hook chain as post: RegisterHookChain(RG_CBasePlayer_Observer_IsValidTarget, "CBasePlayer_Observer_IsValidTarget", 1)

Thank you very much, I'm marking it as solved!
pokezao is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-04-2023 , 06:32   Re: Force observing a team as spectator
Reply With Quote #16

Quote:
Originally Posted by pokezao View Post
OMG that's it... I'm registering the hook chain as post: RegisterHookChain(RG_CBasePlayer_Observer_IsValidTarget, "CBasePlayer_Observer_IsValidTarget", 1)

Thank you very much, I'm marking it as solved!
Always Add Post tag to end of the post forward name so you can tell its a post forward and let it be empty on Pre forward.

That helps with other people reading your code.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-04-2023 at 06:42.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 15:53.


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