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

Solved [CS:GO] Admin Free Look


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-21-2016 , 02:21   [CS:GO] Admin Free Look (need help!)
Reply With Quote #1

Hello, my game server is actually running a plug-in which allows the Admins to spectate the enemies, but I also want the Admins to be able to switch between First-Person, Third-Person (optional) and Free-Look modes if they wish.

Is it possible? I've searched over the Internet, but couldn't find any results.
Thanks!

Oh, I underline that an Admin can switch between these modes while SPEC. While T/ CT, it's not possible.
__________________

Last edited by claudiuhks; 08-21-2016 at 13:01.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 08-21-2016 , 02:55   Re: [CS:GO] Admin Free Look (need help!)
Reply With Quote #2

You can make a plugin that allowed only to admins to join spec team and then it will be with third person,first person...
If you wan't I can make 1 for you
EDIT:
I think you should change this mp_forcecamera convar to 0
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests

Last edited by BraveFox; 08-21-2016 at 02:56.
BraveFox is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-21-2016 , 04:01   Re: [CS:GO] Admin Free Look (need help!)
Reply With Quote #3

Quote:
Originally Posted by BraveFox View Post
You can make a plugin that allowed only to admins to join spec team and then it will be with third person,first person...
If you wan't I can make 1 for you
EDIT:
I think you should change this mp_forcecamera convar to 0
I want the Admins to be able to Free-Look while T/ CT (dead). They can only Free-Look while SPEC, at the moment.
__________________

Last edited by claudiuhks; 08-21-2016 at 04:03.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
BraveFox
AlliedModders Donor
Join Date: May 2015
Location: Israel
Old 08-21-2016 , 08:13   Re: [CS:GO] Admin Free Look (need help!)
Reply With Quote #4

Quote:
Originally Posted by claudiuhks View Post
I want the Admins to be able to Free-Look while T/ CT (dead). They can only Free-Look while SPEC, at the moment.
oh.
You can take the ttt - spec menu plugin and edit that only admins can do /spm
__________________
Contact Me:
Steam: NoyB
Discord: Noy#9999
Taking Private Requests
BraveFox is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-21-2016 , 10:59   Re: [CS:GO] Admin Free Look (need help!)
Reply With Quote #5

Quote:
Originally Posted by BraveFox View Post
oh.
You can take the ttt - spec menu plugin and edit that only admins can do /spm
Thank you so much. I will post the script soon, so others can use it and mark the thread as "Solved".

PHP Code:
#include <sourcemod>
#include <cstrike>

public Plugin myinfo =
{
    
name "specmode",
    
author "Hattrick HKS",
    
description "Admin Spectator Mode",
    
version "2.0",
    
url "http://hattrick.go.ro/"
};

enum SpecMode:
{
    
SpecMode_None 0,

    
SpecMode_1ST_Person 4,
    
SpecMode_3RD_Person,

    
SpecMode_Free_Look
};

public 
void OnPluginStart()
{
    
RegConsoleCmd("spec_mode"OnSpecMode);
}

public 
Action OnSpecMode(int iIdint iArgs)
{
    static 
int iTeam CS_TEAM_NONE;
    static 
int iTarget INVALID_ENT_REFERENCE;

    static 
SpecMode pMode SpecMode_None;

    if (
iId >= && \
        
iId <= MaxClients && \
        
IsClientInGame(iId) && \
        !
IsPlayerAlive(iId) && \
        !
IsFakeClient(iId) && \
        !
IsClientSourceTV(iId) && \
        
IsClientObserver(iId) && \
        
CheckCommandAccess(iId"sm_ban"ADMFLAG_BAN) && \
        ((
iTeam GetClientTeam(iId)) == CS_TEAM_T || iTeam == CS_TEAM_CT) && \
        (
pMode view_as<SpecMode>(GetEntProp(iIdProp_Send"m_iObserverMode"))) != SpecMode_None && \
        (
iTarget GetEntPropEnt(iIdProp_Send"m_hObserverTarget")) != INVALID_ENT_REFERENCE && \
        
iTarget >= && \
        
iTarget <= MaxClients && \
        
IsClientInGame(iTarget) && \
        
IsPlayerAlive(iTarget))
    {
        switch (
pMode)
        {
            case 
SpecMode_1ST_Person:
            {
                
SetEntProp(iIdProp_Send"m_iObserverMode"view_as<int>(SpecMode_3RD_Person));
            }

            case 
SpecMode_3RD_Person:
            {
                
SetEntProp(iIdProp_Send"m_iObserverMode"view_as<int>(SpecMode_Free_Look));
            }

            case 
SpecMode_Free_Look:
            {
                
SetEntProp(iIdProp_Send"m_iObserverMode"view_as<int>(SpecMode_1ST_Person));
            }
        }

        return 
Plugin_Stop;
    }

    return 
Plugin_Continue;

__________________

Last edited by claudiuhks; 08-23-2016 at 00:17.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
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 16:24.


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