HavenForts: Construct JetFists - The Chronicles of Wargasm (Episode 2, NeoForts)
|

06-23-2008
|
Master Craftsman
|
|
Join Date: Aug 2007
Posts: 757
|
|
Modified "sm_addtime" plugin for Puggers
Any suggestions of more commands that ppl need?
Code:
/**
* =============================================================================
* sm_addtime & sm_togglephase By Team MX | MoggieX - http://www.afterbuy.co.uk
* Adds time & togglephase thus removing the need to RCON these commands
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*
* As a special exception, AlliedModders LLC gives you permission to link the
* code of this program (as well as its derivative works) to "Half-Life 2," the
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
* by the Valve Corporation. You must obey the GNU General Public License in
* all respects for all other code used. Additionally, AlliedModders LLC grants
* this exception to all derivative works. AlliedModders LLC defines further
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
* or <http://www.sourcemod.net/license.php>.
*
**/
//////////////////////////////////////////////////////////////////
// Includes / Defintions
//////////////////////////////////////////////////////////////////
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#define PLUGIN_VERSION "1.3 edit"
//////////////////////////////////////////////////////////////////
// Plugin Info
//////////////////////////////////////////////////////////////////
public Plugin:myinfo =
{
name = "sm_addtime",
author = "MoggieX",
description = "Adds lots of commands",
version = PLUGIN_VERSION,
url = "http://www.afterbuy.co.uk"
};
//////////////////////////////////////////////////////////////////
// Start Plugin, Reg commands & get Translations
//////////////////////////////////////////////////////////////////
public OnPluginStart()
{
CreateConVar("sm_add_tog_version", PLUGIN_VERSION, "SM Addtime-togglephase Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
RegAdminCmd("sm_addtime", Command_SmAddTime, ADMFLAG_CUSTOM1, "sm_addtime <Amount> - Add Time.");
RegAdminCmd("sm_blocklimit", Command_SmBlockLimit, ADMFLAG_CUSTOM1, "sm_blocklimit <Amount> - # of blocks.");
RegAdminCmd("sm_playerlimits", Command_SmPlayerLimits, ADMFLAG_CUSTOM1, "sm_playerlimits <1 or 0> - Limit classes?");
RegAdminCmd("sm_forcebalance", Command_SmForceBalance, ADMFLAG_CUSTOM1, "sm_forcebalance <1 or 0> - Force balance?");
RegAdminCmd("sm_forceteams", Command_SmForceTeams, ADMFLAG_CUSTOM1, "sm_forceteams <1 or 0> - Force the teams?");
RegAdminCmd("sm_roundlimit", Command_SmRoundLimit, ADMFLAG_CUSTOM1, "sm_roundlimit <Amount> - The number of rounds left.");
RegAdminCmd("sm_scorelimit", Command_SmScoreLimit, ADMFLAG_CUSTOM1, "sm_scorelimit <Amount> - The max score before a team wins.");
RegAdminCmd("sm_togglephase", Command_Toggle, ADMFLAG_CUSTOM1, "sm_togglephase - Togglephase");
RegAdminCmd("sm_prebuild", Command_SmPreBuild, ADMFLAG_CUSTOM1, "sm_prebuild - 1: on, 0: off, to set up a PUG/Scrim: sm_prebuild 1, sm_map <sf_name>, and again, sm_prebuild 1 once you are in the map");
}
public Action:Command_Toggle(client, args)
{
if (args > 1)
{
ReplyToCommand(client, "[SM] Usage: sm_togglephase - No need for extra commands");
return Plugin_Handled;
}
LogAction(client, -1, "\"%L\" Used [SM] TogglePhase Command", client);
ServerCommand("togglephase");
return Plugin_Handled;
}
public Action:Command_SmAddTime(client, args)
{
if (args > 1)
{
ReplyToCommand(client, "[SM] Usage: sm_addtime <Amount>");
return Plugin_Handled;
}
new amount = 0;
decl String:arg1[20];
GetCmdArg(1, arg1, sizeof(arg1));
StringToIntEx(arg1, amount);
if (StringToIntEx(arg1, amount) < 0)
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
}
if (amount < -4000)
{
amount = -4000;
}
if (amount > 9000)
{
amount = 9000;
}
LogAction(client, -1, "\"%L\" [SM] AddTime (Time \"%s\")", client, amount);
ServerCommand("addtime %i", amount);
return Plugin_Handled;
}
public Action:Command_SmBlockLimit(client, args)
{
if (args > 1)
{
ReplyToCommand(client, "[SM] Usage: sm_blocklimit <Amount>");
return Plugin_Handled;
}
new amount = 0;
decl String:arg1[20];
GetCmdArg(1, arg1, sizeof(arg1));
StringToIntEx(arg1, amount);
if (StringToIntEx(arg1, amount) < 0)
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
}
// Iuno why ppl would go over 250 or under 50... but those seem like good limits...
if (amount < -50)
{
amount = -50;
}
if (amount > 250)
{
amount = 250;
}
LogAction(client, -1, "\"%L\" [SM] BlockLimit (Blocks \"%s\")", client, amount);
ServerCommand("sf_team_blocklimit %i", amount);
return Plugin_Handled;
}
public Action:Command_SmPlayerLimits(client, args)
{
if (args > 1)
{
ReplyToCommand(client, "[SM] Usage: sm_playerlimits <1 or 0>");
return Plugin_Handled;
}
new amount = 0;
decl String:arg1[20];
GetCmdArg(1, arg1, sizeof(arg1));
StringToIntEx(arg1, amount);
if (StringToIntEx(arg1, amount) != (1 || 0))
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
}
LogAction(client, -1, "\"%L\" [SM] PlayerLimits is \"%s\")", client, amount);
ServerCommand("sf_player_limits_enabled %i", amount);
return Plugin_Handled;
}
public Action:Command_SmForceBalance(client, args)
{
if (args > 1)
{
ReplyToCommand(client, "[SM] Usage: sm_forcebalance <1 or 0>");
return Plugin_Handled;
}
new amount = 0;
decl String:arg1[20];
GetCmdArg(1, arg1, sizeof(arg1));
StringToIntEx(arg1, amount);
if (StringToIntEx(arg1, amount) != (1 || 0))
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
}
LogAction(client, -1, "\"%L\" [SM] ForceBalance is \"%s\"", client, amount);
ServerCommand("sf_forcebalance %i", amount);
return Plugin_Handled;
}
public Action:Command_SmForceTeams(client, args)
{
if (args > 1)
{
ReplyToCommand(client, "[SM] Usage: sm_forceteams <1 or 0>");
return Plugin_Handled;
}
new amount = 0;
decl String:arg1[20];
GetCmdArg(1, arg1, sizeof(arg1));
StringToIntEx(arg1, amount);
if (StringToIntEx(arg1, amount) != (1 || 0))
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
}
LogAction(client, -1, "\"%L\" [SM] ForceTeams is \"%s\"", client, amount);
ServerCommand("sf_forceteams %i", amount);
return Plugin_Handled;
}
public Action:Command_SmRoundLimit(client, args)
{
if (args > 1)
{
ReplyToCommand(client, "[SM] Usage: sm_roundlimit <Amount>");
return Plugin_Handled;
}
new amount = 0;
decl String:arg1[20];
GetCmdArg(1, arg1, sizeof(arg1));
StringToIntEx(arg1, amount);
if (StringToIntEx(arg1, amount) < 0)
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
}
if (amount < 0)
{
amount = 0;
}
if (amount > 50)
{
amount = 50;
}
LogAction(client, -1, "\"%L\" [SM] RoundLimit is \"%s\"", client, amount);
ServerCommand("sf_roundlimit %i", amount);
return Plugin_Handled;
}
public Action:Command_SmScoreLimit(client, args)
{
if (args > 1)
{
ReplyToCommand(client, "[SM] Usage: sm_scorelimit <Amount>");
return Plugin_Handled;
}
new amount = 0;
decl String:arg1[20];
GetCmdArg(1, arg1, sizeof(arg1));
StringToIntEx(arg1, amount);
if (StringToIntEx(arg1, amount) < 0)
{
ReplyToCommand(client, "[SM] %t", "Invalid Amount");
return Plugin_Handled;
}
if (amount < 1)
{
amount = 1;
}
if (amount > 5000) // *rolls eyes*
{
amount = 5000;
}
LogAction(client, -1, "\"%L\" [SM] ScoreLimit is \"%s\"", client, amount);
ServerCommand("sf_scorelimit %i", amount);
return Plugin_Handled;
}
public Action:Command_SmPreBuild(client, args)
{
if (args > 1 || args <= 0 )
{
ReplyToCommand(client, "[SM] Usage: sm_prebuild [1 or 0]");
return Plugin_Handled;
}
new amount = 0;
decl String:arg1[20];
GetCmdArg(1, arg1, sizeof(arg1));
StringToIntEx(arg1, amount);
if (StringToIntEx(arg1, amount) != (0 || 1))
{
ReplyToCommand(client, "[SM] %t", "Not 1 or 0, fgt.");
return Plugin_Handled;
}
if (amount == 1)
{
ServerCommand("meta unpause 1"); // Server needs to load stripper first
// Some PickUpGame Defaults
ServerCommand("sf_team_blocklimit 0");
ServerCommand("sf_player_limits_enabled 0");
ServerCommand("sf_forcebalance 0");
ServerCommand("sf_forceteams 0");
ServerCommand("sf_roundlimit 2");
ServerCommand("sf_scorelimit 1000");
}
if (amount == 0)
{
ServerCommand("meta pause 1"); // Server needs to load stripper first
// A mapchange / settings on the phase change can reset everything...
}
LogAction(client, -1, "\"%L\" [SM] Prebuilds set to \"%s\"", client, amount);
return Plugin_Handled;
}
tested it and works on xenon USA server
just put this in a new text doc.txt and copy paste it all in, save it as sm_addtime.sp, then go to the sourcemod compiler on their site and compile it...
and all i did was copypasta togglephase and addtime command to add in other common sf commands...
edit:
Commands and references:
sm_addtime #
sm_blocklimit #
sm_playerlimits 1/0
sm_forcebalance 1/0
sm_forceteams 1/0
sm_roundlimit #
sm_scorelimit #
sm_togglephase
sm_prebuild 1/0 // This will only work if stripper is loaded first, which it should be.
And the use of sm_prebuild is as follows:
sm_prebuild 1 // Turns prebuilds on (unpauses the meta stripper)
sm_map sf_skywalk // Changes to the map you want with prebuilds unpaused
sm_prebuild 1 // Changes normal settings
sm_prebuild 0 // Turns prebuilds off (pauses meta stripper)
Last edited by Ev_; 07-19-2008 at 09:26 PM.
|

