Raised This Month: $ Target: $400
 0% 

B_RUSH Plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
minimiller
Veteran Member
Join Date: Aug 2007
Location: United Kingdom
Old 04-05-2009 , 20:21   B_RUSH Plugin
Reply With Quote #1

I'm currently into mapping and my friend wanted me to make a map specific to B_rush.
So i did, and its pretty good however there are a few bugs that hammer cannot fix =[

If you dont know what b_rush is, check this out:
Quote:
B-rush needs 8 players, 5T and 3 CT.
Normally it would be 4on4 and a knife round would be played to decide the teams.
The Ts need to rush bomb site B and CTs need to defend it.
If Ts win the round, the 3 who got kills go CT and the CTs who died go T.
If CTs win the round, the teams stay the same and the game continues.
If CTs win 8 or 10 rounds in a row, a new map is chosen and the CTs get to put "[DREAMTEAM]" in their name cos they r pro

There are a few rules:
NO flashbangs
NO sheilds
NO nade spamming from spawn (only an issue on certain maps, E.g. the 1 i made)
Ts must NOT run mid or any other route to get to B (They must use the shortest route) (E.g. de_inferno - rush banana, de_dust2 - rush tunnels)

Server side settings need to be:
mp_friendlyfire 0
mp_startmoney 801
mp_roundtime 1
mp_freezetime 0
sv_gravity 800
My code is as follows:
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <cstrike>
#include <hamsandwich>

#pragma semicolon 1

new PLUG[] = "Stewie's B Rush";
new 
VERS[] = "1.0";
new 
AUTH[] = "Stewie!";

new 
gGame 0;
new 
gNewCtIds[3];
new 
gCtsDied 0;
new 
gReason[20];

new 
bool:gbGameInProgress false;

/*---------------------------------------------------------------------------------------------------------------------*/
/* plugin_init                                                                                                         */
/*-------------------------------------------------------------------------------------------------------=[ Stewie! ]=-*/
public plugin_init()
{
    
register_plugin(PLUGVERSAUTH);
    
register_cvar(PLUGVERSFCVAR_SERVER);
    
    
register_clcmd("say /start""start_game", -1);
    
    
register_clcmd("flash""block");
    
register_clcmd("shield""block");
    
    
RegisterHam(Ham_DeathNotice"player""player_death");
}

/*---------------------------------------------------------------------------------------------------------------------*/
/* House keeping                                                                                                       */
/*-------------------------------------------------------------------------------------------------------=[ Stewie! ]=-*/
public client_connect(id)
{
    if(
get_playersnum() >= 9)
    {
        
formatex(gReason32"too many clients");
        
stop_brush();
    }
}

public 
client_disconnect(id)
{
    if(
get_playersnum() <= 7)
    {
        
formatex(gReason32"not enough clients");
        
stop_brush();
    }
}

/*---------------------------------------------------------------------------------------------------------------------*/
/* Start Game                                                                                                          */
/*-------------------------------------------------------------------------------------------------------=[ Stewie! ]=-*/
public start_game()
{
    if(
gbGameInProgress)
    {
        
client_print(0print_chat"There is allready a game in progress!");
    }
    else
    {
        
gbGameInProgress true;
        
restart_round();
    }
}

/*---------------------------------------------------------------------------------------------------------------------*/
/* Player death                                                                                                        */
/*-------------------------------------------------------------------------------------------------------=[ Stewie! ]=-*/
public player_death(victim)
{
    switch(
gGame)
    {
        case 
0// No Game
        
{
            return 
HAM_SUPERCEDE;
        }
        case 
1// Knife round
        
{
            if(
cs_get_user_team(victim) == CS_TEAM_CT)
            {
                
gNewCtIds[gCtsDied] = victim;
                
gCtsDied++;
            }
            
            if(
gCtsDied == 4)
            {
                for(new 
08i++)
                {
                    
cs_set_user_team(iCS_TEAM_T);
                    
make_cts();
                }
            }
        }
        case 
2// B Rush
        
{
            if(
cs_get_user_team(victim) == CS_TEAM_CT)
            {
                
gNewCtIds[gCtsDied] = victim;
                
gCtsDied++;
            }
            
            if(
gCtsDied == 4)
            {
                for(new 
08i++)
                {
                    
cs_set_user_team(iCS_TEAM_T);
                    
make_cts();
                }
            }
        }
    }
    return 
HAM_SUPERCEDE;
}

/*---------------------------------------------------------------------------------------------------------------------*/
/* Stocks n Stuff                                                                                                      */
/*-------------------------------------------------------------------------------------------------------=[ Stewie! ]=-*/
public make_cts()
{
    switch(
gGame)
    {
        case 
0:
        {
            return 
PLUGIN_CONTINUE;
        }
        default:
        {
            
cs_set_user_team(gNewCtIds[0], CS_TEAM_CT);
            
cs_set_user_team(gNewCtIds[1], CS_TEAM_CT);
            
cs_set_user_team(gNewCtIds[2], CS_TEAM_CT);
            
            
gGame 2;
        }
    }
    
    
restart_round();
    return 
PLUGIN_CONTINUE;
}

public 
restart_round()
{
    
server_cmd("sv_restartround 1");
}

public 
stop_brush()
{
    
client_print(0print_chat"B rush has stopped due to %s"gReason);
    
set_task(1.1"restart_round");
    
set_task(2.1"restart_round");
    
set_task(3.1"restart_round");
}

public 
block()
{
    return 
PLUGIN_HANDLED;

Seeing as though i dont often have 7 other ppl willing to help test, i looked to using podbots, but they dont seem to follow the rules =[
So ive given up and im now asking for help
Any1 wanna give it a go?
Or maybe we could arrange 7 ppl to come help meh test at some point
__________________
minimiller is offline
Send a message via MSN to minimiller
 


Thread Tools
Display Modes

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 02:21.


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