Merged heads.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: apply.inc
|
||||
* Type: Core
|
||||
@ -93,8 +93,7 @@ bool:ClassApplyModel(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER)
|
||||
if (strcmp(modelpath, "random", false) == 0)
|
||||
{
|
||||
// TODO: Make a function that gets a random model from the specified team.
|
||||
new randmodel = GetRandomInt(0, GetArraySize(arrayModels) - 1);
|
||||
GetArrayString(arrayModels, randmodel, modelpath, sizeof(modelpath));
|
||||
ModelsGetRandomModelIndex(modelpath, sizeof(modelpath), false, true);
|
||||
Format(modelpath, sizeof(modelpath), "%s.mdl", modelpath);
|
||||
}
|
||||
|
||||
@ -211,8 +210,8 @@ bool:ClassApplyNightVision(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER
|
||||
nvgs = ClassGetNvgs(classindex, cachetype);
|
||||
}
|
||||
|
||||
ToolsClientNightVision(client, nvgs);
|
||||
ToolsClientNightVision(client, nvgs, false);
|
||||
ToolsSetClientNightVision(client, nvgs);
|
||||
ToolsSetClientNightVision(client, nvgs, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: attributes.inc
|
||||
* Type: Core
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: classcommands.inc
|
||||
* Type: Core
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: classevents.inc
|
||||
* Type: Core
|
||||
@ -93,6 +93,12 @@ ClassOnClientSpawn(client)
|
||||
GetClientModel(client, originalmodel, sizeof(originalmodel));
|
||||
strcopy(ClassOriginalPlayerModel[client], PLATFORM_MAX_PATH, originalmodel);
|
||||
|
||||
// Exclude special class flags like mother zombies and admin classes.
|
||||
new denyflags = ZR_CLASS_SPECIALFLAGS;
|
||||
|
||||
// Allow admin classes if admin.
|
||||
denyflags -= ZRIsClientAdmin(client) ? ZR_CLASS_FLAG_ADMIN_ONLY : 0;
|
||||
|
||||
// Get random class setting.
|
||||
new bool:randomclass = GetConVarBool(g_hCvarsList[CVAR_CLASSES_RANDOM]);
|
||||
|
||||
@ -101,15 +107,15 @@ ClassOnClientSpawn(client)
|
||||
if (randomclass || StrEqual(steamid, "BOT"))
|
||||
{
|
||||
// Get random classes for each type.
|
||||
new randomzombie = ClassGetRandomClass(ZR_CLASS_TEAM_ZOMBIES);
|
||||
new randomhuman = ClassGetRandomClass(ZR_CLASS_TEAM_HUMANS);
|
||||
new randomzombie = ClassGetRandomClass(ZR_CLASS_TEAM_ZOMBIES, _, _, denyflags);
|
||||
new randomhuman = ClassGetRandomClass(ZR_CLASS_TEAM_HUMANS, _, _, denyflags);
|
||||
|
||||
// Mark zombie class as selected.
|
||||
// Save selected zombie class index.
|
||||
ClassSelected[client][ZR_CLASS_TEAM_ZOMBIES] = randomzombie;
|
||||
ClassGetName(randomzombie, classname, sizeof(classname), ZR_CLASS_TEAM_ZOMBIES);
|
||||
TranslationPrintToChat(client, "Classes random assignment", classname);
|
||||
|
||||
// Mark human class as selected.
|
||||
// Save selected human class index.
|
||||
ClassSelected[client][ZR_CLASS_TEAM_HUMANS] = randomhuman;
|
||||
ClassGetName(randomhuman, classname, sizeof(classname), ZR_CLASS_TEAM_HUMANS);
|
||||
TranslationPrintToChat(client, "Classes random assignment", classname);
|
||||
@ -193,11 +199,29 @@ ClassOnClientInfected(client, bool:motherzombie = false)
|
||||
{
|
||||
// Get random regular zombie class. Remove admin flag if admin.
|
||||
motherindex = ClassGetRandomClass(ZR_CLASS_TEAM_ZOMBIES, _, _, ZR_CLASS_SPECIALFLAGS - isadmin);
|
||||
|
||||
// Validate index. Do not change class if it's invalid.
|
||||
if (ClassValidateIndex(motherindex))
|
||||
{
|
||||
// Change class.
|
||||
classindex = motherindex;
|
||||
}
|
||||
}
|
||||
else if (StrEqual(motherzombiesetting, "motherzombies", false))
|
||||
{
|
||||
// Get random mother zombie class.
|
||||
motherindex = ClassGetRandomClass(ZR_CLASS_TEAM_ZOMBIES, _, ZR_CLASS_FLAG_MOTHER_ZOMBIE, isadmin);
|
||||
// Get random mother zombie class. Include admin classes if admin.
|
||||
motherindex = ClassGetRandomClass(ZR_CLASS_TEAM_ZOMBIES, _, ZR_CLASS_FLAG_MOTHER_ZOMBIE + isadmin, ZR_CLASS_FLAG_ADMIN_ONLY - isadmin);
|
||||
|
||||
// Validate index. Do not change class if it's invalid.
|
||||
if (ClassValidateIndex(motherindex))
|
||||
{
|
||||
// This is a mother zombie class. Reset mother zombie setting so
|
||||
// class skills aren't improved.
|
||||
motherzombie = false;
|
||||
|
||||
// Change class.
|
||||
classindex = motherindex;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: classmenus.inc
|
||||
* Type: Core
|
||||
@ -384,7 +384,7 @@ public ClassTeamSelectHandle(Handle:menu, MenuAction:action, client, slot)
|
||||
{
|
||||
if (slot == MenuCancel_ExitBack)
|
||||
{
|
||||
ZRAdminMenu(client);
|
||||
ZAdminMenu(client);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: clientalpha.inc
|
||||
* Type: Core
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: clientoverlays.inc
|
||||
* Type: Core
|
||||
@ -73,12 +73,8 @@ ClassOverlayOnCommandsHook()
|
||||
*/
|
||||
ClassOverlayOnCookiesCreate()
|
||||
{
|
||||
// If cookie doesn't already exist, then create it.
|
||||
g_hOverlayEnabledCookie = FindClientCookie(CLASSOVERLAY_COOKIE_ENABLED);
|
||||
if (g_hOverlayEnabledCookie == INVALID_HANDLE)
|
||||
{
|
||||
g_hOverlayEnabledCookie = RegClientCookie(CLASSOVERLAY_COOKIE_ENABLED, "The toggle state of the class overlay.", CookieAccess_Public);
|
||||
}
|
||||
// Create overlay cookie.
|
||||
g_hOverlayEnabledCookie = RegClientCookie(CLASSOVERLAY_COOKIE_ENABLED, "The toggle state of the class overlay.", CookieAccess_Protected);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -141,7 +137,7 @@ ClassOverlayInitialize(client, const String:overlay[])
|
||||
decl String:togglecmds[CLASSOVERLAY_TOGGLE_MAX_CMDS * CLASSOVERLAY_TOGGLE_MAX_LENGTH];
|
||||
GetConVarString(g_hCvarsList[CVAR_CLASSES_OVERLAY_TOGGLECMDS], togglecmds, sizeof(togglecmds));
|
||||
|
||||
TranslationPrintHUDText(client, "Classes overlay toggle", togglecmds);
|
||||
TranslationPrintHintText(client, "Classes overlay toggle", togglecmds);
|
||||
}
|
||||
|
||||
// Display class overlays.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: filtertools.inc
|
||||
* Type: Core
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: healthregen.inc
|
||||
* Type: Core
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ============================================================================
|
||||
*
|
||||
* Zombie:Reloaded
|
||||
* Zombie:Reloaded
|
||||
*
|
||||
* File: playerclasses.inc
|
||||
* Type: Core
|
||||
@ -166,9 +166,9 @@
|
||||
#define ZR_CLASS_SPEED_MAX 2000.0
|
||||
#define ZR_CLASS_KNOCKBACK_MIN -30.0
|
||||
#define ZR_CLASS_KNOCKBACK_MAX 30.0
|
||||
#define ZR_CLASS_JUMP_HEIGHT_MIN -500.0
|
||||
#define ZR_CLASS_JUMP_HEIGHT_MAX 500.0
|
||||
#define ZR_CLASS_JUMP_DISTANCE_MIN -5.0
|
||||
#define ZR_CLASS_JUMP_HEIGHT_MIN 0.0
|
||||
#define ZR_CLASS_JUMP_HEIGHT_MAX 5.0
|
||||
#define ZR_CLASS_JUMP_DISTANCE_MIN 0.0
|
||||
#define ZR_CLASS_JUMP_DISTANCE_MAX 5.0
|
||||
/**
|
||||
* @endsection
|
||||
@ -488,7 +488,7 @@ ClassLoad(bool:keepMultipliers = false)
|
||||
ClassData[ClassCount][class_health] = KvGetNum(kvClassData, "health", ZR_CLASS_DEFAULT_HEALTH);
|
||||
ClassData[ClassCount][class_health_regen_interval] = KvGetFloat(kvClassData, "health_regen_interval", ZR_CLASS_DEFAULT_HEALTH_REGEN_INTERVAL);
|
||||
ClassData[ClassCount][class_health_regen_amount] = KvGetNum(kvClassData, "health_regen_amount", ZR_CLASS_DEFAULT_HEALTH_REGEN_AMOUNT);
|
||||
ClassData[ClassCount][class_health_infect_gain] = KvGetNum(kvClassData, "health_infect_bonus", ZR_CLASS_DEFAULT_HEALTH_INFECT_GAIN);
|
||||
ClassData[ClassCount][class_health_infect_gain] = KvGetNum(kvClassData, "health_infect_gain", ZR_CLASS_DEFAULT_HEALTH_INFECT_GAIN);
|
||||
ClassData[ClassCount][class_kill_bonus] = KvGetNum(kvClassData, "kill_bonus", ZR_CLASS_DEFAULT_KILL_BONUS);
|
||||
|
||||
ClassData[ClassCount][class_speed] = KvGetFloat(kvClassData, "speed", ZR_CLASS_DEFAULT_SPEED);
|
||||
|
Reference in New Issue
Block a user