06-23-2008
|
Veteran Fort God
|
|
Join Date: Apr 2007
Location: Secret! :O
Posts: 7,970
|
|
*addtime
*people
__________________
Quote:
Originally Posted by Kanroook on his CRT Monitor
Sir Kanroook: I turn the radiator off in my room and use it as a heater
Sir Kanroook: in winter
|
|

06-23-2008
|
 |
Old Snake
Flag Capper
|
|
Join Date: Jul 2007
Location: Australia
Posts: 2,463
|
|
Nice work Ev.
Shup up Draken.
__________________
Ni66a?!? Master Czar: http://www.hairfinder.com/info/redhead-extinction.htm
arenaceous: scatman is gingar rite?
Ni66a?!? Master Czar: Yes
arenaceous: must suck
We're not tools of the goverment or anyone else! Fighting was the only thing.. the only thing I was good at. But, at least I always fought for what I believed in!
|

06-23-2008
|
Veteran Fort God
|
|
Join Date: Sep 2006
Posts: 5,851
|
|
"Shup" Czar.
|

06-24-2008
|
 |
Old Snake
Flag Capper
|
|
Join Date: Jul 2007
Location: Australia
Posts: 2,463
|
|
Quote:
Originally Posted by Black™
"Shup" Czar.
|
ehhhrrrr
__________________
Ni66a?!? Master Czar: http://www.hairfinder.com/info/redhead-extinction.htm
arenaceous: scatman is gingar rite?
Ni66a?!? Master Czar: Yes
arenaceous: must suck
We're not tools of the goverment or anyone else! Fighting was the only thing.. the only thing I was good at. But, at least I always fought for what I believed in!
|

