Raised This Month: $4 Target: $400
 1% 

Spectate CT Team Only


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SpaWn2KiLl
Member
Join Date: Aug 2012
Old 07-08-2014 , 14:39   Spectate CT Team Only
Reply With Quote #1

Hello, I'm searching for a plugin that only allows to spectate the CT team...

Dead CT: Spectate CT players in 1st person view mode only
Dead T: Spectate CT players in 1st person view mode only
Spectatores: Spectate CT players in 1st person view mode only

I searched a lot but i din't find the solution...

Thanks
SpaWn2KiLl is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 07-08-2014 , 19:12   Re: Spectate CT Team Only
Reply With Quote #2

I have been working on this for some time now. Great timing.

Use cvar spec_force_team X where X is the team ( 1 - T, 2 - CT )

Code:
#include <amxmodx> #include <orpheu> #include <fakemeta> #include <engine> #define PLUGIN "Force Spectate" #define VERSION "1.1" #define AUTHOR "SpeeDeeR" #define get_team(%0)    ( get_pdata_int( %0, m_iTeam ) ) #define MAXPLAYERS  32 const m_iTeam = 114; new pcvar_force_team; new OrpheuFunction: Observer_IsValidTarget; public plugin_init() {     register_plugin( PLUGIN, VERSION, AUTHOR );         Observer_IsValidTarget = OrpheuGetFunction( "Observer_IsValidTarget", "CBasePlayer" );         OrpheuRegisterHook( Observer_IsValidTarget, "Observer_IsValidTarget_Pre", OrpheuHookPre  );         pcvar_force_team = register_cvar("spec_force_team", "2"); } public  Observer_IsValidTarget_Pre( const this, const iTarget, const bool:bOnlyTeam ) {     if( is_user_alive( iTarget ) )     {         static ppcvar; ppcvar = get_pcvar_num( pcvar_force_team  );                 if( get_team( iTarget ) != ppcvar )         {             static id; id = iTarget;             while ( ( id = find_ent_by_class( id, "player" ) ) != iTarget )             {                 if(get_team( id ) != ppcvar )                     continue;                                 OrpheuSetParam( 2, id );                                 break;             }         }     } }
Attached Files
File Type: zip force_spectate.zip (4.1 KB, 88 views)

Last edited by SpeeDeeR; 07-08-2014 at 20:01. Reason: formating
SpeeDeeR is offline
SpaWn2KiLl
Member
Join Date: Aug 2012
Old 07-08-2014 , 19:13   Re: Spectate CT Team Only
Reply With Quote #3

I'll test it later, thank you

EDIT: It's working! Thanks very much!!


You can lock this thread
__________________

Last edited by SpaWn2KiLl; 07-08-2014 at 22:36.
SpaWn2KiLl is offline
YoUrEnD
Member
Join Date: Nov 2015
Location: Germany
Old 08-29-2020 , 09:48   Re: Spectate CT Team Only
Reply With Quote #4

Can please someone port this to Sourcemod and add the ability for admins to spec everything?
__________________
Counter-Strike Source
Public DM:213.202.212.239:27035
MiniGames:213.202.212.239:27065
Bhop:213.202.212.239:27015
GunGame:213.202.212.239:27055
Rats:213.202.212.239:27165
AWP NoScope:213.202.212.239:27085
SurfDM:213.202.212.239:27045
Public:213.202.212.239:27120
YoUrEnD 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 20:02.


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