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

[REQ] cs:go only admin spectator


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
vase070
Senior Member
Join Date: Jun 2011
Old 06-23-2015 , 09:06   [REQ] cs:go only admin spectator
Reply With Quote #1

can anyone make a plugin to allow only admins to go spec
vase070 is offline
Puppetmaster
Senior Member
Join Date: Jun 2015
Location: Probably at a computer.
Old 06-24-2015 , 01:05   Re: [REQ] cs:go only admin spectator
Reply With Quote #2

This code will move any players in spectator into T or CT at the start of each round
Ive uploaded it here: https://forums.alliedmods.net/showthread.php?t=264987

Code:
#include <dbi> 
#include <sourcemod>  
#include <cstrike> 
#include <clientprefs> 
#include <sdktools> 
 
#define PLUGIN_VERSION "0.0.0" 
 
 
//begin 
public Plugin:myinfo = 
{ 
    name = "SimpleCSGOAntiSpectator", 
    author = "Puppetmaster", 
    description = "SimpleCSGOAntiSpectator Addon", 
    version = PLUGIN_VERSION, 
    url = "http://gamingzone.ddns.net/" 
}; 
 
//called at start of plugin, sets everything up. 
public OnPluginStart() 
{ 
    HookEvent("round_poststart", Event_RoundStart) //new round 
    HookEvent("round_prestart", Event_RoundStart) //new round
} 
 
 
public Action:Event_RoundStart (Handle:event, const String:name[], bool:dontBroadcast){ 
    move(); 
    return Plugin_Continue; 
} 
 
 
public move(){ 
    PrintToServer("New Round, Moving players out of spectator"); 
    new maxclients = GetMaxClients() 
    for(new i=1; i <= maxclients; i++) 
    { 
        if(IsClientInGame(i))  
        {
            if(GetClientTeam(i) < 2)
            {
                if(GetUserAdmin(i) == INVALID_ADMIN_ID) ChangeClientTeam(i, GetRandomInt(2, 3)); //move non-admins randomly to t or ct
            } 
        } 
    } 
}

Last edited by Puppetmaster; 06-24-2015 at 01:20. Reason: Added prestart
Puppetmaster 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 21:12.


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