Raised This Month: $ Target: $400
 0% 

Limit Teams


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Knife2oo8
Junior Member
Join Date: May 2012
Old 02-19-2013 , 00:54   Limit Teams
Reply With Quote #1

Hey,

how about a Plugin that limit teams?

For example:
In Deathrun it's better to just have 1 Terrorist.

I tried also to make a Plugin but I don't know exactly on which events I should check if there's already a Terrorist (and for sure switch the terrorist which joined at last).
On the event player_team (I think it was named like that) I don't get anything, maybe I need a timer?

Well..... It would be nice if someone, who knows SourcePawn way better than me could do that
Knife2oo8 is offline
K0Killer2
SourceMod Donor
Join Date: Aug 2012
Location: Florida
Old 02-19-2013 , 04:01   Re: Limit Teams
Reply With Quote #2

Here's one way to do it.

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

public OnPluginStart()
{
    
AddCommandListener(Command_JoinTeam"jointeam");
}

public 
Action:Command_JoinTeam(client, const String:command[], args)
{
    
decl String:TeamNumber[3];
    
GetCmdArg(1TeamNumbersizeof(TeamNumber));
    new 
Team StringToInt(TeamNumber);
    if(
Team!=CS_TEAM_CT&&Team!=CS_TEAM_T&&Team!=CS_TEAM_SPECTATOR)
    {
        
PrintCenterText(client"Auto-Join is disabled.");
        
ClientCommand(client"play buttons/button11.wav");
        
UTIL_TeamMenu(client);
        return 
Plugin_Handled;
    }
    if(
Team==CS_TEAM_T&&GetTeamClientCount(CS_TEAM_T)>=1)
    {
        
PrintCenterText(client"Only one terrorist please.");
        
ClientCommand(client"play buttons/button11.wav");
        
UTIL_TeamMenu(client);
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;
}

UTIL_TeamMenu(client)
{
    new 
clients[1];
    new 
Handle:bf;
    
clients[0] = client;
    
    
bf StartMessage("VGUIMenu"clients1);
    
BfWriteString(bf"team"); // panel name
    
BfWriteByte(bf1); // bShow
    
BfWriteByte(bf0); // count
    
EndMessage();

Attached Files
File Type: sp Get Plugin or Get Source (teamlimiter.sp - 402 views - 1.1 KB)

Last edited by K0Killer2; 02-19-2013 at 12:16.
K0Killer2 is offline
Knife2oo8
Junior Member
Join Date: May 2012
Old 02-20-2013 , 01:19   Re: Limit Teams
Reply With Quote #3

Awesome - Thank you!
Knife2oo8 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 04:24.


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