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

[CSGO] Only 1 team change allowed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheKiwI
Member
Join Date: May 2011
Old 12-05-2012 , 12:08   [CSGO] Only 1 team change allowed
Reply With Quote #1

Hi,
There is a way to disable the team change limit ?

already tried :
Code:
mp_teams_unbalance_limit 0
mp_autoteambalance 0
mp_limitteams 0
Something like hooking "jointeam" ?
__________________
TheKiwI is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 12-05-2012 , 13:07   Re: [CSGO] Only 1 team change allowed
Reply With Quote #2

Hook jointeam command

get team index
use ChangeClientTeam(client, teamindex)
and don't forget to return Plugin_Handled;
Despirator is offline
TheKiwI
Member
Join Date: May 2011
Old 12-05-2012 , 16:45   Re: [CSGO] Only 1 team change allowed
Reply With Quote #3

like that ?

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

#pragma semicolon 1

public OnPluginStart()
{
    
HookEvent("player_team"Event_PlayerTeamEventHookMode_Pre);
}

public 
Action:Event_PlayerTeam(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));
    new 
team GetEventInt(event"team");
    if(
team >= 1)
    {
        
ChangeClientTeam(clientteam);
    }
    return 
Plugin_Handled;

__________________
TheKiwI is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 12-06-2012 , 14:07   Re: [CSGO] Only 1 team change allowed
Reply With Quote #4

no

PHP Code:
public OnPluginStart()
{
      
AddCommandListener(Command_JoinTeam"jointeam");  i think csgo uses that like css
}

public 
Action:Command_JoinTeam(client, const String:command[], argc)
{
      if (!
client) return Plugin_Continue;
      
decl String:g_szTeam[4];
      
GetCmdArgString(g_szTeamsizeof(g_szTeam));
      new 
team StringToInt(g_szTeam);
      if (
<= team <= 3)
      {
            
ChangeClientTeam(clientteam);
            return 
Plugin_Handled;
      }
      return 
Plugin_Continue;

Despirator is offline
TheKiwI
Member
Join Date: May 2011
Old 12-06-2012 , 15:25   Re: [CSGO] Only 1 team change allowed
Reply With Quote #5

Quote:
Originally Posted by Despirator View Post
no

PHP Code:
public OnPluginStart()
{
      
AddCommandListener(Command_JoinTeam"jointeam");  i think csgo uses that like css
}

public 
Action:Command_JoinTeam(client, const String:command[], argc)
{
      if (!
client) return Plugin_Continue;
      
decl String:g_szTeam[4];
      
GetCmdArgString(g_szTeamsizeof(g_szTeam));
      new 
team StringToInt(g_szTeam);
      if (
<= team <= 3)
      {
            
ChangeClientTeam(clientteam);
            return 
Plugin_Handled;
      }
      return 
Plugin_Continue;

Thanks
__________________
TheKiwI is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 12-07-2012 , 10:42   Re: [CSGO] Only 1 team change allowed
Reply With Quote #6

ready to use plugin
Attached Files
File Type: smx teamchange_unlimited.smx (2.3 KB, 546 views)
File Type: sp Get Plugin or Get Source (teamchange_unlimited.sp - 1294 views - 744 Bytes)
Despirator 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 18:10.


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