06-23-2008
|
Banned
Experienced Builder
|
|
Join Date: Jun 2008
Posts: 340
|
|
I think a very useful plugin would be an addtime and togglephase vote plugin that non-admin players can trigger. I mean how many times have you been waiting for 10 minutes through a build phase because theres no admin on? Or how bout whenever you get griefed and your team needs extra time and theres no admin on? Could be a very useful plugin imo.
|

06-23-2008
|
Veteran Fort God
|
|
Join Date: Sep 2006
Posts: 5,851
|
|
Quote:
Originally Posted by ProGamer12
I think a very useful plugin would be an addtime and togglephase vote plugin that non-admin players can trigger. I mean how many times have you been waiting for 10 minutes through a build phase because theres no admin on? Or how bout whenever you get griefed and your team needs extra time and theres no admin on? Could be a very useful plugin imo.
|
Could also lead to uberfort servers never coming out of the build phase, since people will just add and add.
|

06-24-2008
|
 |
Bleop
Fort Warrior
|
|
Join Date: Dec 2005
Location: England
Posts: 1,287
|
|
Ev makes scripts for servers too now? =o
__________________
Quote:
Jake^: DONT WORRY HALFWHIT. I'LL ALWAYS SEE YOU AS THE TL;DR KING
|
Amfg a link!
|

06-24-2008
|
 |
♥electrohouse
Veteran Fort God
|
|
Join Date: Jan 2007
Location: New York
Posts: 6,540
|
|
Now all the servers are tainted by teh shady ;_;
__________________

proof sol said it
|

07-19-2008
|
Master Craftsman
|
|
Join Date: Aug 2007
Posts: 757
|
|
Fixed typo, use this, etc etc.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 05:10 AM.
|
Tab |
|