diff --git a/core/CoreConfig.cpp b/core/CoreConfig.cpp index 6e71ee57..e9c1df6b 100644 --- a/core/CoreConfig.cpp +++ b/core/CoreConfig.cpp @@ -214,14 +214,28 @@ void CoreConfig::Initialize() /* Try to get command line value of core config convar */ const char *corecfg = icvar->GetCommandLineValue("sm_corecfgfile"); - /* If sm_corecfgfile not specified on command line, use default value */ - if (!corecfg) + /* If sm_corecfgfile is on the command line, use that + * If sm_corecfgfile isn't there, check sm_basepath on the command line and build the path off that + * If sm_basepath isn't there, just use the default path for the cfg + */ + if (corecfg) { - corecfg = sm_corecfgfile.GetDefault(); + g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s", g_SourceMod.GetGamePath(), corecfg); } + else + { + const char *basepath = icvar->GetCommandLineValue("sm_basepath"); - /* Format path to config file */ - g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s", g_SourceMod.GetGamePath(), corecfg); + /* Format path to config file */ + if (basepath) + { + g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s/%s", g_SourceMod.GetGamePath(), basepath, "configs/core.cfg"); + } + else + { + g_LibSys.PathFormat(filePath, sizeof(filePath), "%s/%s", g_SourceMod.GetGamePath(), sm_corecfgfile.GetDefault()); + } + } /* Reset cached key values */ m_KeyValues.clear(); diff --git a/gamedata/core.games/common.games.txt b/gamedata/core.games/common.games.txt index ea554458..8c216188 100644 --- a/gamedata/core.games/common.games.txt +++ b/gamedata/core.games/common.games.txt @@ -128,7 +128,7 @@ "game" "synergy" "game" "left4dead" "game" "obsidian" - "game" "ageofchivalry" + "game" "empires" } "Keys" @@ -145,7 +145,7 @@ "game" "tf" "game" "synergy" "game" "dod" - "game" "ageofchivalry" + "game" "empires" } "Keys" @@ -190,4 +190,11 @@ "GameExtension" "game.tf2" } } + "insurgency" + { + "Keys" + { + "ChatSayText" "yes" + } + } } diff --git a/gamedata/core.games/engine.ep2.txt b/gamedata/core.games/engine.ep2.txt index 74a698ba..0e3f4f0d 100644 --- a/gamedata/core.games/engine.ep2.txt +++ b/gamedata/core.games/engine.ep2.txt @@ -19,7 +19,7 @@ "game" "dod" "game" "tf" "game" "ageofchivalry" - "game" "ZPS" + "game" "zps" } "Offsets" diff --git a/gamedata/sdktools.games/engine.ep1.txt b/gamedata/sdktools.games/engine.ep1.txt index 337e5069..fcaf0d8a 100644 --- a/gamedata/sdktools.games/engine.ep1.txt +++ b/gamedata/sdktools.games/engine.ep1.txt @@ -24,7 +24,6 @@ "game" "pvkii" "game" "sourceforts" "game" "FortressForever" - "game" "empires" "game" "synergy" "game" "hidden" "game" "zombie_master" @@ -83,7 +82,6 @@ "game" "pvkii" "game" "sourceforts" "game" "FortressForever" - "game" "empires" "game" "synergy" "game" "hidden" } @@ -133,7 +131,6 @@ "game" "pvkii" "game" "sourceforts" "game" "FortressForever" - "game" "empires" "game" "synergy" "game" "hidden" "game" "zombie_master" @@ -161,7 +158,6 @@ "game" "insurgency" "game" "pvkii" "game" "sourceforts" - "game" "empires" "game" "synergy" "game" "hidden" "game" "FortressForever" diff --git a/gamedata/sdktools.games/engine.ep2.txt b/gamedata/sdktools.games/engine.ep2.txt index 7216f73c..678b3cfd 100644 --- a/gamedata/sdktools.games/engine.ep2.txt +++ b/gamedata/sdktools.games/engine.ep2.txt @@ -19,7 +19,8 @@ "game" "dod" "game" "tf" "game" "ageofchivalry" - "game" "ZPS" + "game" "zps" + "game" "empires" } "Offsets" @@ -69,7 +70,8 @@ "game" "dod" "game" "tf" "game" "ageofchivalry" - "game" "ZPS" + "game" "zps" + "game" "empires" } "Signatures" @@ -97,7 +99,8 @@ "game" "dod" "game" "tf" "game" "ageofchivalry" - "game" "ZPS" + "game" "zps" + "game" "empires" } "Signatures" @@ -120,7 +123,8 @@ "game" "dod" "game" "tf" "game" "ageofchivalry" - "game" "ZPS" + "game" "zps" + "game" "empires" } "Offsets" diff --git a/gamedata/sdktools.games/game.aoc.txt b/gamedata/sdktools.games/game.aoc.txt index a3668064..f50eaea9 100644 --- a/gamedata/sdktools.games/game.aoc.txt +++ b/gamedata/sdktools.games/game.aoc.txt @@ -11,35 +11,35 @@ "Games" { - /* Age of Chivalry */ + /* Age of Chivalry (CR2) */ "ageofchivalry" { "Offsets" { "GiveNamedItem" { - "windows" "351" - "linux" "352" + "windows" "352" + "linux" "353" } "RemovePlayerItem" { - "windows" "239" - "linux" "240" + "windows" "240" + "linux" "241" } "Weapon_GetSlot" { - "windows" "237" - "linux" "238" + "windows" "238" + "linux" "239" } "Ignite" { - "windows" "194" - "linux" "195" + "windows" "195" + "linux" "196" } "Extinguish" { - "windows" "198" - "linux" "199" + "windows" "199" + "linux" "200" } "Teleport" { @@ -48,8 +48,8 @@ } "CommitSuicide" { - "windows" "389" - "linux" "389" + "windows" "390" + "linux" "390" } "GetVelocity" { @@ -88,8 +88,8 @@ } "WeaponEquip" { - "windows" "230" - "linux" "231" + "windows" "231" + "linux" "232" } "Activate" { diff --git a/gamedata/sdktools.games/game.empires.txt b/gamedata/sdktools.games/game.empires.txt index 4ae53cdf..872b8390 100644 --- a/gamedata/sdktools.games/game.empires.txt +++ b/gamedata/sdktools.games/game.empires.txt @@ -11,7 +11,7 @@ "Games" { - /* Empires 2 */ + /* Empires 2.24 */ "empires" { @@ -19,99 +19,89 @@ { "GiveNamedItem" { - "windows" "332" - "linux" "333" + "windows" "354" + "linux" "355" } "RemovePlayerItem" { - "windows" "230" - "linux" "231" + "windows" "241" + "linux" "242" } "Weapon_GetSlot" { - "windows" "228" - "linux" "229" + "windows" "239" + "linux" "240" } "Ignite" { - "windows" "192" - "linux" "193" + "windows" "196" + "linux" "197" } "Extinguish" { - "windows" "193" - "linux" "194" + "windows" "200" + "linux" "201" } "Teleport" { - "windows" "102" - "linux" "103" + "windows" "104" + "linux" "105" } "CommitSuicide" { - "windows" "360" - "linux" "361" + "windows" "401" + "linux" "402" } "GetVelocity" { - "windows" "130" - "linux" "131" + "windows" "133" + "linux" "134" } "EyeAngles" { - "windows" "122" - "linux" "123" - } - "AcceptInput" - { - "windows" "36" - "linux" "37" + "windows" "125" + "linux" "126" } "DispatchKeyValue" { - "windows" "31" - "linux" "30" + "windows" "29" + "linux" "28" } "DispatchKeyValueFloat" { - "windows" "30" - "linux" "31" + "windows" "28" + "linux" "29" } "DispatchKeyValueVector" { - "windows" "29" - "linux" "32" + "windows" "27" + "linux" "30" } - "SetEntityModel" + "AcceptInput" { - "windows" "25" - "linux" "26" - } - "WeaponEquip" - { - "windows" "221" - "linux" "222" + "windows" "35" + "linux" "36" } "Activate" { - "windows" "32" - "linux" "33" + "windows" "31" + "linux" "32" } - - /* Offset into LevelShutdown for CGlobalEntList */ - "gEntList" + "TakeHealth" { - "windows" "64" + "windows" "62" + "linux" "63" } - } - - "Signatures" - { - "LevelShutdown" + "ChangeTeam" { - "library" "server" - "windows" "\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x74\x2B\x56\xE8\x2A\x2A\x2A\x2A\x8B\x0D\x2A\x2A\x2A\x2A\x85\xC9\x8B\xF1\x74\x0E" + "windows" "87" + "linux" "88" + } + "SetEntityModel" + { + "windows" "23" + "linux" "24" } } } -} \ No newline at end of file +} diff --git a/gamedata/sdktools.games/game.insurgency.txt b/gamedata/sdktools.games/game.insurgency.txt index 6a81ba9e..ebedd446 100644 --- a/gamedata/sdktools.games/game.insurgency.txt +++ b/gamedata/sdktools.games/game.insurgency.txt @@ -11,36 +11,36 @@ "Games" { - /* Insurgency */ + /* Insurgency (2009-07-10) */ "insurgency" { "Offsets" { /* CBasePlayer */ "Ignite" - { - "windows" "174" - "linux" "175" - } - "Extinguish" { "windows" "175" "linux" "176" } + "Extinguish" + { + "windows" "176" + "linux" "177" + } "Teleport" { - "windows" "90" - "linux" "91" + "windows" "91" + "linux" "92" } "GetVelocity" { - "windows" "115" - "linux" "116" + "windows" "116" + "linux" "117" } "EyeAngles" { - "windows" "107" - "linux" "108" + "windows" "108" + "linux" "109" } "AcceptInput" { @@ -83,5 +83,14 @@ "linux" "289" } } + "Signatures" + { + "FireOutput" + { + "library" "server" + "windows" "\x81\xEC\x20\x01\x00\x00\x53\x55\x56\x8B\x71\x14" + "linux" "@_ZN17CBaseEntityOutput10FireOutputE9variant_tP11CBaseEntityS2_f" + } + } } } \ No newline at end of file diff --git a/gamedata/sdktools.games/game.zm.txt b/gamedata/sdktools.games/game.zm.txt index 64efe71f..1c1c0eab 100644 --- a/gamedata/sdktools.games/game.zm.txt +++ b/gamedata/sdktools.games/game.zm.txt @@ -11,7 +11,7 @@ "Games" { - /* Zombie Master 1.1.3 */ + /* Zombie Master 1.2.1 */ "zombie_master" { "Offsets" @@ -87,10 +87,6 @@ "windows" "25" "linux" "26" } - "s_pTempEntities" - { - "windows" "30" - } "g_pGameRules" { "windows" "7" @@ -109,27 +105,22 @@ "Signatures" { - "CBaseTempEntity" - { - "library" "server" - "windows" "\x55\x8B\xEC\x51\x89\x4D\xFC\x8B\x45\xFC\xC7\x00\x2A\x2A\x2A\x2A\x8B\x4D\xFC\x8B\x55\x08\x89\x51\x04\x8B\x45\xFC\x8B\x0D\x2A\x2A" - } "DispatchSpawn" { "library" "server" "linux" "@_Z13DispatchSpawnP11CBaseEntity" - "windows" "\x55\x8B\xEC\x83\xEC\x20\x83\x7D\x08\x00\x0F\x84\x95\x01\x00\x00\xA1\x2A\x2A\x2A\x2A\x50\x8D\x4D\xF0\xE8\x2A\x2A\x2A\x2A\x8D\x4D" + "windows" "\x53\x55\x56\x8B\x74\x24\x10\x85\xF6\x57\x0F\x84\x3A\x01\x00\x00\x8B\x1D\x5C\x35\x6F\x22\x8B\x03\x8B\xCB\xFF\x50\x60\x8B\x16\x8B" } "CreateEntityByName" { "library" "server" "linux" "@_Z18CreateEntityByNamePKci" - "windows" "\x55\x8B\xEC\x83\xEC\x0C\x83\x7D\x0C\xFF\x74\x39\x8B\x45\x0C\x50\x8B\x0D\x2A\x2A\x2A\x2A\x8B\x11\x8B\x0D\x2A\x2A\x2A\x2A\xFF\x52" + "windows" "\x56\x8B\x74\x24\x0C\x83\xFE\xFF\x57\x8B\x7C\x24\x0C\x74\x25\x8B\x0D\x20\x35\x6F\x22\x8B\x01\x56\xFF\x50\x54\x85\xC0\xA3\x54\x31" } "FindEntityByClassname" { "library" "server" - "windows" "\x55\x8B\xEC\x83\xEC\x10\x89\x4D\xF4\x83\x7D\x08\x00\x74\x1C\x8B\x45\x08\x8B\x10\x8B\x4D\x08\xFF\x52\x08\x50\x8B\x4D\xF4\xE8\x2A\x2A\x2A\x2A\x8B\x40\x0C\x89\x45\x\xF0\xEB\x0B\x8B\x4D\xF4\xE8\x2A\x2A\x2A\x2A\x89\x45\xF0\x8B\x4D\xF0\x89\x4D\xFC\xEB\x09\x8B\x55\xFC\x8B\x42\x0C\x89\x45\xFC\x83\x7D\xFC\x00\x74\x38\x8B\x4D\xFC\x8B\x11\x89" + "windows" "\x53\x55\x56\x8B\xF1\x8B\x4C\x24\x10\x85\xC9\x57\x74\x18\x8B\x01\xFF\x50\x08\x8B\x08\x81\xE1\xFF\x0F\x00\x00\x83\xC1\x01\xC1\xE1\x04\x8B\x3C\x31\xEB\x06\x8B\xBE\x04\x00\x01\x00\x85\xFF\x74\x3A\x8B\x5C\x24\x18\x8B\x2D\x6C\xE5\x73\x22\x8D\x9B\x00\x00\x00\x00\x8B\x37\x85\xF6\x75\x0C\x68\xFC\xFB\x56\x22\xFF\xD5\x83\xC4\x04\xEB\x11\x39" "linux" "@_ZN17CGlobalEntityList21FindEntityByClassnameEP11CBaseEntityPKc" } "CreateGameRulesObject" @@ -144,4 +135,4 @@ } } } -} \ No newline at end of file +} diff --git a/gamedata/sdktools.games/game.zpanic.txt b/gamedata/sdktools.games/game.zpanic.txt index fc977132..85f23828 100644 --- a/gamedata/sdktools.games/game.zpanic.txt +++ b/gamedata/sdktools.games/game.zpanic.txt @@ -11,59 +11,55 @@ "Games" { - /* Zombie Panic! Source 1.2b - * Note: This mod is not fully supported yet. - * The definitions below were supplied by a third party. - * (thanks "noob cannon lol") - */ - "ZPS" + /* Zombie Panic! Source (1.6.1) */ + "zps" { "Offsets" { "GiveNamedItem" { - "windows" "333" - "linux" "334" + "windows" "356" + "linux" "357" } "RemovePlayerItem" { - "windows" "230" - "linux" "231" + "windows" "243" + "linux" "244" } "Weapon_GetSlot" { - "windows" "226" - "linux" "227" + "windows" "238" + "linux" "239" } "Ignite" { - "windows" "190" - "linux" "191" + "windows" "195" + "linux" "196" } "Extinguish" { - "windows" "191" - "linux" "192" + "windows" "199" + "linux" "200" } "Teleport" { - "windows" "100" - "linux" "101" + "windows" "103" + "linux" "104" } "CommitSuicide" { - "windows" "361" - "linux" "362" + "windows" "397" + "linux" "397" } "GetVelocity" { - "windows" "128" - "linux" "129" + "windows" "132" + "linux" "133" } "EyeAngles" { - "windows" "120" - "linux" "121" + "windows" "124" + "linux" "125" } "AcceptInput" { @@ -72,28 +68,28 @@ } "DispatchKeyValue" { - "windows" "31" - "linux" "30" + "windows" "30" + "linux" "29" } "DispatchKeyValueFloat" { - "windows" "30" - "linux" "31" + "windows" "29" + "linux" "30" } "DispatchKeyValueVector" { - "windows" "29" - "linux" "32" + "windows" "28" + "linux" "31" } "SetEntityModel" { - "windows" "25" - "linux" "26" + "windows" "24" + "linux" "25" } "WeaponEquip" { - "windows" "219" - "linux" "220" + "windows" "231" + "linux" "232" } "Activate" { diff --git a/gamedata/sdktools.games/master.games.txt b/gamedata/sdktools.games/master.games.txt index 0b2e4103..9f51c00a 100644 --- a/gamedata/sdktools.games/master.games.txt +++ b/gamedata/sdktools.games/master.games.txt @@ -113,7 +113,7 @@ "game.zpanic.txt" { - "game" "ZPS" + "game" "zps" } "game.obsidian.txt" diff --git a/plugins/basechat.sp b/plugins/basechat.sp index 847ec942..63efb520 100644 --- a/plugins/basechat.sp +++ b/plugins/basechat.sp @@ -190,10 +190,7 @@ public Action:Command_SayAdmin(client, args) decl String:message[192]; strcopy(message, 192, text[startidx+1]); - decl String:name[64]; - GetClientName(client, name, sizeof(name)); - - SendChatToAdmins(name, message); + SendChatToAdmins(client, message); LogAction(client, -1, "%L triggered sm_chat (text %s)", client, message); return Plugin_Handled; @@ -313,10 +310,7 @@ public Action:Command_SmChat(client, args) decl String:text[192]; GetCmdArgString(text, sizeof(text)); - decl String:name[64]; - GetClientName(client, name, sizeof(name)); - - SendChatToAdmins(name, text); + SendChatToAdmins(client, text); LogAction(client, -1, "%L triggered sm_chat (text %s)", client, text); return Plugin_Handled; @@ -451,22 +445,20 @@ DisplayCenterTextToAll(client, String:message[]) } } -SendChatToAdmins(String:name[], String:message[]) +SendChatToAdmins(from, String:message[]) { + new fromAdmin = CheckCommandAccess(from, "sm_chat", ADMFLAG_CHAT); for (new i = 1; i <= MaxClients; i++) { - if (IsClientInGame(i)) + if (IsClientInGame(i) && (from == i || CheckCommandAccess(i, "sm_chat", ADMFLAG_CHAT))) { - if (CheckCommandAccess(i, "sm_chat", ADMFLAG_CHAT)) + if (g_DoColor) { - if (g_DoColor) - { - PrintToChat(i, "\x04(ADMINS) %s: \x01%s", name, message); - } - else - { - PrintToChat(i, "(ADMINS) %s: %s", name, message); - } + PrintToChat(i, "\x04(%sADMINS) %N: \x01%s", fromAdmin ? "" : "TO ", from, message); + } + else + { + PrintToChat(i, "(%sADMINS) %N: %s", fromAdmin ? "" : "TO ", from, message); } } }