-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
86f6a9a
commit de92668
Showing
2,733 changed files
with
325,405 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
"Configs" | ||
{ | ||
"*" | ||
{ | ||
"clients:0" "10:emptyserver.cfg" | ||
"clients:1" "10:nonemptyserver.cfg" | ||
"event:player_spawn" "0:spawn.cfg" | ||
"round:1" "3:firstround.cfg" | ||
"timeleft:0" "1:timelimit.cfg" | ||
} | ||
"ctf" | ||
{ | ||
"event:ctf_flag_captured" "2:flag_captured.cfg" | ||
"round:2" "5:secondround.cfg" | ||
} | ||
"cp_dustbowl" | ||
{ | ||
"timeleft:15" "0:switchteams.cfg" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
#pragma semicolon 1 | ||
#include <sourcemod> | ||
#include <sdktools> | ||
#include <namechange> | ||
#define MAX_NAME_LEGNTH 64 | ||
public Plugin:myinfo = | ||
{ | ||
name = "Rename2", | ||
author = "Kyle Sanderson, AlliedModders LLC", | ||
description = "Allows you to rename a player using Drifter's extension", | ||
version = "1.0", | ||
url = "www.SourceMod.net" | ||
} | ||
|
||
new g_ModVersion = 0; | ||
new String:g_NewName[MAXPLAYERS+2][MAX_NAME_LENGTH]; | ||
|
||
public OnPluginStart() | ||
{ | ||
RegAdminCmd("sm_rename2", Command_Rename, ADMFLAG_SLAY, "Allows you to rename a player provided you're using Drifter's Extension."); | ||
g_ModVersion = GuessSDKVersion(); | ||
LoadTranslations("common.phrases"); | ||
LoadTranslations("playercommands.phrases"); | ||
} | ||
|
||
public Action:Command_Rename(client, args) | ||
{ | ||
if (args < 1) | ||
{ | ||
ReplyToCommand(client, "\x04[SourceMod]\x03 Usage: sm_rename2 <#userid|name> [newname]"); | ||
return Plugin_Handled; | ||
} | ||
|
||
decl String:arg[MAX_NAME_LENGTH], String:arg2[MAX_NAME_LENGTH]; | ||
GetCmdArg(1, arg, sizeof(arg)); | ||
|
||
new bool:randomize; | ||
if (args > 1) | ||
{ | ||
GetCmdArg(2, arg2, sizeof(arg2)); | ||
} | ||
else | ||
{ | ||
randomize = true; | ||
} | ||
|
||
decl String:target_name[MAX_TARGET_LENGTH]; | ||
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml; | ||
|
||
if ((target_count = ProcessTargetString( | ||
arg, | ||
client, | ||
target_list, | ||
MAXPLAYERS, | ||
COMMAND_TARGET_NONE, | ||
target_name, | ||
sizeof(target_name), | ||
tn_is_ml)) > 0) | ||
{ | ||
if (tn_is_ml) | ||
{ | ||
ShowActivity2(client, "\x04[SourceMod]\x03 ", "%t", "Renamed target", target_name); | ||
} | ||
else | ||
{ | ||
ShowActivity2(client, "\x04[SourceMod]\x03 ", "%t", "Renamed target", "_s", target_name); | ||
} | ||
|
||
if (target_count > 1) /* We cannot name everyone the same thing. */ | ||
{ | ||
randomize = true; | ||
} | ||
|
||
for (new i = 0; i < target_count; i++) | ||
{ | ||
if(randomize) | ||
{ | ||
RandomizeName(target_list[i]); | ||
} | ||
else | ||
{ | ||
FormatEx(g_NewName[target_list[i]], MAX_NAME_LENGTH, "%s", arg2); | ||
} | ||
PerformRename(client, target_list[i]); | ||
} | ||
} | ||
else | ||
{ | ||
ReplyToTargetError(client, target_count); | ||
} | ||
return Plugin_Handled; | ||
} | ||
|
||
RandomizeName(client) | ||
{ | ||
decl String:name[MAX_NAME_LENGTH]; | ||
GetClientName(client, name, sizeof(name)); | ||
|
||
new len = strlen(name); | ||
g_NewName[client][0] = '\0'; | ||
|
||
for (new i = 0; i < len; i++) | ||
{ | ||
g_NewName[client][i] = name[GetRandomInt(0, len - 1)]; | ||
} | ||
g_NewName[client][len] = '\0'; | ||
} | ||
|
||
PerformRename(client, target) | ||
{ | ||
LogAction(client, target, "\"%L\" renamed \"%L\" to \"%s\")", client, target, g_NewName[target]); | ||
|
||
/* Used on OB / L4D engine */ | ||
if (g_ModVersion > SOURCE_SDK_EPISODE1) | ||
{ | ||
SetClientInfo(target, "name", g_NewName[target]); | ||
} | ||
else /* Used on CSS and EP1 / older engine */ | ||
{ | ||
if (!IsPlayerAlive(target)) /* Lets tell them about the player renamed on the next round since they're dead. */ | ||
{ | ||
decl String:m_TargetName[MAX_NAME_LENGTH]; | ||
|
||
GetClientName(target, m_TargetName, sizeof(m_TargetName)); | ||
ReplyToCommand(client, "\x04[SourceMod]\x03 %t", "Dead Player Rename", m_TargetName); | ||
} | ||
ClientCommand(target, "name %s", g_NewName[target]); | ||
} | ||
} | ||
|
||
public Action:OnChangePlayerName(client, String:name[], String:oldname[]) | ||
{ | ||
if(StrEqual, name, g_NewName[client][0]) | ||
{ | ||
g_NewName[client][0] = '\0'; | ||
return Plugin_Handled; | ||
} | ||
|
||
return Plugin_Continue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
/* | ||
This file is part of SourcePawn SteamWorks. | ||
SourcePawn SteamWorks is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, as per version 3 of the License. | ||
SourcePawn SteamWorks 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 SourcePawn SteamWorks. If not, see <http://www.gnu.org/licenses/>. | ||
Author: Kyle Sanderson (KyleS). | ||
*/ | ||
|
||
#pragma semicolon 1 | ||
#include <sourcemod> | ||
#include <SteamWorks> | ||
|
||
new Handle:g_hSteamServersConnected = INVALID_HANDLE; | ||
new Handle:g_hSteamServersDisconnected = INVALID_HANDLE; | ||
|
||
public Plugin:myinfo = { | ||
name = "SteamWorks Additive Glider", /* SWAG */ | ||
author = "Kyle Sanderson", | ||
description = "Translates SteamTools calls into SteamWorks calls.", | ||
version = "1.0", | ||
url = "http://AlliedMods.net" | ||
}; | ||
|
||
public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max) | ||
{ | ||
CreateNative("Steam_IsVACEnabled", native_IsVACEnabled); | ||
CreateNative("Steam_GetPublicIP", native_GetPublicIP); | ||
CreateNative("Steam_SetGameDescription", native_SetGameDescription); | ||
CreateNative("Steam_IsConnected", native_IsConnected); | ||
CreateNative("Steam_SetRule", native_SetRule); | ||
CreateNative("Steam_ClearRules", native_ClearRules); | ||
CreateNative("Steam_ForceHeartbeat", native_ForceHeartbeat); | ||
|
||
g_hSteamServersConnected = CreateGlobalForward("Steam_SteamServersConnected", ET_Ignore); | ||
g_hSteamServersDisconnected = CreateGlobalForward("Steam_SteamServersDisconnected", ET_Ignore); | ||
return APLRes_Success; | ||
} | ||
|
||
public native_IsVACEnabled(Handle:plugin, numParams) | ||
{ | ||
return SteamWorks_IsVACEnabled(); | ||
} | ||
|
||
public native_GetPublicIP(Handle:plugin, numParams) | ||
{ | ||
new addr[4]; | ||
SteamWorks_GetPublicIP(addr); | ||
SetNativeArray(1, addr, sizeof(addr)); | ||
return 1; | ||
} | ||
|
||
public native_SetGameDescription(Handle:plugin, numParams) | ||
{ | ||
decl String:sDesc[PLATFORM_MAX_PATH]; | ||
GetNativeString(1, sDesc, sizeof(sDesc)); | ||
return SteamWorks_SetGameDescription(sDesc); | ||
} | ||
|
||
public native_IsConnected(Handle:plugin, numParams) | ||
{ | ||
return SteamWorks_IsConnected(); | ||
} | ||
|
||
public native_SetRule(Handle:plugin, numParams) | ||
{ | ||
decl String:sKey[PLATFORM_MAX_PATH], String:sValue[PLATFORM_MAX_PATH]; | ||
GetNativeString(1, sKey, sizeof(sKey)); | ||
GetNativeString(2, sValue, sizeof(sValue)); | ||
return SteamWorks_SetRule(sKey, sValue); | ||
} | ||
|
||
public native_ClearRules(Handle:plugin, numParams) | ||
{ | ||
return SteamWorks_ClearRules(); | ||
} | ||
|
||
public native_ForceHeartbeat(Handle:plugin, numParams) | ||
{ | ||
return SteamWorks_ForceHeartbeat(); | ||
} | ||
|
||
public SteamWorks_SteamServersConnected() | ||
{ | ||
if (GetForwardFunctionCount(g_hSteamServersConnected) == 0) | ||
{ | ||
return; | ||
} | ||
|
||
Call_StartForward(g_hSteamServersConnected); | ||
Call_Finish(); | ||
} | ||
|
||
public SteamWorks_SteamServersDisconnected() | ||
{ | ||
if (GetForwardFunctionCount(g_hSteamServersDisconnected) == 0) | ||
{ | ||
return; | ||
} | ||
|
||
Call_StartForward(g_hSteamServersDisconnected); | ||
Call_Finish(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/** | ||
* vim: set ts=4 : | ||
* ============================================================================= | ||
* SourceMod Admin File Reader Plugin | ||
* Manages the standard flat files for admins. This is the file to compile. | ||
* | ||
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. | ||
* ============================================================================= | ||
* | ||
* 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$ | ||
*/ | ||
|
||
/* We like semicolons */ | ||
#pragma semicolon 1 | ||
|
||
#include <sourcemod> | ||
|
||
public Plugin:myinfo = | ||
{ | ||
name = "Admin File Reader", | ||
author = "AlliedModders LLC", | ||
description = "Reads admin files", | ||
version = SOURCEMOD_VERSION, | ||
url = "http://www.sourcemod.net/" | ||
}; | ||
|
||
/** Various parsing globals */ | ||
new bool:g_LoggedFileName = false; /* Whether or not the file name has been logged */ | ||
new g_ErrorCount = 0; /* Current error count */ | ||
new g_IgnoreLevel = 0; /* Nested ignored section count, so users can screw up files safely */ | ||
new g_CurrentLine = 0; /* Current line we're on */ | ||
new String:g_Filename[PLATFORM_MAX_PATH]; /* Used for error messages */ | ||
|
||
#include "admin-overrides.sp" | ||
#include "admin-groups.sp" | ||
#include "admin-users.sp" | ||
#include "admin-simple.sp" | ||
|
||
public OnRebuildAdminCache(AdminCachePart:part) | ||
{ | ||
if (part == AdminCache_Overrides) | ||
{ | ||
ReadOverrides(); | ||
} else if (part == AdminCache_Groups) { | ||
ReadGroups(); | ||
} else if (part == AdminCache_Admins) { | ||
ReadUsers(); | ||
ReadSimpleUsers(); | ||
} | ||
} | ||
|
||
ParseError(const String:format[], any:...) | ||
{ | ||
decl String:buffer[512]; | ||
|
||
if (!g_LoggedFileName) | ||
{ | ||
LogError("Error(s) detected parsing %s", g_Filename); | ||
g_LoggedFileName = true; | ||
} | ||
|
||
VFormat(buffer, sizeof(buffer), format, 2); | ||
|
||
LogError(" (line %d) %s", g_CurrentLine, buffer); | ||
|
||
g_ErrorCount++; | ||
} | ||
|
||
InitGlobalStates() | ||
{ | ||
g_ErrorCount = 0; | ||
g_IgnoreLevel = 0; | ||
g_CurrentLine = 0; | ||
g_LoggedFileName = false; | ||
} |
Oops, something went wrong.