Commit 2415894a authored by JoyJ's avatar JoyJ

Initial commit

parents
plugins
.vscode
\ No newline at end of file
#pragma semicolon 1
#define DEBUG
#pragma tabsize 0
#define PLUGIN_AUTHOR "nhnkl159"
#define PLUGIN_VERSION "1.0"
#include <sourcemod>
#include <sdktools>
#include <colors>
// ----- Shit -----//
new ACCOUNT_OFFSET;
ConVar g_Enabled;
ConVar g_PrintToChat;
public Plugin myinfo =
{
name = "[CS:GO / ?] Admin Money",
author = PLUGIN_AUTHOR,
description = "Admin can set players money.",
version = PLUGIN_VERSION,
url = "-none-"
};
public void OnPluginStart()
{
//Commands//
RegAdminCmd("sm_setmoney", Cmd_SetMoney, ADMFLAG_BAN, "Set Money command");
//Money variable
ACCOUNT_OFFSET = FindSendPropOffs("CCSPlayer", "m_iAccount");
//Convars//
g_Enabled = CreateConVar("sm_adminmoney_enabled", "1", "Plugin enabled ?");
g_PrintToChat = CreateConVar("sm_adminmoney_printtochat", "1", "Print to chat if admin set money ?");
}
public Action Cmd_SetMoney(client, args)
{
new Money;
if(GetConVarInt(g_Enabled) == 0)
{
return Plugin_Stop;
}
if(args != 2)
{
CPrintToChat(client, "\x05[Money]\x01 Usage : sm_setmoney <name> <money>");
return Plugin_Handled;
}
new String:arg[MAX_NAME_LENGTH];
GetCmdArg(1, arg, sizeof(arg));
new String:arg2[MAX_NAME_LENGTH];
GetCmdArg(2, arg2, sizeof(arg2));
Money = StringToInt(arg2);
new targets[1];
new String:target_name[MAX_TARGET_LENGTH];
new bool:tn_is_ml;
new targets_found = ProcessTargetString(arg,
client,
targets, sizeof(targets),
COMMAND_FILTER_NO_IMMUNITY|COMMAND_FILTER_NO_MULTI,
target_name, sizeof(target_name), tn_is_ml);
if (targets_found <= COMMAND_TARGET_NONE)
{
ReplyToTargetError(client, targets_found);
return Plugin_Handled;
}
new target = targets[0];
SetEntData(target, ACCOUNT_OFFSET, Money);
if(GetConVarInt(g_PrintToChat) == 1)
{
CPrintToChatAll("\x05[Money]\x01 \x07%N\x01 set \x07%N\x01 money to \x07%d", client, target, Money);
}
return Plugin_Handled;
}
\ No newline at end of file
#pragma semicolon 1
#include <sdktools>
#define PLUGIN_VERSION "1.0.0"
public Plugin:myinfo =
{
name = "Different Team Start Money/Cash",
author = "RedSword / Bob Le Ponge",
description = "Allows teams to get different start money (a different mp_startmoney for each team)",
version = PLUGIN_VERSION,
url = "http://www.sourcemod.net/"
};
//ConVars
new Handle:g_hStartMoneyAlternate;
new Handle:g_hStartMoneyT;
new Handle:g_hStartMoneyCT;
//Prevent re-running a function
new g_iAccount; //Money of the player
new g_iAlternate;
new g_iBaseCash_T;
new g_iBaseCash_CT;
//===== Forwards
public OnPluginStart()
{
//CVars
CreateConVar( "differentteamstartmoneycashversion", //yes, very long cvar =D
PLUGIN_VERSION,
"Different Teams Start Money/Cash version",
FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY | FCVAR_DONTRECORD );
g_hStartMoneyAlternate = CreateConVar( "sm_startmoney_alternate",
"2",
"Are CVars sm_startmoney_t and sm_startmoney_ct used instead of mp_startmoney ? 2=Yes (set mp_startmoney to 800), 1=Yes, 0=No. Def. 2",
FCVAR_PLUGIN | FCVAR_NOTIFY, true, 0.0, true, 2.0 );
g_hStartMoneyT = CreateConVar( "sm_startmoney_t",
"1000",
"mp_startmoney value for terrorists. Def. 1000",
FCVAR_PLUGIN | FCVAR_NOTIFY, true, 800.0 );
g_hStartMoneyCT = CreateConVar( "sm_startmoney_ct",
"900",
"mp_startmoney value for CTs. Def. 900",
FCVAR_PLUGIN | FCVAR_NOTIFY, true, 800.0 );
//Hooks event
HookEvent( "player_team", Event_TeamChanged );
HookEvent( "round_start", Event_RoundStart );
//Hooks ConVarChanges
g_iBaseCash_T = GetConVarInt( g_hStartMoneyT );
g_iBaseCash_CT = GetConVarInt( g_hStartMoneyCT );
g_iAlternate = GetConVarInt( g_hStartMoneyAlternate );
HookConVarChange( g_hStartMoneyT, ConVarChange_BaseCashT );
HookConVarChange( g_hStartMoneyCT, ConVarChange_BaseCashCT );
HookConVarChange( g_hStartMoneyAlternate, ConVarChange_Alternate );
//Prevent re-running functions
g_iAccount = FindSendPropOffs("CCSPlayer", "m_iAccount");
}
public OnConfigsExecuted()
{
if ( g_iAlternate == 2 )
{
SetConVarInt( FindConVar( "mp_startmoney" ), 800 );
}
}
//===== Events
public Action:Event_TeamChanged( Handle:event, const String:name[], bool:dontBroadcast )
{
if ( g_iAlternate )
{
new iClient = GetClientOfUserId( GetEventInt( event, "userid" ) );
if ( iClient )
{
setClientTeamBaseCashIfBelow( iClient, GetEventInt( event, "team" ) ); //delay ?
}
}
return Action:Plugin_Continue;
}
public Action:Event_RoundStart( Handle:event, const String:name[], bool:dontBroadcast )
{
if ( g_iAlternate )
{
if ( GetTeamScore( 2 ) + GetTeamScore( 3 ) == 0 )
{
//First round, need to adjust everyone's cash (in case second restart)
for ( new i = 1; i <= MaxClients; ++i )
{
if ( IsClientInGame( i ) )
{
setClientTeamBaseCashIfBelow( i, GetClientTeam( i ) ); //delay ?
}
}
}
}
return Action:Plugin_Continue;
}
//===== ConVarChanges
public ConVarChange_BaseCashT(Handle:convar, const String:oldValue[], const String:newValue[])
{
g_iBaseCash_T = GetConVarInt( convar );
}
public ConVarChange_BaseCashCT(Handle:convar, const String:oldValue[], const String:newValue[])
{
g_iBaseCash_CT = GetConVarInt( convar );
}
public ConVarChange_Alternate(Handle:convar, const String:oldValue[], const String:newValue[])
{
g_iAlternate = GetConVarInt( convar );
if ( g_iAlternate == 2 )
{
SetConVarInt( FindConVar( "mp_startmoney" ), 800 );
}
}
//===== Privates
setClientTeamBaseCashIfBelow( iClient, iTeam )
{
new iBaseCash;
if ( iTeam == 2 )
{
iBaseCash = g_iBaseCash_T;
}
else if ( iTeam == 3 )
{
iBaseCash = g_iBaseCash_CT;
}
else
{
return;
}
if ( GetEntData( iClient, g_iAccount ) < iBaseCash )
{
//Have to delay this ?
SetEntData( iClient, g_iAccount, iBaseCash );
}
}
\ No newline at end of file
#pragma semicolon 1
#include <sdktools>
#define PLUGIN_VERSION "1.0.1"
public Plugin:myinfo =
{
name = "Max Money After X Rounds",
author = "RedSword / Bob Le Ponge",
description = "Gives player max (or less) money every round after X rounds",
version = PLUGIN_VERSION,
url = "http://www.sourcemod.net/"
};
#define MAX_CASH 16000
#define STR_ACCOUNT_PROP "m_iAccount"
//ConVars
new Handle:g_hMaxMoney;
new Handle:g_hMaxMoney_value;
new Handle:g_hMaxMoney_value_respect16k;
new Handle:g_hMaxMoney_verbose;
//Caching
new g_iMaxMoney;
new g_iMaxMoney_value;
new bool:g_bMaxMoney_value_respect16k;
new g_iMaxMoney_verbose;
//===== Forwards
public OnPluginStart()
{
//CVars
CreateConVar( "maxmoneyafterxroundsversion",
PLUGIN_VERSION,
"Different Teams Start Money/Cash version",
FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY | FCVAR_DONTRECORD );
g_hMaxMoney = CreateConVar( "sm_maxmoney",
"2",
"A which round should the players get extra cash upon spawning ? 0=disable plugin, 1=pistol round, 2=after pistol round (default).",
FCVAR_PLUGIN | FCVAR_NOTIFY, true, 0.0 );
g_hMaxMoney_value = CreateConVar( "sm_maxmoney_value",
"16000",
"How much to add to the player's money per round when he spawns, after <sm_maxmoney> rounds. Def. 16000.",
FCVAR_PLUGIN | FCVAR_NOTIFY, true, 0.0 );
g_hMaxMoney_value_respect16k = CreateConVar( "sm_maxmoney_value_16k",
"1",
"Respect 16k limit (if unsure, let '1') ?",
FCVAR_PLUGIN | FCVAR_NOTIFY, true, 0.0, true, 1.0 );
g_hMaxMoney_verbose = CreateConVar( "sm_maxmoney_verbose",
"1",
"Tell the player when they receive money? 1=Yes, 0=No. Def. 1.",
FCVAR_PLUGIN | FCVAR_NOTIFY, true, 0.0, true, 1.0 );
AutoExecConfig(true, "maxmoneyafterxrounds");
LoadTranslations( "maxmoneyafterxrounds.phrases" );
//Hooks event
HookEvent( "player_spawn", Event_PlayerSpawn );
//Hooks ConVarChanges (caching)
g_iMaxMoney = GetConVarInt( g_hMaxMoney );
g_iMaxMoney_value = GetConVarInt( g_hMaxMoney_value );
g_bMaxMoney_value_respect16k = GetConVarBool( g_hMaxMoney_value_respect16k );
g_iMaxMoney_verbose = GetConVarInt( g_hMaxMoney_verbose );
HookConVarChange( g_hMaxMoney, ConVarChange_MaxMoney );
HookConVarChange( g_hMaxMoney_value, ConVarChange_MaxMoney_value );
HookConVarChange( g_hMaxMoney_value_respect16k, ConVarChange_MaxMoney_value_16k );
HookConVarChange( g_hMaxMoney_verbose, ConVarChange_MaxMoney_verbose );
}
//===== Events
public Action:Event_PlayerSpawn( Handle:event, const String:name[], bool:dontBroadcast )
{
if ( g_iMaxMoney && GetTeamScore( 2 ) + GetTeamScore( 3 ) + 1 >= g_iMaxMoney )
{
new iClient = GetClientOfUserId( GetEventInt( event, "userid" ) );
if ( iClient && IsClientInGame( iClient ) )
{
new shouldHaveCash = GetEntProp( iClient, Prop_Send, STR_ACCOUNT_PROP ) + g_iMaxMoney_value;
if ( shouldHaveCash > MAX_CASH && g_bMaxMoney_value_respect16k )
{
shouldHaveCash = MAX_CASH;
}
SetEntProp( iClient, Prop_Send, STR_ACCOUNT_PROP, shouldHaveCash);
if ( g_iMaxMoney_verbose && GetClientTeam( iClient ) >= 2 )
{
PrintToChat( iClient, "\x04[SM] \x01%t", g_iMaxMoney_value >= MAX_CASH && g_bMaxMoney_value_respect16k ? "FullCash" : "SomeCash" );
}
}
}
return Action:Plugin_Continue;
}
//===== ConVarChanges
public ConVarChange_MaxMoney(Handle:convar, const String:oldValue[], const String:newValue[])
{
g_iMaxMoney = GetConVarInt( g_hMaxMoney );
}
public ConVarChange_MaxMoney_value(Handle:convar, const String:oldValue[], const String:newValue[])
{
g_iMaxMoney_value = GetConVarInt( g_hMaxMoney_value );
}
public ConVarChange_MaxMoney_value_16k(Handle:convar, const String:oldValue[], const String:newValue[])
{
g_bMaxMoney_value_respect16k = GetConVarBool( g_hMaxMoney_value_respect16k );
}
public ConVarChange_MaxMoney_verbose(Handle:convar, const String:oldValue[], const String:newValue[])
{
g_iMaxMoney_verbose = GetConVarInt( g_hMaxMoney_verbose );
}
\ No newline at end of file
/**
* 'TeamMoney' by bl4nk
*
* Description:
* At the beginning of a round the plugin adds up all
* of the money that each player on a team has, and
* then divides it by the amount of players on a team,
* effectively giving each player an equal share.
*
* CVars:
* sm_teammoney_enable - Enables\Disables the TeamMoney plugin.
* - 0 = Disabled
* - 1 = Enabled (default)
*/
#pragma semicolon 1
#include <sourcemod>
// Global Definitions
#define PLUGIN_VERSION "1.0.3"
#define TEAM_T 2
#define TEAM_CT 3
new cashOffset;
new bool:isHooked = false;
new Handle:cvarEnable;
public Plugin:myinfo =
{
name = "TeamMoney",
author = "bl4nk",
description = "Adds all of a team's money up and shares it equally between the team",
version = PLUGIN_VERSION,
url = "http://forums.alliedmods.net"
};
public OnPluginStart()
{
CreateConVar("sm_teammoney_version", PLUGIN_VERSION, "TeamMoney Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
cvarEnable = CreateConVar("sm_teammoney_enable", "1", "Enables/Disables the TeamMoney plugin", FCVAR_PLUGIN, true, 0.0, true, 1.0);
cashOffset = FindSendPropInfo("CCSPlayer", "m_iAccount");
if (cashOffset == -1)
SetFailState("Cash Offset Not Found!");
CreateTimer(3.0, OnPluginStart_Delayed);
}
public Action:OnPluginStart_Delayed(Handle:timer)
{
if (GetConVarInt(cvarEnable))
{
isHooked = true;
HookEvent("round_start", event_RoundStart);
LogMessage("[TeamMoney] - Loaded");
}
HookConVarChange(cvarEnable, CvarChange_Enable);
}
public CvarChange_Enable(Handle:convar, const String:oldValue[], const String:newValue[])
{
if (!GetConVarInt(cvarEnable))
{
if (isHooked)
{
isHooked = false;
UnhookEvent("round_start", event_RoundStart);
}
}
else if (!isHooked)
{
isHooked = true;
HookEvent("round_start", event_RoundStart);
}
}
public event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
CreateTimer(0.1, timer_RoundStart);
public Action:timer_RoundStart(Handle:timer)
{
new iNum = 0, Players[MAXPLAYERS + 1] = 0, TeamMoney, ShareMoney;
for (new i = 1; i <= GetMaxClients(); i++)
{
if (IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == TEAM_T)
{
Players[iNum] = i;
iNum++;
}
}
if (iNum > 0)
{
for (new i = 0; i < iNum; i++)
TeamMoney += GetPlayerMoney(Players[i]);
ShareMoney = TeamMoney / iNum;
for (new i = 0; i < iNum; i++)
{
SetPlayerMoney(Players[i], ShareMoney);
PrintToChat(Players[i], "*Team Money: %d | Share: %d", TeamMoney, ShareMoney);
}
}
iNum = 0, TeamMoney = 0, ShareMoney = 0;
for (new i = 0; i <= MAXPLAYERS; i++)
Players[i] = 0;
for (new i = 1; i <= GetMaxClients(); i++)
{
if (IsClientConnected(i) && IsClientInGame(i) && GetClientTeam(i) == TEAM_CT)
{
Players[iNum] = i;
iNum++;
}
}
if (iNum > 0)
{
for (new i = 0; i < iNum; i++)
TeamMoney += GetPlayerMoney(Players[i]);
ShareMoney = TeamMoney / iNum;
for (new i = 0; i < iNum; i++)
{
SetPlayerMoney(Players[i], ShareMoney);
PrintToChat(Players[i], "*Team Money: %d | Share: %d", TeamMoney, ShareMoney);
}
}
}
GetPlayerMoney(client)
{
return GetEntData(client, cashOffset);
}
SetPlayerMoney(client, amount)
{
SetEntData(client, cashOffset, amount);
}
\ No newline at end of file
#include <sourcemod>
#include <sdktools>
#pragma semicolon 1
#pragma newdecls required
public Plugin myinfo = {
name = "Money for survivors in CSGO",
author = "JoyJ",
description = "Give money to survivors every several seconds. Killer gets the money.",
version = "0.0.1",
url = ""
};
int money_offset;
Handle timer;
ConVar itvConv;
ConVar enableConv;
ConVar itvMoneyConv;
ConVar killerRate;
ConVar assistRate;
ConVar headshotRate;
int currentRoundMoney[128];
public void OnPluginStart()
{
itvConv = CreateConVar("sm_mfs_interval", "5.0", "MFS Version", FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY, true, 0.1);
enableConv = CreateConVar("sm_mfs_enable", "1", "Enables/Disables the TeamMoney plugin", 0, true, 0.0, true, 1.0);
itvMoneyConv = CreateConVar("sm_mfs_interval_money", "100", "Give money every interval", 0, true, 0.0);
killerRate = CreateConVar("sm_mfs_killer_rate", "50", "When a player deaths, how much money should the killer get", 0, true, 0.0, true, 100.0);
assistRate = CreateConVar("sm_mfs_assister_rate", "25", "When a player deaths, how much money should the assisster get from the killer rate", 0, true, 0.0, true, 100.0);
headshotRate = CreateConVar("sm_mfs_headshot_rate", "200", "How much a headshot will boost the killer rate", 0, true, 100.0);
float interval = GetConVarFloat(itvConv);
money_offset = FindSendPropInfo("CCSPlayer", "m_iAccount");
timer = CreateTimer(interval, TimerFunc, _, TIMER_REPEAT);
HookEvent("round_start", ResetTimer);
HookEvent("player_death", PlayerDeathFunc);
}
public Action PlayerDeathFunc(Event event, const char[] name, bool dontBroadcast)
{
int killer=GetClientOfUserId(GetEventInt(event,"attacker"));
int victim=GetClientOfUserId(GetEventInt(event,"userid"));
int assister=GetClientOfUserId(GetEventInt(event,"assister"));
bool headshot=GetEventBool(event,"headshot");
int kRate = GetConVarInt(killerRate);
int aRate = GetConVarInt(assistRate);
if (headshot)
{
kRate = kRate * GetConVarInt(headshotRate) / 100;
}
int kMoney = currentRoundMoney[victim] * kRate / 100;
if (killer==0 || victim==0 || killer==victim)
{
return Plugin_Continue;
}
kMoney = -AddMoney(victim, -kMoney);
int aMoney = kMoney * aRate / 100;
if (assister>0)
{
kMoney -= aMoney;
AddMoney(assister, aMoney);
}
AddMoney(killer, kMoney);
return Plugin_Continue;
}
public Action ResetTimer(Event event, const char[] name, bool dontBroadcast)
{
for(int i=1;i<=MaxClients;i++)
{
currentRoundMoney[i]=0;
}
KillTimer(timer);
float interval = GetConVarFloat(itvConv);
timer = CreateTimer(interval, TimerFunc, _, TIMER_REPEAT);
return Plugin_Continue;
}
public Action TimerFunc(Handle tm)
{
bool nowEnable = GetConVarBool(enableConv);
int add = GetConVarInt(itvMoneyConv);
if (!nowEnable)
{
return Plugin_Continue;
}
for ( int i = 1; i <= MaxClients; ++i )
{
if (IsPlayerAlive(i))
{
currentRoundMoney[i] += AddMoney(i,add);
}
}
return Plugin_Continue;
}
public int AddMoney(int i,int money)
{
if (!IsClientInGame(i) || IsClientObserver(i) || i>MaxClients || i<=0)
{
return 0;
}
int orig_money = GetEntData(i, money_offset, 2);
int new_money = orig_money + money;
if (new_money>65535)
{
new_money=65535;
}
if(new_money<0)
{
new_money=0;
}
SetEntData(i, money_offset, new_money);
return new_money - orig_money;
}
\ No newline at end of file
This diff is collapsed.
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This file is part of the SourceMod/SourcePawn SDK.
*
* 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>.
*
* Version: $Id$
*/
#if defined _adminmenu_included
#endinput
#endif
#define _adminmenu_included
/* Decide whether topmenus should be required */
#if !defined REQUIRE_PLUGIN
#if defined REQUIRE_EXTENSIONS
#define TEMP_REQUIRE_EXTENSIONS
#undef REQUIRE_EXTENSIONS
#endif
#endif
#include <topmenus>
/* Restore old REQUIRE_EXTENSIONS value if necessary */
#if defined TEMP_REQUIRE_EXTENSIONS
#define REQUIRE_EXTENSIONS
#undef TEMP_REQUIRE_EXTENSIONS
#endif
/** Category for player commands. */
#define ADMINMENU_PLAYERCOMMANDS "PlayerCommands"
/** Category for server commands. */
#define ADMINMENU_SERVERCOMMANDS "ServerCommands"
/** Category for voting commands. */
#define ADMINMENU_VOTINGCOMMANDS "VotingCommands"
/**
* Called when the admin menu is created and 3rd party plugins can grab
* the Handle or add categories.
*
* @param topmenu Handle to the admin menu's TopMenu.
*/
forward void OnAdminMenuCreated(Handle topmenu);
/**
* Called when the admin menu is ready to have items added.
*
* @param topmenu Handle to the admin menu's TopMenu.
*/
forward void OnAdminMenuReady(Handle topmenu);
/**
* Retrieves the Handle to the admin top menu.
*
* @return Handle to the admin menu's TopMenu,
* or INVALID_HANDLE if not created yet.
*/
native TopMenu GetAdminTopMenu();
/**
* Adds targets to an admin menu.
*
* Each client is displayed as: name (userid)
* Each item contains the userid as a string for its info.
*
* @param menu Menu Handle.
* @param source_client Source client, or 0 to ignore immunity.
* @param in_game_only True to only select in-game players.
* @param alive_only True to only select alive players.
* @return Number of clients added.
*/
native int AddTargetsToMenu(Handle menu,
int source_client,
bool in_game_only=true,
bool alive_only=false);
/**
* Adds targets to an admin menu.
*
* Each client is displayed as: name (userid)
* Each item contains the userid as a string for its info.
*
* @param menu Menu Handle.
* @param source_client Source client, or 0 to ignore immunity.
* @param flags COMMAND_FILTER flags from commandfilters.inc.
* @return Number of clients added.
*/
native int AddTargetsToMenu2(Handle menu, int source_client, int flags);
/**
* Re-displays the admin menu to a client after selecting an item.
* Auto-aborts if the Handle is invalid.
*
* @param topmenu TopMenu Handle.
* @param client Client index.
* @return True on success, false on failure.
*/
stock bool RedisplayAdminMenu(Handle topmenu, int client)
{
if (topmenu == INVALID_HANDLE)
{
return false;
}
return DisplayTopMenu(topmenu, client, TopMenuPosition_LastCategory);
}
/* DO NOT EDIT BELOW THIS LINE */
public SharedPlugin __pl_adminmenu =
{
name = "adminmenu",
file = "adminmenu.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_PLUGIN
public void __pl_adminmenu_SetNTVOptional()
{
MarkNativeAsOptional("GetAdminTopMenu");
MarkNativeAsOptional("AddTargetsToMenu");
MarkNativeAsOptional("AddTargetsToMenu2");
}
#endif
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This file is part of the SourceMod/SourcePawn SDK.
*
* 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>.
*
* Version: $Id$
*/
#if defined _adt_included
#endinput
#endif
#define _adt_included
#include <adt_array>
#include <adt_trie>
#include <adt_stack>
This diff is collapsed.
/**
* vim: set ts=4 sw=4 tw=99 noet :
* =============================================================================
* SourceMod (C)2004-2014 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This file is part of the SourceMod/SourcePawn SDK.
*
* 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>.
*
* Version: $Id$
*/
#if defined _adt_stack_included
#endinput
#endif
#define _adt_stack_included
methodmap ArrayStack < Handle
{
// Creates a stack structure. A stack is a LIFO (last in, first out)
// vector (array) of items. It has O(1) insertion and O(1) removal.
//
// Stacks have two operations: Push (adding an item) and Pop (removes
// items in reverse-push order).
//
// The contents of the stack are uniform; i.e. storing a string and then
// retrieving it as an integer is NOT the same as StringToInt()!
//
// The "blocksize" determines how many cells each slot has; it cannot
// be changed after creation.
//
// @param blocksize The number of cells each entry in the stack can
// hold. For example, 32 cells is equivalent to:
// new Array[X][32]
public native ArrayStack(int blocksize=1);
// Clears a stack of all entries.
public native void Clear();
// Clones an stack, returning a new handle with the same size and data.
// This should NOT be confused with CloneHandle. This is a completely new
// handle with the same data but no relation to the original. It should
// closed when no longer needed.
//
// @return New handle to the cloned stack object
public native ArrayStack Clone();
// Pushes a value onto the end of the stack, adding a new index.
//
// This may safely be used even if the stack has a blocksize
// greater than 1.
//
// @param value Value to push.
public native void Push(any value);
// Pushes a copy of a string onto the end of a stack, truncating it if it
// is too big.
//
// @param value String to push.
public native void PushString(const char[] value);
// Pushes a copy of an array of cells onto the end of a stack. The cells
// are pushed as a block (i.e. the entire array takes up one stack slot),
// rather than pushing each cell individually.
//
// @param stack Stack Handle.
// @param values Block of values to copy.
// @param size If not set, the number of elements copied from the array
// will be equal to the blocksize. If set higher than the
// blocksize, the operation will be truncated.
public native void PushArray(const any[] values, int size=-1);
// Pops a cell value from a stack.
//
// @param block Optionally specify which block to read from
// (useful if the blocksize > 0).
// @param asChar Optionally read as a byte instead of a cell.
// @return Value popped from the stack.
// @error The stack is empty.
public native any Pop(int block=0, bool asChar=false);
// Pops a string value from a stack.
//
// @param buffer Buffer to store string.
// @param maxlength Maximum size of the buffer.
// @param written Number of characters written to buffer, not including
// the null terminator.
// @error The stack is empty.
public native void PopString(char[] buffer, int maxlength, int &written = 0);
// Pops an array of cells from a stack.
//
// @param buffer Buffer to store the array in.
// @param size If not set, assumes the buffer size is equal to the
// blocksize. Otherwise, the size passed is used.
// @error The stack is empty.
public native void PopArray(any[] buffer, int size=-1);
// Returns true if the stack is empty, false otherwise.
property bool Empty {
public native get();
}
// Retrieve the blocksize the stack was created with.
property int BlockSize {
public native get();
}
};
/**
* Creates a stack structure. A stack is a LIFO (last in, first out)
* vector (array) of items. It has O(1) insertion and O(1) removal.
*
* Stacks have two operations: Push (adding an item) and Pop (removes
* items in reverse-push order).
*
* The contents of the stack are uniform; i.e. storing a string and then
* retrieving it as an integer is NOT the same as StringToInt()!
*
* The "blocksize" determines how many cells each slot has; it cannot
* be changed after creation.
*
* @param blocksize The number of cells each entry in the stack can
* hold. For example, 32 cells is equivalent to:
* new Array[X][32]
* @return New stack Handle.
*/
native ArrayStack CreateStack(int blocksize=1);
/**
* Pushes a value onto the end of the stack, adding a new index.
*
* This may safely be used even if the stack has a blocksize
* greater than 1.
*
* @param stack Stack Handle.
* @param value Value to push.
* @error Invalid Handle or out of memory.
*/
native void PushStackCell(Handle stack, any value);
/**
* Pushes a copy of a string onto the end of a stack, truncating it if it is
* too big.
*
* @param stack Stack Handle.
* @param value String to push.
* @error Invalid Handle or out of memory.
*/
native void PushStackString(Handle stack, const char[] value);
/**
* Pushes a copy of an array of cells onto the end of a stack. The cells
* are pushed as a block (i.e. the entire array takes up one stack slot),
* rather than pushing each cell individually.
*
* @param stack Stack Handle.
* @param values Block of values to copy.
* @param size If not set, the number of elements copied from the array
* will be equal to the blocksize. If set higher than the
* blocksize, the operation will be truncated.
* @error Invalid Handle or out of memory.
*/
native void PushStackArray(Handle stack, const any[] values, int size=-1);
/**
* Pops a cell value from a stack.
*
* @param stack Stack Handle.
* @param value Variable to store the value.
* @param block Optionally specify which block to read from
* (useful if the blocksize > 0).
* @param asChar Optionally read as a byte instead of a cell.
* @return True on success, false if the stack is empty.
* @error Invalid Handle.
*/
native bool PopStackCell(Handle stack, any &value, int block=0, bool asChar=false);
/**
* Pops a string value from a stack.
*
* @param stack Stack Handle.
* @param buffer Buffer to store string.
* @param maxlength Maximum size of the buffer.
* @return True on success, false if the stack is empty.
* @error Invalid Handle.
*/
native bool PopStackString(Handle stack, char[] buffer, int maxlength, int &written=0);
/**
* Pops an array of cells from a stack.
*
* @param stack Stack Handle.
* @param buffer Buffer to store the array in.
* @param size If not set, assumes the buffer size is equal to the
* blocksize. Otherwise, the size passed is used.
* @return True on success, false if the stack is empty.
* @error Invalid Handle.
*/
native bool PopStackArray(Handle stack, any[] buffer, int size=-1);
/**
* Checks if a stack is empty.
*
* @param stack Stack Handle.
* @return True if empty, false if not empty.
* @error Invalid Handle.
*/
native bool IsStackEmpty(Handle stack);
/**
* Pops a value off a stack, ignoring it completely.
*
* @param stack Stack Handle.
* @return True if something was popped, false otherwise.
* @error Invalid Handle.
*/
stock bool PopStack(Handle stack)
{
int value;
return PopStackCell(stack, value);
}
/**
* Returns the blocksize the stack was created with.
*
* @param stack Stack Handle.
* @return The blocksize of the stack.
* @error Invalid Handle
*/
native int GetStackBlockSize(Handle stack);
This diff is collapsed.
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This file is part of the SourceMod/SourcePawn SDK.
*
* 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>.
*
* Version: $Id$
*/
#if defined _banning_included
#endinput
#endif
#define _banning_included
#define BANFLAG_AUTO (1<<0) /**< Auto-detects whether to ban by steamid or IP */
#define BANFLAG_IP (1<<1) /**< Always ban by IP address */
#define BANFLAG_AUTHID (1<<2) /**< Always ban by authstring (for BanIdentity) if possible */
#define BANFLAG_NOKICK (1<<3) /**< Does not kick the client */
/**
* Called for calls to BanClient() with a non-empty command.
*
* @param client Client being banned.
* @param time Time the client is being banned for (0 = permanent).
* @param flags One if AUTHID or IP will be enabled. If AUTO is also
* enabled, it means Core autodetected which to use.
* @param reason Reason passed via BanClient().
* @param kick_message Kick message passed via BanClient().
* @param command Command string to identify the ban source.
* @param source Source value passed via BanClient().
* @return Plugin_Handled to block the actual server banning.
* Kicking will still occur.
*/
forward Action OnBanClient(int client,
int time,
int flags,
const char[] reason,
const char[] kick_message,
const char[] command,
any source);
/**
* Called for calls to BanIdentity() with a non-empty command.
*
* @param identity Identity string being banned (authstring or ip).
* @param time Time the client is being banned for (0 = permanent).
* @param flags Ban flags (only IP or AUTHID are valid here).
* @param reason Reason passed via BanIdentity().
* @param command Command string to identify the ban source.
* @param source Source value passed via BanIdentity().
* @return Plugin_Handled to block the actual server banning.
*/
forward Action OnBanIdentity(const char[] identity,
int time,
int flags,
const char[] reason,
const char[] command,
any source);
/**
* Called for calls to RemoveBan() with a non-empty command.
*
* @param identity Identity string being banned (authstring or ip).
* @param flags Ban flags (only IP or AUTHID are valid here).
* @param command Command string to identify the ban source.
* @param source Source value passed via BanIdentity().
* @return Plugin_Handled to block the actual unbanning.
*/
forward Action OnRemoveBan(const char[] identity,
int flags,
const char[] command,
any source);
/**
* Bans a client.
*
* @param client Client being banned.
* @param time Time (in minutes) to ban (0 = permanent).
* @param flags Flags for controlling the ban mechanism. If AUTHID
* is set and no AUTHID is available, the ban will fail
* unless AUTO is also flagged.
* @param reason Reason to ban the client for.
* @param kick_message Message to display to the user when kicking.
* @param command Command string to identify the source. If this is left
* empty, then the OnBanClient forward will not be called.
* @param source A source value that could be interpreted as a player
* index of any sort (not actually checked by Core).
* @return True on success, false on failure.
* @error Invalid client index or client not in game.
*/
native bool BanClient(int client,
int time,
int flags,
const char[] reason,
const char[] kick_message="",
const char[] command="",
any source=0);
/**
* Bans an identity (either an IP address or auth string).
*
* @param identity String to ban (ip or authstring).
* @param time Time to ban for (0 = permanent).
* @param flags Flags (only IP and AUTHID are valid flags here).
* @param reason Ban reason string.
* @param command Command string to identify the source. If this is left
* empty, then the OnBanIdentity forward will not be called.
* @param source A source value that could be interpreted as a player
* index of any sort (not actually checked by Core).
* @return True on success, false on failure.
*/
native bool BanIdentity(const char[] identity,
int time,
int flags,
const char[] reason,
const char[] command="",
any source=0);
/**
* Removes a ban that was written to the server (either in memory or on disk).
*
* @param identity String to unban (ip or authstring).
* @param flags Flags (only IP and AUTHID are valid flags here).
* @param command Command string to identify the source. If this is left
* empty, then OnRemoveBan will not be called.
* @param source A source value that could be interpreted as a player
* index of any sort (not actually checked by Core).
* @return True on success, false on failure.
*/
native bool RemoveBan(const char[] identity,
int flags,
const char[] command="",
any source=0);
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod (C)2004-2011 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This file is part of the SourceMod/SourcePawn SDK.
*
* 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>.
*
* Version: $Id$
*/
#if defined _basecomm_included
#endinput
#endif
#define _basecomm_included
/**
* Called when a client is muted or unmuted
*
* @param client Client index
* @param muteState True if client was muted, false otherwise
*/
forward void BaseComm_OnClientMute(int client, bool muteState);
/**
* Called when a client is gagged or ungagged
*
* @param client Client index
* @param gagState True if client was gaged, false otherwise
*/
forward void BaseComm_OnClientGag(int client, bool gagState);
/**
* Returns whether or not a client is gagged
*
* @param client Client index.
* @return True if client is gagged, false otherwise.
*/
native bool BaseComm_IsClientGagged(int client);
/**
* Returns whether or not a client is muted
*
* @param client Client index.
* @return True if client is muted, false otherwise.
*/
native bool BaseComm_IsClientMuted(int client);
/**
* Sets a client's gag state
*
* @param client Client index.
* @param gagState True to gag client, false to ungag.
* @return True if this caused a change in gag state, false otherwise.
*/
native bool BaseComm_SetClientGag(int client, bool gagState);
/**
* Sets a client's mute state
*
* @param client Client index.
* @param muteState True to mute client, false to unmute.
* @return True if this caused a change in mute state, false otherwise.
*/
native bool BaseComm_SetClientMute(int client, bool muteState);
/* DO NOT EDIT BELOW THIS LINE */
public SharedPlugin __pl_basecomm =
{
name = "basecomm",
file = "basecomm.smx",
#if defined REQUIRE_PLUGIN
required = 1,
#else
required = 0,
#endif
};
#if !defined REQUIRE_PLUGIN
public void __pl_basecomm_SetNTVOptional()
{
MarkNativeAsOptional("BaseComm_IsClientGagged");
MarkNativeAsOptional("BaseComm_IsClientMuted");
MarkNativeAsOptional("BaseComm_SetClientGag");
MarkNativeAsOptional("BaseComm_SetClientMute");
}
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This file is part of the SourceMod/SourcePawn SDK.
*
* 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>.
*
* Version: $Id$
*/
#if defined _commandfilters_included
#endinput
#endif
#define _commandfilters_included
#define MAX_TARGET_LENGTH 64
#define COMMAND_FILTER_ALIVE (1<<0) /**< Only allow alive players */
#define COMMAND_FILTER_DEAD (1<<1) /**< Only filter dead players */
#define COMMAND_FILTER_CONNECTED (1<<2) /**< Allow players not fully in-game */
#define COMMAND_FILTER_NO_IMMUNITY (1<<3) /**< Ignore immunity rules */
#define COMMAND_FILTER_NO_MULTI (1<<4) /**< Do not allow multiple target patterns */
#define COMMAND_FILTER_NO_BOTS (1<<5) /**< Do not allow bots to be targetted */
#define COMMAND_TARGET_NONE 0 /**< No target was found */
#define COMMAND_TARGET_NOT_ALIVE -1 /**< Single client is not alive */
#define COMMAND_TARGET_NOT_DEAD -2 /**< Single client is not dead */
#define COMMAND_TARGET_NOT_IN_GAME -3 /**< Single client is not in game */
#define COMMAND_TARGET_IMMUNE -4 /**< Single client is immune */
#define COMMAND_TARGET_EMPTY_FILTER -5 /**< A multi-filter (such as @all) had no targets */
#define COMMAND_TARGET_NOT_HUMAN -6 /**< Target was not human */
#define COMMAND_TARGET_AMBIGUOUS -7 /**< Partial name had too many targets */
/**
* Processes a generic command target string, and resolves it to a list
* of clients or one client, based on filtering rules and a pattern.
*
* Note that you should use LoadTranslations("common.phrases") in OnPluginStart(),
* as that file is guaranteed to contain all of the translatable phrases that
* ProcessTargetString() will return.
*
* @param pattern Pattern to find clients against.
* @param admin Admin performing the action, or 0 if the server.
* @param targets Array to hold targets.
* @param max_targets Maximum size of the targets array.
* @param filter_flags Filter flags.
* @param target_name Buffer to store the target name.
* @param tn_maxlength Maximum length of the target name buffer.
* @param tn_is_ml OUTPUT: Will be true if the target name buffer is an ML phrase,
* false if it is a normal string.
* @return If a multi-target pattern was used, the number of clients found
* is returned. If a single-target pattern was used, 1 is returned
* if one valid client is found. Otherwise, a COMMAND_TARGET reason
* for failure is returned.
*/
native int ProcessTargetString(const char[] pattern,
int admin,
int[] targets,
int max_targets,
int filter_flags,
char[] target_name,
int tn_maxlength,
bool &tn_is_ml);
/**
* Replies to a client with a given message describing a targetting
* failure reason.
*
* Note: The translation phrases are found in common.phrases.txt.
*
* @param client Client index, or 0 for server.
* @param reason COMMAND_TARGET reason.
*/
stock void ReplyToTargetError(int client, int reason)
{
switch (reason)
{
case COMMAND_TARGET_NONE:
{
ReplyToCommand(client, "[SM] %t", "No matching client");
}
case COMMAND_TARGET_NOT_ALIVE:
{
ReplyToCommand(client, "[SM] %t", "Target must be alive");
}
case COMMAND_TARGET_NOT_DEAD:
{
ReplyToCommand(client, "[SM] %t", "Target must be dead");
}
case COMMAND_TARGET_NOT_IN_GAME:
{
ReplyToCommand(client, "[SM] %t", "Target is not in game");
}
case COMMAND_TARGET_IMMUNE:
{
ReplyToCommand(client, "[SM] %t", "Unable to target");
}
case COMMAND_TARGET_EMPTY_FILTER:
{
ReplyToCommand(client, "[SM] %t", "No matching clients");
}
case COMMAND_TARGET_NOT_HUMAN:
{
ReplyToCommand(client, "[SM] %t", "Cannot target bot");
}
case COMMAND_TARGET_AMBIGUOUS:
{
ReplyToCommand(client, "[SM] %t", "More than one client matched");
}
}
}
#define FEATURECAP_MULTITARGETFILTER_CLIENTPARAM "SourceMod MultiTargetFilter ClientParam"
/**
* Adds clients to a multi-target filter.
*
* @param pattern Pattern name.
* @param clients Array to fill with unique, valid client indexes.
* @param client Client that triggered this filter.
* @return True if pattern was recognized, false otherwise.
*
* @note To see if the client param is available, use FeatureType_Capability and FEATURECAP_MULTITARGETFILTER_CLIENTPARAM.
*/
typeset MultiTargetFilter {
function bool (const char[] pattern, Handle clients);
function bool (const char[] pattern, ArrayList clients);
function bool (const char[] pattern, Handle clients, int client);
function bool (const char[] pattern, ArrayList clients, int client);
}
/**
* Adds a multi-target filter function for ProcessTargetString().
*
* @param pattern Pattern to match (case sensitive).
* @param filter Filter function.
* @param phrase Descriptive phrase to display on successful match.
* @param phraseIsML True if phrase is multi-lingual, false otherwise.
*/
native void AddMultiTargetFilter(const char[] pattern, MultiTargetFilter filter,
const char[] phrase, bool phraseIsML);
/**
* Removes a multi-target filter function from ProcessTargetString().
*
* @param pattern Pattern to match (case sensitive).
* @param filter Filter function.
*/
native void RemoveMultiTargetFilter(const char[] pattern, MultiTargetFilter filter);
/**
* vim: set ts=4 :
* =============================================================================
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This file is part of the SourceMod/SourcePawn SDK.
*
* 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>.
*
* Version: $Id$
*/
#if defined _commandline_included_
#endinput
#endif
#define _commandline_included_
/**
* Gets the full command line the server was launched with.
*
* @param commandLine Buffer to store the command line in.
* @param maxlen Maximum length of the command line buffer.
* @return True if the command line is valid; otherwise, false.
* @error No command line available, or no mod support.
*/
native bool GetCommandLine(char[] commandLine, int maxlen);
/**
* Gets the value of a command line parameter the server was launched with.
*
* @param param The command line parameter to get the value of.
* @param value Buffer to store the parameter value in.
* @param maxlen Maximum length of the value buffer.
* @param defValue The default value to return if the parameter wasn't specified.
* @error No command line available, or no mod support.
*/
native void GetCommandLineParam(const char[] param, char[] value, int maxlen, const char[] defValue="");
/**
* Gets the value of a command line parameter the server was launched with.
*
* @param param The command line parameter to get the value of.
* @param defValue The default value to return if the parameter wasn't specified.
* @return The integer value of the command line parameter value.
* @error No command line available, or no mod support.
*/
native int GetCommandLineParamInt(const char[] param, int defValue=0);
/**
* Gets the value of a command line parameter the server was launched with.
*
* @param param The command line parameter to get the value of.
* @param defValue The default value to return if the parameter wasn't specified.
* @return The floating point value of the command line parameter value.
* @error No command line available, or no mod support.
*/
native float GetCommandLineParamFloat(const char[] param, float defValue=0.0);
/**
* Determines if a specific command line parameter is present.
*
* @param param The command line parameter to test.
* @return True if the command line parameter is specified; otherwise, false.
* @error No command line available, or no mod support.
*/
native bool FindCommandLineParam(const char[] param);
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#if defined _auto_version_included
#endinput
#endif
#define _auto_version_included
#define SOURCEMOD_V_TAG ""
#define SOURCEMOD_V_CSET "855ece1d"
#define SOURCEMOD_V_MAJOR 1
#define SOURCEMOD_V_MINOR 12
#define SOURCEMOD_V_RELEASE 0
#define SOURCEMOD_V_REV 6925
#define SOURCEMOD_VERSION "1.12.0.6925"
\ No newline at end of file
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment