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

[REQ][CSGO] Normal Player => CT / Admin => TR


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ffriozi
Senior Member
Join Date: Feb 2016
Old 08-29-2016 , 15:25   [REQ][CSGO] Normal Player => CT / Admin => TR
Reply With Quote #1

hey guys sup?

There is any plugin to only allow TR side to Admins?

i want normal players to CT and admins do TR.

is this possible?
ffriozi is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-29-2016 , 16:56   Re: [REQ][CSGO] Normal Player => CT / Admin => TR
Reply With Quote #2

try this:
PHP Code:
#pragma semicolon 1
#pragma newdecls required

#include <sourcemod>
#include <sdktools>
#include <cstrike>

bool bIsAdmin[MAXPLAYERS+1];

public 
void OnPluginStart()
{
    
AddCommandListener(Cmd_JoinTeam"jointeam"); 
    
HookEvent("player_spawn"PlayerSpawn);
}

public 
void OnClientPostAdminCheck(int client)
{
    if(
client <= MaxClientsbIsAdmin[client] = CheckCommandAccess(client"sm_admin"ADMFLAG_GENERIC);
}

public 
Action PlayerSpawn(Event event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(event.GetInt("userid"));
    if(!
IsFakeClient(client)) ChangeTeam(clientGetClientTeam(client), bIsAdmin[client]);
}

public 
Action Cmd_JoinTeam(int client, const char[] commandint argc)
{
    if(
argc == || client == || !IsClientConnected(client) || !IsClientInGame(client) || IsFakeClient(client)) return Plugin_Continue;

    
char team[4];
    
GetCmdArg(1teamsizeof(team));
    
ChangeTeam(clientStringToInt(team), bIsAdmin[client]);

    return 
Plugin_Continue;
}

void ChangeTeam(int clientint teambool admin)
{
    if((
admin && team == CS_TEAM_CT) || (!admin && team == CS_TEAM_T))
    {
        
ChangeClientTeam(clientbIsAdmin[client] ? CS_TEAM_T CS_TEAM_CT);
        
CS_RespawnPlayer(client);
    }

Need SM1.8 to compile
__________________
Grey83 is offline
ffriozi
Senior Member
Join Date: Feb 2016
Old 08-29-2016 , 18:33   Re: [REQ][CSGO] Normal Player => CT / Admin => TR
Reply With Quote #3

Yeah worked.

if i want only players with access to sm_vip i just change the sm_admin line?

Last edited by ffriozi; 08-29-2016 at 22:08.
ffriozi is offline
Grey83
Veteran Member
Join Date: Dec 2014
Location: Ukraine
Old 08-29-2016 , 22:26   Re: [REQ][CSGO] Normal Player => CT / Admin => TR
Reply With Quote #4

In this case You need change parametrs in the CheckCommandAccess():
eg. CheckCommandAccess(client, "sm_vip", ADMFLAG_CUSTOM1)
PHP Code:
/**
 * @section Bitwise values definitions for admin flags.
 */
#define ADMFLAG_RESERVATION            (1<<0)        /**< Convenience macro for Admin_Reservation as a FlagBit */
#define ADMFLAG_GENERIC                (1<<1)        /**< Convenience macro for Admin_Generic as a FlagBit */
#define ADMFLAG_KICK                (1<<2)        /**< Convenience macro for Admin_Kick as a FlagBit */
#define ADMFLAG_BAN                    (1<<3)        /**< Convenience macro for Admin_Ban as a FlagBit */
#define ADMFLAG_UNBAN                (1<<4)        /**< Convenience macro for Admin_Unban as a FlagBit */
#define ADMFLAG_SLAY                (1<<5)        /**< Convenience macro for Admin_Slay as a FlagBit */
#define ADMFLAG_CHANGEMAP            (1<<6)        /**< Convenience macro for Admin_Changemap as a FlagBit */
#define ADMFLAG_CONVARS                (1<<7)        /**< Convenience macro for Admin_Convars as a FlagBit */
#define ADMFLAG_CONFIG                (1<<8)        /**< Convenience macro for Admin_Config as a FlagBit */
#define ADMFLAG_CHAT                (1<<9)        /**< Convenience macro for Admin_Chat as a FlagBit */
#define ADMFLAG_VOTE                (1<<10)        /**< Convenience macro for Admin_Vote as a FlagBit */
#define ADMFLAG_PASSWORD            (1<<11)        /**< Convenience macro for Admin_Password as a FlagBit */
#define ADMFLAG_RCON                (1<<12)        /**< Convenience macro for Admin_RCON as a FlagBit */
#define ADMFLAG_CHEATS                (1<<13)        /**< Convenience macro for Admin_Cheats as a FlagBit */
#define ADMFLAG_ROOT                (1<<14)        /**< Convenience macro for Admin_Root as a FlagBit */
#define ADMFLAG_CUSTOM1                (1<<15)        /**< Convenience macro for Admin_Custom1 as a FlagBit */
#define ADMFLAG_CUSTOM2                (1<<16)        /**< Convenience macro for Admin_Custom2 as a FlagBit */
#define ADMFLAG_CUSTOM3                (1<<17)        /**< Convenience macro for Admin_Custom3 as a FlagBit */
#define ADMFLAG_CUSTOM4                (1<<18)        /**< Convenience macro for Admin_Custom4 as a FlagBit */
#define ADMFLAG_CUSTOM5                (1<<19)        /**< Convenience macro for Admin_Custom5 as a FlagBit */
#define ADMFLAG_CUSTOM6                (1<<20)        /**< Convenience macro for Admin_Custom6 as a FlagBit */ 
__________________
Grey83 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 21:28.


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