Raised This Month: $ Target: $400
 0% 

[REQUEST] Anti - Automatic TEAM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alex30555
Member
Join Date: Sep 2011
Location: Paris
Old 09-28-2011 , 09:10   [REQUEST] Anti - Automatic TEAM
Reply With Quote #1

Hello the coders

I want to ask a small request

I am looking for some time a simple plugin,

Just to prevent a player to choose Automatic, but to take the T or CT Team

I try it myself to code this plugin by taking pieces of code around ;)

Code:
if (((== Target_Team CS_TEAM_T) | | (== Target_Team CS_TEAM_CT) | | (== Target_Team CS_TEAM_SPECTATOR)))
{
decl String: buffer [PLATFORM_MAX_PATH + 5] ClientCommand (client, buffer);
}
Here is someone to help me or let me ^ ^

Thank you in advance for your help

PS: Sorry I dont speak English (Thanks Google Translation)
Alex30555 is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 09-28-2011 , 12:40   Re: [REQUEST] Anti - Automatic TEAM
Reply With Quote #2

PHP Code:
AddCommandListener(Command_Join"jointeam");

public 
Action:Command_Join(client, const String:command[], argc)
{
    if(
client && IsClientInGame(client))
    {
        
decl String:_sTemp[3];
        
GetCmdArg(1_sTempsizeof(_sTemp));
        new 
_iTemp StringToInt(_sTemp);

        if(!
_iTemp)
        {
            
//The client is attempting to press automatic!
        
}
    }

__________________
thetwistedpanda is offline
siangc
Senior Member
Join Date: Mar 2010
Old 09-28-2011 , 12:59   Re: [REQUEST] Anti - Automatic TEAM
Reply With Quote #3

I'm looking for the exact opposite, and have searched around a lot, without finding any working plugins for it. Is it possible to force players to auto assign?
__________________
siangc is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 09-28-2011 , 16:57   Re: [REQUEST] Anti - Automatic TEAM
Reply With Quote #4

PHP Code:
if(_iTemp >= 2)
{
  
//Client is attempting to join terrorist or counter-terrorist

__________________
thetwistedpanda is offline
siangc
Senior Member
Join Date: Mar 2010
Old 09-29-2011 , 10:54   Re: [REQUEST] Anti - Automatic TEAM
Reply With Quote #5

Thanks for your help thetwistedpanda, but I can't compile that, maybe I did something wrong? I get this error:
error 021: symbol already defined: "AddCommandListener"
Attached Files
File Type: sp Get Plugin or Get Source (force-auto.sp - 124 views - 469 Bytes)
__________________
siangc is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 09-29-2011 , 10:57   Re: [REQUEST] Anti - Automatic TEAM
Reply With Quote #6

I merely provided the method, not the plugin. You need to throw the AddCommandListener into OnPluginStart, and choose the method you want to use if a player is trying to join that team.

One method would be:
PHP Code:
PrintToChat(client"Yo! Join A Team!");
return 
Plugin_Handled
Another method:
PHP Code:
new _iTeam GetRandomInt(23);
CS_SwitchTeam(clientiTeam);
PrintToChat(client"You've been switched to the %s team!"iTeam == "Terrorist" "Counter- Terrorist"); 
__________________

Last edited by thetwistedpanda; 09-29-2011 at 11:10.
thetwistedpanda is offline
Alex30555
Member
Join Date: Sep 2011
Location: Paris
Old 09-29-2011 , 12:01   Re: [REQUEST] Anti - Automatic TEAM
Reply With Quote #7

Code:
AddCommandListener(Command_Join, "jointeam");

public Action:Command_Join(client, const String:command[], argc)
{
    if(client && IsClientInGame(client))
    {
        decl String:_sTemp[3];
        GetCmdArg(1, _sTemp, sizeof(_sTemp));
        new _iTemp = StringToInt(_sTemp);

        if(!_iTemp)
        {
            //The client is attempting to press automatic!
        }
    }
}  
This code does not work for me, but already thank you for your help

Include Csrike ?

Last edited by Alex30555; 09-29-2011 at 12:05.
Alex30555 is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 09-29-2011 , 12:10   Re: [REQUEST] Anti - Automatic TEAM
Reply With Quote #8

As I've stated, I provided the method, not the finished product you can just pop in your server. If you want to prevent clients from pressing automatic, replace that // phrase with return Plugin_Handled. Throw AddCommandListener inside of OnPluginStart.
__________________
thetwistedpanda is offline
Alex30555
Member
Join Date: Sep 2011
Location: Paris
Old 09-29-2011 , 12:28   Re: [REQUEST] Anti - Automatic TEAM
Reply With Quote #9

Thank you very much, problem solved
Alex30555 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 09-29-2011 , 13:00   Re: [REQUEST] Anti - Automatic TEAM
Reply With Quote #10

Quote:
Originally Posted by siangc View Post
I'm looking for the exact opposite, and have searched around a lot, without finding any working plugins for it. Is it possible to force players to auto assign?
For which game?

Most Source games already support this via the following cvar:
Code:
mp_forceautoteam 1
Confirmed working on TF2, references on the web imply it also works for CS:S and DOD:S.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 09-29-2011 at 13:02.
Powerlord 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 00:14.


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