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

[REQ]Auto switch to CT if user is spectator


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
H@M
Junior Member
Join Date: Jun 2013
Old 02-01-2015 , 09:32   [REQ]Auto switch to CT if user is spectator
Reply With Quote #1

Well, I need a plugin to switch players to CT if they are spectators automatically.
Thanks!
H@M is offline
monster321
Member
Join Date: Apr 2012
Old 02-02-2015 , 07:40   Re: [REQ]Auto switch to CT if user is spectator
Reply With Quote #2

I don't test this. But is so probably that this works.

Code:
#include < amxmodx > // Init public plugin_init() {     // RegisterPlugin     register_plugin( "Auto-Switch", "1.0", "monster321" )         // Events     register_event( "HLTV", "ev_newround", "a", "1=0", "2=0" ) } // EV NewRound public ev_newround() {     for( new i; i < 32; i++ )     {         if( !is_user_connected( i ) )             return;                     if( get_user_team( i ) == 6 )         {             engclient_cmd( id, "jointeam", "2" )             engclient_cmd( id, "joinclass", "2" )         }     } }
monster321 is offline
Send a message via MSN to monster321 Send a message via Skype™ to monster321
H@M
Junior Member
Join Date: Jun 2013
Old 02-02-2015 , 08:36   Re: [REQ]Auto switch to CT if user is spectator
Reply With Quote #3

It gives me these errors.
Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "id" on line 23
Warning: Expression has no effect on line 23
Warning: Expression has no effect on line 23
Error: Expected token: ";", but found ")" on line 23
Error: Invalid expression, assumed zero on line 23
Error: Too many error messages on one line on line 23

Compilation aborted.
4 Errors.
Could not locate output file C:\Users\H@M\Desktop\specbug.amx (compile failed).
H@M is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 02-02-2015 , 09:11   Re: [REQ]Auto switch to CT if user is spectator
Reply With Quote #4

PHP Code:
#include < amxmodx >

// Init
public plugin_init()
{
    
// RegisterPlugin
    
register_plugin"Auto-Switch""1.0""monster321" )
    
    
// Events
    
register_event"HLTV""ev_newround""a""1=0""2=0" )
}

// EV NewRound
public ev_newround()
{
    for( new 
i32i++ )
    {
        if( !
is_user_connected) )
            return;
            
        if( 
get_user_team) == )
        {
            
engclient_cmdi"jointeam""2" )
            
engclient_cmdi"joinclass""2" )
        }
    }

__________________
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 02-02-2015 , 09:25   Re: [REQ]Auto switch to CT if user is spectator
Reply With Quote #5

From the phone, not tested.
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

public plugin_init()
{
    
register_plugin("Team Set""1.0""Flicker")
    
register_event("HLTV""new_round""a""1=0""2=0")
}

public 
new_round()
{
    new 
players[32], num
    get_players
(playersnum"bhe""SPECTATOR")
    
    for(new 
inumi++)
    {
        
cs_set_user_team(players[i], CS_TEAM_CT)
        
ExecuteHamB(Ham_CS_RoundRespawnplayers[i])
    }

__________________

Last edited by Flick3rR; 02-02-2015 at 11:57.
Flick3rR is offline
Send a message via Skype™ to Flick3rR
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 07:32.


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