Reverted to use ZR Tools. Fixed class multipliers beeing reset after map configs.

SDK Hooks works, but is not yet fully compatible with weapon restrict module because of missing Weapon_CanUse event in SDK Hooks. Weapons disappear when zombies walk near them. Otherwise the extension works.
This commit is contained in:
richard 2009-11-11 22:50:19 +01:00
parent 55ecd5bb07
commit 8c1a549239
4 changed files with 18 additions and 14 deletions

View File

@ -278,14 +278,13 @@ plugin is compatible with all existing Zombie Mod maps.</p>
</ul></li> </ul></li>
<li> <li>
<p>ZRTools extension (bundled). Provides some extra functions needed by Zombie:Reloaded.
See <a href="#2.2">Plugin Installation (2.2)</a>.</p>
<p>- Or, depending on version -</p>
<p><a href="http://forums.alliedmods.net/showthread.php?t=106748">SDK Hooks Extension</a> <p><a href="http://forums.alliedmods.net/showthread.php?t=106748">SDK Hooks Extension</a>
(version 1.1 or newer). Provides some extra functions needed by Zombie:Reloaded.</p> (version 1.1 or newer). Provides some extra functions needed by Zombie:Reloaded.</p>
</li> </li>
<!--<li>
<p>ZRTools extension (bundled). Provides some extra functions needed by Zombie:Reloaded.
See <a href="#2.2">Plugin Installation (2.2)</a>.</p>
</li>-->
</ol> </ol>
<h3><a name="2.2" />2.2 Plugin Installation</h3> <h3><a name="2.2" />2.2 Plugin Installation</h3>

View File

@ -26,7 +26,7 @@
*/ */
// Comment to use ZR Tools Extension, otherwise SDK Hooks Extension will be used. // Comment to use ZR Tools Extension, otherwise SDK Hooks Extension will be used.
#define USE_SDKHOOKS //define USE_SDKHOOKS
#pragma semicolon 1 #pragma semicolon 1
#include <sourcemod> #include <sourcemod>
@ -171,6 +171,7 @@ public OnAllPluginsLoaded()
public OnMapStart() public OnMapStart()
{ {
// Forward event to modules. // Forward event to modules.
ClassOnMapStart();
OverlaysOnMapStart(); OverlaysOnMapStart();
RoundEndOnMapStart(); RoundEndOnMapStart();
InfectOnMapStart(); InfectOnMapStart();

View File

@ -49,6 +49,16 @@ ClassOnModulesLoaded()
ClassClientSetDefaultIndexes(); ClassClientSetDefaultIndexes();
} }
/**
* Called when map is loading, before configs are loaded. Used for
* initializing class module.
*/
ClassOnMapStart()
{
// Clear multipliers.
ClassResetMultiplierCache();
}
/** /**
* Called when a client connects to the server (OnClientPutInServer). * Called when a client connects to the server (OnClientPutInServer).
*/ */

View File

@ -480,7 +480,7 @@ new String:ClassOriginalPlayerModel[MAXPLAYERS + 1][PLATFORM_MAX_PATH];
* @param keepMultipliers Optional. Don't reset multipliers. Default is * @param keepMultipliers Optional. Don't reset multipliers. Default is
* false. * false.
*/ */
ClassLoad(bool:keepMultipliers = false) ClassLoad()
{ {
// Register config file. // Register config file.
ConfigRegisterConfig(File_Classes, Structure_Keyvalue, CONFIG_FILE_ALIAS_CLASSES); ConfigRegisterConfig(File_Classes, Structure_Keyvalue, CONFIG_FILE_ALIAS_CLASSES);
@ -630,12 +630,6 @@ ClassLoad(bool:keepMultipliers = false)
// Reset selected class indexes for next spawn. // Reset selected class indexes for next spawn.
ClassResetNextIndexes(); ClassResetNextIndexes();
// Reset attribute multipliers, if not keeping.
if (!keepMultipliers)
{
ClassResetMultiplierCache();
}
// Mark classes as valid. // Mark classes as valid.
ClassValidated = true; ClassValidated = true;
@ -660,7 +654,7 @@ ClassLoad(bool:keepMultipliers = false)
public ClassOnConfigReload(ConfigFile:config) public ClassOnConfigReload(ConfigFile:config)
{ {
// Reload class config. // Reload class config.
ClassLoad(true); ClassLoad();
} }
/** /**