diff --git a/cstrike/addons/sourcemod/gamedata/plugin.zombiereloaded.txt b/cstrike/addons/sourcemod/gamedata/plugin.zombiereloaded.txt index bc25c01..50a090e 100644 --- a/cstrike/addons/sourcemod/gamedata/plugin.zombiereloaded.txt +++ b/cstrike/addons/sourcemod/gamedata/plugin.zombiereloaded.txt @@ -51,22 +51,5 @@ "linux" "257" } } - - "Signatures" - { - "TerminateRound" - { - "library" "server" - "windows" "\x83\xEC\x2A\x53\x8B\x5C\x2A\x2A\x55\x56\x57\x33\xF6\x8B\xE9\x33" - "linux" "@_ZN12CCSGameRules14TerminateRoundEfi" - } - - "CSWeaponDrop" - { - "library" "server" - "windows" "\x55\x8B\xEC\x81\xEC\x2A\x2A\x2A\x2A\x89\x8D\x2A\x2A\x2A\x2A\xC6\x2A\x2A\x00\x8B\x8D\x2A\x2A\x2A\x2A\xE8" - "linux" "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb" - } - } } } diff --git a/src/zr/roundend.inc b/src/zr/roundend.inc index a2359e4..e6bab28 100644 --- a/src/zr/roundend.inc +++ b/src/zr/roundend.inc @@ -309,22 +309,22 @@ RoundEndTerminateRound(Float:delay, RoundEndOutcome:outcome = Restart) // Round is restarting. case Restart: { - SDKCall(g_hToolsTerminateRound, delay, ROUNDEND_GAME_COMMENCING); + CS_TerminateRound(delay, CSRoundEnd_GameStart, false); } // Round was a draw. case Draw: { - SDKCall(g_hToolsTerminateRound, delay, ROUNDEND_ROUND_DRAW); + CS_TerminateRound(delay, CSRoundEnd_Draw, false); } // Zombies won. case ZombiesWin: { - SDKCall(g_hToolsTerminateRound, delay, ROUNDEND_TERRORISTS_WIN); + CS_TerminateRound(delay, CSRoundEnd_TerroristWin, false); } // Humans won. case HumansWin: { - SDKCall(g_hToolsTerminateRound, delay, ROUNDEND_CTS_WIN); + CS_TerminateRound(delay, CSRoundEnd_CTWin, false); } } } diff --git a/src/zr/tools.inc b/src/zr/tools.inc index 320703b..330ad83 100644 --- a/src/zr/tools.inc +++ b/src/zr/tools.inc @@ -34,16 +34,6 @@ new g_iToolsHasNightVision; new g_iToolsNightVisionOn; new g_iToolsFOV; -/** - * @endsection - */ - -/** - * Initialize global SDKTools handles. - */ -new Handle:g_hToolsGameConfig = INVALID_HANDLE; -new Handle:g_hToolsTerminateRound = INVALID_HANDLE; -new Handle:g_hToolsCSWeaponDrop = INVALID_HANDLE; /** * @endsection */ @@ -58,9 +48,6 @@ ToolsInit() { // Find offsets. ToolsFindOffsets(); - - // Setup SDKTools - ToolsSetupGameData(); } /** @@ -109,45 +96,3 @@ ToolsFindOffsets() VEffectsOnOffsetsFound(); NapalmOnOffsetsFound(); } - -/** - * Sets up gamedata for the plugin. - */ -ToolsSetupGameData() -{ - // Load game config file. - g_hToolsGameConfig = LoadGameConfigFile("plugin.zombiereloaded"); - - // If gamedata file can't be loaded, then stop the plugin. - if (g_hToolsGameConfig == INVALID_HANDLE) - { - LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Tools, "GameData", "Can't load game config file (plugin.zombiereloaded.txt) from the gamedata directory."); - } - - // Prep the SDKCall for "TerminateRound." - StartPrepSDKCall(SDKCall_GameRules); - PrepSDKCall_SetFromConf(g_hToolsGameConfig, SDKConf_Signature, "TerminateRound"); - PrepSDKCall_AddParameter(SDKType_Float, SDKPass_Plain); - PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain); - g_hToolsTerminateRound = EndPrepSDKCall(); - - // If offset "TerminateRound" can't be found, then stop the plugin. - if(g_hToolsTerminateRound == INVALID_HANDLE) - { - LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Tools, "GameData", "Signature \"CGameRules::TerminateRound\" was not found."); - } - - // Prep the SDKCall for "CSWeaponDrop." - StartPrepSDKCall(SDKCall_Player); - PrepSDKCall_SetFromConf(g_hToolsGameConfig, SDKConf_Signature, "CSWeaponDrop"); - PrepSDKCall_AddParameter(SDKType_CBaseEntity, SDKPass_Pointer); - PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain); - PrepSDKCall_AddParameter(SDKType_Bool, SDKPass_Plain); - g_hToolsCSWeaponDrop = EndPrepSDKCall(); - - // If offset "CSWeaponDrop" can't be found, then stop the plugin. - if(g_hToolsCSWeaponDrop == INVALID_HANDLE) - { - LogEvent(false, LogType_Fatal, LOG_CORE_EVENTS, LogModule_Tools, "GameData", "Signature \"CBasePlayer::CSWeaponDrop\" was not found."); - } -} diff --git a/src/zr/weapons/weapons.inc b/src/zr/weapons/weapons.inc index 8a00c9a..7428f76 100644 --- a/src/zr/weapons/weapons.inc +++ b/src/zr/weapons/weapons.inc @@ -792,7 +792,7 @@ stock WeaponsSlot:WeaponsGetDeployedWeaponSlot(client) } /** - * Forces player to drop weapon index. + * Forces player to drop weapon index. (Simplified wrapper) * * @param client The client index. * @param weapon The weapon index to force client to drop. @@ -800,7 +800,7 @@ stock WeaponsSlot:WeaponsGetDeployedWeaponSlot(client) stock WeaponsForceClientDrop(client, weapon) { // Force client to drop weapon. - SDKCall(g_hToolsCSWeaponDrop, client, weapon, true, false); + CS_DropWeapon(client, weapon, true, false); } /**