New log features, class attribute and minior changes. See details.
Made new log CVAR for overriding filters on error log types: zr_log_error_override. If this is on, errors are always logged, independent of flags and filters. Now all non-error logging can be completely disabled without complex flags or filtering. Made new class attribute ("has_napalm", ClassGetHasNapalm) that specifies if the class have or can trhow napalm grenades. Implemented usage in napalm module. Added team id validation in class attributes. Improved formatting of log messages in cvars module. Known issue: Commands in config for adding modules to log filter are executed too late. Otherwise the module filter works fine.
This commit is contained in:
parent
0a72dc2100
commit
4b66f688ab
@ -69,6 +69,7 @@
|
|||||||
"fov" "90"
|
"fov" "90"
|
||||||
|
|
||||||
// Effects
|
// Effects
|
||||||
|
"has_napalm" "0"
|
||||||
"napalm_time" "10.0"
|
"napalm_time" "10.0"
|
||||||
|
|
||||||
// Player behaviour
|
// Player behaviour
|
||||||
@ -110,6 +111,7 @@
|
|||||||
"fov" "90"
|
"fov" "90"
|
||||||
|
|
||||||
// Effects
|
// Effects
|
||||||
|
"has_napalm" "0"
|
||||||
"napalm_time" "5.0"
|
"napalm_time" "5.0"
|
||||||
|
|
||||||
// Player behaviour
|
// Player behaviour
|
||||||
@ -151,6 +153,7 @@
|
|||||||
"fov" "90"
|
"fov" "90"
|
||||||
|
|
||||||
// Effects
|
// Effects
|
||||||
|
"has_napalm" "0"
|
||||||
"napalm_time" "15.0"
|
"napalm_time" "15.0"
|
||||||
|
|
||||||
// Player behaviour
|
// Player behaviour
|
||||||
@ -192,6 +195,7 @@
|
|||||||
"fov" "90"
|
"fov" "90"
|
||||||
|
|
||||||
// Effects
|
// Effects
|
||||||
|
"has_napalm" "0"
|
||||||
"napalm_time" "20.0"
|
"napalm_time" "20.0"
|
||||||
|
|
||||||
// Player behaviour
|
// Player behaviour
|
||||||
@ -239,6 +243,7 @@
|
|||||||
"fov" "90"
|
"fov" "90"
|
||||||
|
|
||||||
// Effects
|
// Effects
|
||||||
|
"has_napalm" "1"
|
||||||
"napalm_time" "0.0"
|
"napalm_time" "0.0"
|
||||||
|
|
||||||
// Player behaviour
|
// Player behaviour
|
||||||
@ -280,6 +285,7 @@
|
|||||||
"fov" "90"
|
"fov" "90"
|
||||||
|
|
||||||
// Effects
|
// Effects
|
||||||
|
"has_napalm" "0"
|
||||||
"napalm_time" "0.0"
|
"napalm_time" "0.0"
|
||||||
|
|
||||||
// Player behaviour
|
// Player behaviour
|
||||||
@ -321,6 +327,7 @@
|
|||||||
"fov" "90"
|
"fov" "90"
|
||||||
|
|
||||||
// Effects
|
// Effects
|
||||||
|
"has_napalm" "1"
|
||||||
"napalm_time" "0.0"
|
"napalm_time" "0.0"
|
||||||
|
|
||||||
// Player behaviour
|
// Player behaviour
|
||||||
|
@ -112,9 +112,9 @@ public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max)
|
|||||||
public OnPluginStart()
|
public OnPluginStart()
|
||||||
{
|
{
|
||||||
// Forward event to modules.
|
// Forward event to modules.
|
||||||
|
LogInit(); // Doesn't depend on CVARs.
|
||||||
TranslationInit();
|
TranslationInit();
|
||||||
CvarsInit();
|
CvarsInit();
|
||||||
LogInit();
|
|
||||||
ToolsInit();
|
ToolsInit();
|
||||||
CommandsInit();
|
CommandsInit();
|
||||||
WeaponsInit();
|
WeaponsInit();
|
||||||
|
@ -192,7 +192,7 @@ ConfigOnCommandsCreate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load plugin configs.
|
* Load plugin configs. Executes map configs.
|
||||||
*/
|
*/
|
||||||
ConfigLoad()
|
ConfigLoad()
|
||||||
{
|
{
|
||||||
|
@ -44,6 +44,7 @@ enum CvarsList
|
|||||||
Handle:CVAR_LOG_FLAGS,
|
Handle:CVAR_LOG_FLAGS,
|
||||||
Handle:CVAR_LOG_MODULE_FILTER,
|
Handle:CVAR_LOG_MODULE_FILTER,
|
||||||
Handle:CVAR_LOG_IGNORE_CONSOLE,
|
Handle:CVAR_LOG_IGNORE_CONSOLE,
|
||||||
|
Handle:CVAR_LOG_ERROR_OVERRIDE,
|
||||||
Handle:CVAR_LOG_PRINT_ADMINS,
|
Handle:CVAR_LOG_PRINT_ADMINS,
|
||||||
Handle:CVAR_LOG_PRINT_CHAT,
|
Handle:CVAR_LOG_PRINT_CHAT,
|
||||||
Handle:CVAR_CONFIG_PATH_MODELS,
|
Handle:CVAR_CONFIG_PATH_MODELS,
|
||||||
@ -207,6 +208,7 @@ CvarsCreate()
|
|||||||
g_hCvarsList[CVAR_LOG_FLAGS] = CreateConVar("zr_log_flags", "3", "A bit field that specify what event types to log. See logging section (3.3) in manual for details.");
|
g_hCvarsList[CVAR_LOG_FLAGS] = CreateConVar("zr_log_flags", "3", "A bit field that specify what event types to log. See logging section (3.3) in manual for details.");
|
||||||
g_hCvarsList[CVAR_LOG_MODULE_FILTER] = CreateConVar("zr_log_module_filter", "0", "Enable module filtering. Only log events from listed modules will be logged.");
|
g_hCvarsList[CVAR_LOG_MODULE_FILTER] = CreateConVar("zr_log_module_filter", "0", "Enable module filtering. Only log events from listed modules will be logged.");
|
||||||
g_hCvarsList[CVAR_LOG_IGNORE_CONSOLE] = CreateConVar("zr_log_ignore_console", "1", "Don't log events triggered by console commands that are executed by the console itself, like commands in configs. Enable this command to avoid spamming logs with events like weapon restrictions.");
|
g_hCvarsList[CVAR_LOG_IGNORE_CONSOLE] = CreateConVar("zr_log_ignore_console", "1", "Don't log events triggered by console commands that are executed by the console itself, like commands in configs. Enable this command to avoid spamming logs with events like weapon restrictions.");
|
||||||
|
g_hCvarsList[CVAR_LOG_ERROR_OVERRIDE] = CreateConVar("zr_log_error_override", "1", "Always log error messages. Overrides module filter and logging flags.");
|
||||||
g_hCvarsList[CVAR_LOG_PRINT_ADMINS] = CreateConVar("zr_log_print_admins", "0", "Print log events to admin chat in addition to the log file.");
|
g_hCvarsList[CVAR_LOG_PRINT_ADMINS] = CreateConVar("zr_log_print_admins", "0", "Print log events to admin chat in addition to the log file.");
|
||||||
g_hCvarsList[CVAR_LOG_PRINT_CHAT] = CreateConVar("zr_log_print_chat", "0", "Print log events to public chat in addition to the log file.");
|
g_hCvarsList[CVAR_LOG_PRINT_CHAT] = CreateConVar("zr_log_print_chat", "0", "Print log events to public chat in addition to the log file.");
|
||||||
|
|
||||||
@ -518,7 +520,7 @@ public CvarsHookLocked(Handle:cvar, const String:oldvalue[], const String:newval
|
|||||||
SetConVarInt(g_hAutoTeamBalance, CVARS_AUTOTEAMBALANCE_LOCKED);
|
SetConVarInt(g_hAutoTeamBalance, CVARS_AUTOTEAMBALANCE_LOCKED);
|
||||||
|
|
||||||
// If log flag check fails, then don't log.
|
// If log flag check fails, then don't log.
|
||||||
LogEvent(false, LogType_Normal, LOG_CORE_EVENTS, LogModule_Cvars, "Cvar Locked", "Cvar \"mp_autoteambalance\" was reverted back to \"CVARS_AUTOTEAMBALANCE_LOCKED\".");
|
LogEvent(false, LogType_Normal, LOG_CORE_EVENTS, LogModule_Cvars, "Cvar Locked", "Cvar \"mp_autoteambalance\" was reverted back to %d.", CVARS_AUTOTEAMBALANCE_LOCKED);
|
||||||
}
|
}
|
||||||
// If cvar is mp_limitteams, then continue.
|
// If cvar is mp_limitteams, then continue.
|
||||||
else if (cvar == g_hLimitTeams)
|
else if (cvar == g_hLimitTeams)
|
||||||
@ -533,7 +535,7 @@ public CvarsHookLocked(Handle:cvar, const String:oldvalue[], const String:newval
|
|||||||
SetConVarInt(g_hLimitTeams, CVARS_LIMITTEAMS_LOCKED);
|
SetConVarInt(g_hLimitTeams, CVARS_LIMITTEAMS_LOCKED);
|
||||||
|
|
||||||
// If log flag check fails, then don't log.
|
// If log flag check fails, then don't log.
|
||||||
LogEvent(false, LogType_Normal, LOG_CORE_EVENTS, LogModule_Cvars, "Cvar Locked", "Cvar \"mp_limitteams\" was reverted back to \"CVARS_LIMITTEAMS_LOCKED\".");
|
LogEvent(false, LogType_Normal, LOG_CORE_EVENTS, LogModule_Cvars, "Cvar Locked", "Cvar \"mp_limitteams\" was reverted back to %d.", CVARS_LIMITTEAMS_LOCKED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ public Action:EventPlayerHurt(Handle:event, const String:name[], bool:dontBroadc
|
|||||||
InfectOnClientHurt(index, attacker, weapon);
|
InfectOnClientHurt(index, attacker, weapon);
|
||||||
SEffectsOnClientHurt(index);
|
SEffectsOnClientHurt(index);
|
||||||
KnockbackOnClientHurt(index, attacker, weapon, hitgroup, dmg_health);
|
KnockbackOnClientHurt(index, attacker, weapon, hitgroup, dmg_health);
|
||||||
NapalmOnClientHurt(index, weapon);
|
NapalmOnClientHurt(index, attacker, weapon);
|
||||||
ZHPOnClientHurt(index);
|
ZHPOnClientHurt(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,9 +300,10 @@ public Action:EventPlayerJump(Handle:event, const String:name[], bool:dontBroadc
|
|||||||
public Action:EventWeaponFire(Handle:event, const String:name[], bool:dontBroadcast)
|
public Action:EventWeaponFire(Handle:event, const String:name[], bool:dontBroadcast)
|
||||||
{
|
{
|
||||||
// Get all required event info.
|
// Get all required event info.
|
||||||
|
new index = GetClientOfUserId(GetEventInt(event, "userid"));
|
||||||
decl String:weapon[32];
|
decl String:weapon[32];
|
||||||
GetEventString(event, "weapon", weapon, sizeof(weapon));
|
GetEventString(event, "weapon", weapon, sizeof(weapon));
|
||||||
|
|
||||||
// Forward event to modules.
|
// Forward event to modules.
|
||||||
NapalmOnWeaponFire(weapon);
|
NapalmOnWeaponFire(index, weapon);
|
||||||
}
|
}
|
||||||
|
@ -258,8 +258,8 @@ bool:LogCheckModuleFilter(LogModules:module)
|
|||||||
*/
|
*/
|
||||||
LogEvent(bool:isConsole = false, LogTypes:logType = LogType_Normal, eventType = LOG_CORE_EVENTS, LogModules:module, const String:description[], const String:text[], any:...)
|
LogEvent(bool:isConsole = false, LogTypes:logType = LogType_Normal, eventType = LOG_CORE_EVENTS, LogModules:module, const String:description[], const String:text[], any:...)
|
||||||
{
|
{
|
||||||
// Only do filter and flag checks if the log type isn't a fatal error.
|
// Check filter overrides. Always log fatal errors, and check error override setting on error log types.
|
||||||
if (logType != LogType_Fatal)
|
if ((logType != LogType_Fatal && logType != LogType_Error) || (logType == LogType_Error && !GetConVarBool(g_hCvarsList[CVAR_LOG_ERROR_OVERRIDE])))
|
||||||
{
|
{
|
||||||
// Check if logging is disabled.
|
// Check if logging is disabled.
|
||||||
if (!GetConVarBool(g_hCvarsList[CVAR_LOG]))
|
if (!GetConVarBool(g_hCvarsList[CVAR_LOG]))
|
||||||
@ -333,6 +333,7 @@ LogEvent(bool:isConsole = false, LogTypes:logType = LogType_Normal, eventType =
|
|||||||
// Check if printing log events to public chat is enabled.
|
// Check if printing log events to public chat is enabled.
|
||||||
if (GetConVarBool(g_hCvarsList[CVAR_LOG_PRINT_CHAT]))
|
if (GetConVarBool(g_hCvarsList[CVAR_LOG_PRINT_CHAT]))
|
||||||
{
|
{
|
||||||
|
// Print text to public chat.
|
||||||
TranslationPrintToChatAll(false, false, "Literal text", logbuffer);
|
TranslationPrintToChatAll(false, false, "Literal text", logbuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,9 +34,10 @@
|
|||||||
* Client has been hurt.
|
* Client has been hurt.
|
||||||
*
|
*
|
||||||
* @param client The client index.
|
* @param client The client index.
|
||||||
|
* @param attacker The attacker index.
|
||||||
* @param weapon The weapon name.
|
* @param weapon The weapon name.
|
||||||
*/
|
*/
|
||||||
NapalmOnClientHurt(client, const String:weapon[])
|
NapalmOnClientHurt(client, attacker, const String:weapon[])
|
||||||
{
|
{
|
||||||
// If player isn't a zombie, then stop.
|
// If player isn't a zombie, then stop.
|
||||||
if (!InfectIsClientInfected(client))
|
if (!InfectIsClientInfected(client))
|
||||||
@ -51,6 +52,12 @@ NapalmOnClientHurt(client, const String:weapon[])
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the attacker can't throw napalm grenades, then stop.
|
||||||
|
if (ClassGetHasNapalm(attacker))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If weapon is a grenade, then ignite player.
|
// If weapon is a grenade, then ignite player.
|
||||||
if (StrEqual(weapon, "hegrenade", false))
|
if (StrEqual(weapon, "hegrenade", false))
|
||||||
{
|
{
|
||||||
@ -76,9 +83,10 @@ NapalmOnClientDeath(client)
|
|||||||
/**
|
/**
|
||||||
* Weapon has been fired.
|
* Weapon has been fired.
|
||||||
*
|
*
|
||||||
|
* @param client The client index.
|
||||||
* @param weapon The weapon name.
|
* @param weapon The weapon name.
|
||||||
*/
|
*/
|
||||||
NapalmOnWeaponFire(const String:weapon[])
|
NapalmOnWeaponFire(client, const String:weapon[])
|
||||||
{
|
{
|
||||||
// If grenade fire is disabled, then stop.
|
// If grenade fire is disabled, then stop.
|
||||||
new bool:napalmignite = GetConVarBool(g_hCvarsList[CVAR_NAPALM_IGNITE]);
|
new bool:napalmignite = GetConVarBool(g_hCvarsList[CVAR_NAPALM_IGNITE]);
|
||||||
@ -87,11 +95,11 @@ NapalmOnWeaponFire(const String:weapon[])
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If human class can't throw napalm grenades, then stop. (TODO)
|
// If human class can't throw napalm grenades, then stop.
|
||||||
/*if ()
|
if (!ClassGetHasNapalm(client))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
// If weapon isn't a grenade, then stop.
|
// If weapon isn't a grenade, then stop.
|
||||||
if (!StrEqual(weapon, "hegrenade", false))
|
if (!StrEqual(weapon, "hegrenade", false))
|
||||||
|
@ -461,6 +461,38 @@ stock ClassGetFOV(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
|||||||
* ------------------------------------
|
* ------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the napalm setting from the specified class.
|
||||||
|
*
|
||||||
|
* @param index Index of the class in a class cache or a client index,
|
||||||
|
* depending on the cache type specified.
|
||||||
|
* @param cachetype Optional. Specifies what class cache to read from. Options:
|
||||||
|
* ZR_CLASS_CACHE_ORIGINAL - Unchanced class data.
|
||||||
|
* ZR_CLASS_CACHE_MODIFIED - Changed/newest class data.
|
||||||
|
* ZR_CLASS_CACHE_PLAYER (default) - Player cache. If this one
|
||||||
|
* is used, index will be used as a client index.
|
||||||
|
* @return True if the class has napalm grenades, false otherwise.
|
||||||
|
*/
|
||||||
|
stock bool:ClassGetHasNapalm(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
||||||
|
{
|
||||||
|
switch (cachetype)
|
||||||
|
{
|
||||||
|
case ZR_CLASS_CACHE_ORIGINAL:
|
||||||
|
{
|
||||||
|
return ClassData[index][class_has_napalm];
|
||||||
|
}
|
||||||
|
case ZR_CLASS_CACHE_MODIFIED:
|
||||||
|
{
|
||||||
|
return ClassDataCache[index][class_has_napalm];
|
||||||
|
}
|
||||||
|
case ZR_CLASS_CACHE_PLAYER:
|
||||||
|
{
|
||||||
|
return ClassPlayerCache[index][class_has_napalm];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the napalm grenades time from the specified class.
|
* Gets the napalm grenades time from the specified class.
|
||||||
*
|
*
|
||||||
|
@ -396,6 +396,11 @@ stock bool:ClassModifyBoolean(classindex, attributeflag, bool:value)
|
|||||||
ClassDataCache[classindex][class_no_fall_damage] = bool:value;
|
ClassDataCache[classindex][class_no_fall_damage] = bool:value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case ZR_CLASS_FLAG_HAS_NAPALM:
|
||||||
|
{
|
||||||
|
ClassDataCache[classindex][class_has_napalm] = bool:value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Invalid flag or multiple flags combined.
|
// Invalid flag or multiple flags combined.
|
||||||
|
@ -106,6 +106,12 @@ stock ClassValidateAttributes(classindex)
|
|||||||
|
|
||||||
new flags;
|
new flags;
|
||||||
|
|
||||||
|
// Team.
|
||||||
|
if (ClassData[classindex][class_team] < ZR_CLASS_TEAM_MIN || ClassData[classindex][class_team] > ZR_CLASS_TEAM_MAX)
|
||||||
|
{
|
||||||
|
flags += ZR_CLASS_FLAG_TEAM;
|
||||||
|
}
|
||||||
|
|
||||||
// Name.
|
// Name.
|
||||||
if (strlen(ClassData[classindex][class_name]) < ZR_CLASS_NAME_MIN)
|
if (strlen(ClassData[classindex][class_name]) < ZR_CLASS_NAME_MIN)
|
||||||
{
|
{
|
||||||
@ -116,7 +122,7 @@ stock ClassValidateAttributes(classindex)
|
|||||||
decl String:name[64];
|
decl String:name[64];
|
||||||
strcopy(name, sizeof(name), ClassData[classindex][class_name]);
|
strcopy(name, sizeof(name), ClassData[classindex][class_name]);
|
||||||
|
|
||||||
// Check for reserved name keyworks.
|
// Check for reserved name keyworks. These aren't allowed as names.
|
||||||
if (StrEqual(name, "all", false) ||
|
if (StrEqual(name, "all", false) ||
|
||||||
StrEqual(name, "humans", false) ||
|
StrEqual(name, "humans", false) ||
|
||||||
StrEqual(name, "zombies", false) ||
|
StrEqual(name, "zombies", false) ||
|
||||||
|
@ -121,6 +121,7 @@
|
|||||||
#define ZR_CLASS_DEFAULT_OVERLAY_PATH "overlays/zr/zvision"
|
#define ZR_CLASS_DEFAULT_OVERLAY_PATH "overlays/zr/zvision"
|
||||||
#define ZR_CLASS_DEFAULT_NVGS true
|
#define ZR_CLASS_DEFAULT_NVGS true
|
||||||
#define ZR_CLASS_DEFAULT_FOV 90
|
#define ZR_CLASS_DEFAULT_FOV 90
|
||||||
|
#define ZR_CLASS_DEFAULT_HAS_NAPALM 1
|
||||||
#define ZR_CLASS_DEFAULT_NAPALM_TIME 10.0
|
#define ZR_CLASS_DEFAULT_NAPALM_TIME 10.0
|
||||||
#define ZR_CLASS_DEFAULT_IMMUNITY_MODE ZR_CLASS_IMMUNITY_DISABLED
|
#define ZR_CLASS_DEFAULT_IMMUNITY_MODE ZR_CLASS_IMMUNITY_DISABLED
|
||||||
#define ZR_CLASS_DEFAULT_IMMUNITY_AMOUNT 0.0
|
#define ZR_CLASS_DEFAULT_IMMUNITY_AMOUNT 0.0
|
||||||
@ -141,6 +142,8 @@
|
|||||||
/**
|
/**
|
||||||
* @section Attribute limit values. Used when validating.
|
* @section Attribute limit values. Used when validating.
|
||||||
*/
|
*/
|
||||||
|
#define ZR_CLASS_TEAM_MIN 0
|
||||||
|
#define ZR_CLASS_TEAM_MAX 2
|
||||||
#define ZR_CLASS_NAME_MIN 1
|
#define ZR_CLASS_NAME_MIN 1
|
||||||
#define ZR_CLASS_DESCRIPTION_MIN 1
|
#define ZR_CLASS_DESCRIPTION_MIN 1
|
||||||
/** Model path is checked for existance. */
|
/** Model path is checked for existance. */
|
||||||
@ -192,19 +195,20 @@
|
|||||||
#define ZR_CLASS_FLAG_OVERLAY_PATH (1<<9)
|
#define ZR_CLASS_FLAG_OVERLAY_PATH (1<<9)
|
||||||
#define ZR_CLASS_FLAG_NVGS (1<<10)
|
#define ZR_CLASS_FLAG_NVGS (1<<10)
|
||||||
#define ZR_CLASS_FLAG_FOV (1<<11)
|
#define ZR_CLASS_FLAG_FOV (1<<11)
|
||||||
#define ZR_CLASS_FLAG_NAPALM_TIME (1<<12)
|
#define ZR_CLASS_FLAG_HAS_NAPALM (1<<12)
|
||||||
#define ZR_CLASS_FLAG_IMMUNITY_MODE (1<<13)
|
#define ZR_CLASS_FLAG_NAPALM_TIME (1<<13)
|
||||||
#define ZR_CLASS_FLAG_IMMUNITY_AMOUNT (1<<14)
|
#define ZR_CLASS_FLAG_IMMUNITY_MODE (1<<14)
|
||||||
#define ZR_CLASS_FLAG_NO_FALL_DAMAGE (1<<15)
|
#define ZR_CLASS_FLAG_IMMUNITY_AMOUNT (1<<15)
|
||||||
#define ZR_CLASS_FLAG_HEALTH (1<<16)
|
#define ZR_CLASS_FLAG_NO_FALL_DAMAGE (1<<16)
|
||||||
#define ZR_CLASS_FLAG_HEALTH_REGEN_INTERVAL (1<<17)
|
#define ZR_CLASS_FLAG_HEALTH (1<<17)
|
||||||
#define ZR_CLASS_FLAG_HEALTH_REGEN_AMOUNT (1<<18)
|
#define ZR_CLASS_FLAG_HEALTH_REGEN_INTERVAL (1<<18)
|
||||||
#define ZR_CLASS_FLAG_HEALTH_INFECT_GAIN (1<<19)
|
#define ZR_CLASS_FLAG_HEALTH_REGEN_AMOUNT (1<<19)
|
||||||
#define ZR_CLASS_FLAG_KILL_BONUS (1<<20)
|
#define ZR_CLASS_FLAG_HEALTH_INFECT_GAIN (1<<20)
|
||||||
#define ZR_CLASS_FLAG_SPEED (1<<21)
|
#define ZR_CLASS_FLAG_KILL_BONUS (1<<21)
|
||||||
#define ZR_CLASS_FLAG_KNOCKBACK (1<<22)
|
#define ZR_CLASS_FLAG_SPEED (1<<22)
|
||||||
#define ZR_CLASS_FLAG_JUMP_HEIGHT (1<<23)
|
#define ZR_CLASS_FLAG_KNOCKBACK (1<<23)
|
||||||
#define ZR_CLASS_FLAG_JUMP_DISTANCE (1<<24)
|
#define ZR_CLASS_FLAG_JUMP_HEIGHT (1<<24)
|
||||||
|
#define ZR_CLASS_FLAG_JUMP_DISTANCE (1<<25)
|
||||||
/**
|
/**
|
||||||
* @endsection
|
* @endsection
|
||||||
*/
|
*/
|
||||||
@ -234,6 +238,7 @@ enum ClassAttributes
|
|||||||
class_fov,
|
class_fov,
|
||||||
|
|
||||||
/* Effects */
|
/* Effects */
|
||||||
|
bool:class_has_napalm,
|
||||||
Float:class_napalm_time,
|
Float:class_napalm_time,
|
||||||
|
|
||||||
/* Player behaviour */
|
/* Player behaviour */
|
||||||
@ -420,6 +425,7 @@ ClassLoad()
|
|||||||
|
|
||||||
|
|
||||||
/* Effects */
|
/* Effects */
|
||||||
|
ClassData[ClassCount][class_has_napalm] = bool:KvGetNum(kvClassData, "have_napalm", ZR_CLASS_DEFAULT_HAS_NAPALM);
|
||||||
ClassData[ClassCount][class_napalm_time] = KvGetFloat(kvClassData, "napalm_time", ZR_CLASS_DEFAULT_NAPALM_TIME);
|
ClassData[ClassCount][class_napalm_time] = KvGetFloat(kvClassData, "napalm_time", ZR_CLASS_DEFAULT_NAPALM_TIME);
|
||||||
|
|
||||||
|
|
||||||
@ -528,6 +534,7 @@ bool:ClassReloadDataCache()
|
|||||||
ClassDataCache[classindex][class_fov] = ClassData[classindex][class_fov];
|
ClassDataCache[classindex][class_fov] = ClassData[classindex][class_fov];
|
||||||
|
|
||||||
/* Effects */
|
/* Effects */
|
||||||
|
ClassDataCache[classindex][class_has_napalm] = ClassData[classindex][class_has_napalm];
|
||||||
ClassDataCache[classindex][class_napalm_time] = ClassData[classindex][class_napalm_time];
|
ClassDataCache[classindex][class_napalm_time] = ClassData[classindex][class_napalm_time];
|
||||||
|
|
||||||
/* Player behaviour */
|
/* Player behaviour */
|
||||||
@ -591,6 +598,7 @@ bool:ClassReloadPlayerCache(client, classindex, cachetype = ZR_CLASS_CACHE_MODIF
|
|||||||
ClassPlayerCache[client][class_fov] = ClassData[classindex][class_fov];
|
ClassPlayerCache[client][class_fov] = ClassData[classindex][class_fov];
|
||||||
|
|
||||||
/* Effects */
|
/* Effects */
|
||||||
|
ClassPlayerCache[client][class_has_napalm] = ClassData[classindex][class_has_napalm];
|
||||||
ClassPlayerCache[client][class_napalm_time] = ClassData[classindex][class_napalm_time];
|
ClassPlayerCache[client][class_napalm_time] = ClassData[classindex][class_napalm_time];
|
||||||
|
|
||||||
/* Player behaviour */
|
/* Player behaviour */
|
||||||
@ -628,6 +636,7 @@ bool:ClassReloadPlayerCache(client, classindex, cachetype = ZR_CLASS_CACHE_MODIF
|
|||||||
ClassPlayerCache[client][class_fov] = ClassDataCache[classindex][class_fov];
|
ClassPlayerCache[client][class_fov] = ClassDataCache[classindex][class_fov];
|
||||||
|
|
||||||
/* Effects */
|
/* Effects */
|
||||||
|
ClassPlayerCache[client][class_has_napalm] = ClassDataCache[classindex][class_has_napalm];
|
||||||
ClassPlayerCache[client][class_napalm_time] = ClassDataCache[classindex][class_napalm_time];
|
ClassPlayerCache[client][class_napalm_time] = ClassDataCache[classindex][class_napalm_time];
|
||||||
|
|
||||||
/* Player behaviour */
|
/* Player behaviour */
|
||||||
@ -794,6 +803,9 @@ ClassDumpData(index, cachetype, String:buffer[], maxlen)
|
|||||||
Format(attribute, sizeof(attribute), "fov: \"%d\"\n", ClassGetFOV(index, cachetype));
|
Format(attribute, sizeof(attribute), "fov: \"%d\"\n", ClassGetFOV(index, cachetype));
|
||||||
cellcount += StrCat(buffer, maxlen, attribute);
|
cellcount += StrCat(buffer, maxlen, attribute);
|
||||||
|
|
||||||
|
Format(attribute, sizeof(attribute), "has_napalm: \"%d\"\n", ClassGetHasNapalm(index, cachetype));
|
||||||
|
cellcount += StrCat(buffer, maxlen, attribute);
|
||||||
|
|
||||||
Format(attribute, sizeof(attribute), "napalm_time: \"%f\"\n", ClassGetNapalmTime(index, cachetype));
|
Format(attribute, sizeof(attribute), "napalm_time: \"%f\"\n", ClassGetNapalmTime(index, cachetype));
|
||||||
cellcount += StrCat(buffer, maxlen, attribute);
|
cellcount += StrCat(buffer, maxlen, attribute);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user