Raised This Month: $ Target: $400
 0% 

Module: Admin Free Look


Post New Thread Reply   
 
Thread Tools Display Modes
jim_yang
Veteran Member
Join Date: Aug 2006
Old 09-14-2011 , 22:16   Re: Module: Admin Free Look
Reply With Quote #61

I figured out an alternative way to do this stuff in linux using Orpheu:
steps:
1. Prehook & Posthook CBasePlayer::Observer_FindNextPlayer
2. in prehook function, check if watcher is SPEC, if true, do nothing
else check if watcher has admin flag, if not true, do nothing
3. patch v31 to 0 if admin has flag and not spec
Code:
if ( *(_DWORD *)(a1 + 476) != 3 )
        v31 = 1;
4. in posthook function, set it back.

anyone interested in this may have a try.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
xSav
Junior Member
Join Date: Jun 2010
Old 10-21-2011 , 04:55   Re: Module: Admin Free Look
Reply With Quote #62

the problem on linux system doesnt solved
i have
Quote:
amx_adminfreelook 1
amx_adminfreelookflag "d"
and
Quote:
mp_forcechasecam "1"
mp_forcecamera "1"
and if a choose spectator without admins rights i cant change any views.
i tried version from 35 post and 52 too
sorry for bad english
xSav is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 10-21-2011 , 06:53   Re: Module: Admin Free Look
Reply With Quote #63

for linux, better to use an amxx plugin using Orpheu
1. Prehook & Posthook CBasePlayer::Observer_FindNextPlayer
2. In Prehook function, Checking admin, if true, set cvar mp_forcechasecam to not 1, if not true, set to 1
3, In posthook function, set that cvar to 1.
Although this method is not that efficient, but it's ok for this case and this kind of function. Try it yourself or ask someone in request section.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
xSav
Junior Member
Join Date: Jun 2010
Old 10-22-2011 , 03:21   Re: Module: Admin Free Look
Reply With Quote #64

where i can find it ?
xSav is offline
kostov
Member
Join Date: Jan 2010
Location: Bulgaria, Sofia
Old 06-26-2012 , 14:39   Re: Module: Admin Free Look
Reply With Quote #65

Some progress with the version for Linux?
kostov is offline
S0m3Th1nG_AwFul
Member
Join Date: Sep 2011
Location: is not known.
Old 07-27-2012 , 19:36   Re: Module: Admin Free Look
Reply With Quote #66

Quote:
Originally Posted by Arkshine View Post
Don't know why I've not tested returning team variable. If returning works fine, so the asm line above should be pointless.

Try this binary :
Unfortunately, module from this post (#52) is completely broken
With mp_forcechasecam "2" and mp_forcecamera "2" it allows to spectate everyone for admins and non-admins at the same time (like mp_forcechasecam and mp_forcecamera is set to 1) when you're in team, not only in spec...
First one (from #35 post), at least, had only bug with non-admin spec.
In any way, Thank you for your work, both of you
S0m3Th1nG_AwFul is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 07-28-2012 , 08:04   Re: Module: Admin Free Look
Reply With Quote #67

I'm totally out of this kind of stuff, cs, amxx, whatever. But for the sake of whom asked me for help, I decide to give it a shot to end this "free look" story.

But I'm not good at Orpheu thing, and haven't been coding for a long time. so someone(Arkshine?) may help me finish it please.

Code:
#include <amxmodx>
#include <orpheu>

#define PLUGIN	"Admin Free Look"
#define AUTHOR	"Jim"
#define VERSION	"1.0"

new g_cvar_afl
new g_cvar_aflf

new g_mp_forcechasecam
new g_mp_forcecamera

new g_forcechasecam
new g_forcecamera

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	g_cvar_afl = register_cvar("amx_adminfreelook", "1")
	g_cvar_aflf = register_cvar("amx_adminfreelookflag", "d")
	g_mp_forcechasecam = get_cvar_pointer("mp_forcechasecam")
	g_mp_forcecamera = get_cvar_pointer("mp_forcecamera")
	
	new OrpheuFunction:Observer_FindNextPlayer = OrpheuGetFunction("Observer_FindNextPlayer", "CBasePlayer")
	OrpheuRegisterHook(Observer_FindNextPlayer, "OnObserver_FindNextPlayer")
	OrpheuRegisterHook(Observer_FindNextPlayer, "OnObserver_FindNextPlayer_Post", OrpheuHookPost)
}

public OnObserver_FindNextPlayer(const player, para1, para2)
{
	g_forcechasecam = get_pcvar_num(g_mp_forcechasecam)
	g_forcecamera = get_pcvar_num(g_mp_forcecamera)
	
	if(!get_pcvar_num(g_cvar_afl))
		return
	
	if(!g_forcechasecam && !g_forcecamera)
		return

	if(get_user_flags(player) & get_pcvar_flags(g_cvar_aflf))
	{
		set_pcvar_num(g_mp_forcechasecam, 0)
		set_pcvar_num(g_mp_forcecamera, 0)
	}
}

public OnObserver_FindNextPlayer_Post(const player, para1, para2)
{
	set_pcvar_num(g_mp_forcechasecam, g_forcechasecam)
	set_pcvar_num(g_mp_forcecamera, g_forcecamera)
}
The related file is not given.

Thanks for anyone who care about this. Or maybe no one does. This is all I can do.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-28-2012 , 14:37   Re: Module: Admin Free Look
Reply With Quote #68

You can try that :

Spoiler


And put the attached file in : orpheu/functions/CBasePlayer/
Attached Files
File Type: zip Observer_FindNextPlayer.zip (412 Bytes, 2525 views)
__________________
Arkshine is offline
S0m3Th1nG_AwFul
Member
Join Date: Sep 2011
Location: is not known.
Old 07-28-2012 , 16:38   Re: Module: Admin Free Look
Reply With Quote #69

Thanks a lot again to you both! Problem seems to be completely solved for Linux at this moment, also say_team and score-table works properly for admins unlike pure-AMXX plugin.

Last edited by S0m3Th1nG_AwFul; 07-28-2012 at 16:40.
S0m3Th1nG_AwFul is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 07-29-2012 , 02:15   Re: Module: Admin Free Look
Reply With Quote #70

Thank you again, Arkshine. Like always.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang 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 09:28.


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