Merged heads.

This commit is contained in:
Greyscale 2009-04-16 01:18:26 +02:00
commit b909ff0739
15 changed files with 447 additions and 96 deletions

View File

@ -32,6 +32,7 @@ CreateCommands()
RegAdminCmd("zr_anticamp_list", Command_AnticampList, ADMFLAG_GENERIC, "List current volumes.");
RegConsoleCmd("zr_log_flags", Command_LogFlags, "List available logging flags.");
RegConsoleCmd("zr_class_dump", Command_ClassDump, "Dumps class data at a specified index in the specified cache. Usage: zr_class_dump <cachetype> <index|targetname>");
}
public Action:Command_Infect(client, argc)

View File

@ -19,7 +19,7 @@ enum ZRSettings
Handle:CVAR_CLASSES,
Handle:CVAR_CLASSES_SPAWN,
Handle:CVAR_CLASSES_RANDOM,
Handle:CVAR_CLASSES_DEFAULT,
//Handle:CVAR_CLASSES_DEFAULT,
Handle:CVAR_CLASSES_DEFAULT_ZOMBIE,
Handle:CVAR_CLASSES_DEFAULT_HUMAN,
Handle:CVAR_CLASSES_DEFAULT_ADMIN,
@ -43,6 +43,7 @@ enum ZRSettings
Handle:CVAR_ZOMBIE_ALPHA_DAMAGE,
Handle:CVAR_OVERLAY_REDISPLAY,
Handle:CVAR_ZVISION_ALLOW_DISABLE,
Handle:CVAR_MENU_AUTOCLOSE,
Handle:CVAR_DARK,
Handle:CVAR_DARK_LEVEL,
Handle:CVAR_DARK_SKY,
@ -108,7 +109,7 @@ CreateCvars()
gCvars[CVAR_CLASSES] = CreateConVar("zr_classes", "1", "Enable zombie classes");
gCvars[CVAR_CLASSES_SPAWN] = CreateConVar("zr_classes_spawn", "0", "Classmenu is re-displayed every spawn (0: Disable)");
gCvars[CVAR_CLASSES_RANDOM] = CreateConVar("zr_classes_random", "0", "A random class is assigned to each player every round. Overrides zr_classes_spawn and default classes. (0: Disable)");
gCvars[CVAR_CLASSES_DEFAULT] = CreateConVar("zr_classes_default", "classic", "Default class selected for all players when they connect, or \"random\" to select a random class. Usage zr_classes_default <class name|\"random\">");
//gCvars[CVAR_CLASSES_DEFAULT] = CreateConVar("zr_classes_default", "classic", "Default class selected for all players when they connect, or \"random\" to select a random class. Usage zr_classes_default <class name|\"random\">");
gCvars[CVAR_CLASSES_DEFAULT_ZOMBIE] = CreateConVar("zr_classes_default_zombie", "", "Default zombie class selected for all players when they connect. Use \"random\" to select a random class, or blank to use class config defaults.");
gCvars[CVAR_CLASSES_DEFAULT_HUMAN] = CreateConVar("zr_classes_default_human", "", "Default human class selected for all players when they connect. Use \"random\" to select a random class, or blank to use class config defaults.");
gCvars[CVAR_CLASSES_DEFAULT_ADMIN] = CreateConVar("zr_classes_default_admin", "", "Default admin-only class selected for admins when they connect. Use \"random\" to select a random class, or blank to use class config defaults.");
@ -132,6 +133,7 @@ CreateCvars()
gCvars[CVAR_ZOMBIE_ALPHA_DAMAGE] = CreateConVar("zr_zombie_alpha_damage", "0", "How much damage to do before changing transparency.");
gCvars[CVAR_OVERLAY_REDISPLAY] = CreateConVar("zr_overlay_redisplay", "3", "Frequency, in seconds, to display overlay on the client's screen (Never go below 0.1, 0.2 seems safe)");
gCvars[CVAR_ZVISION_ALLOW_DISABLE] = CreateConVar("zr_zvision_allow_disable", "1", "Allow users to disable ZVision with their nightvision key (0: Disable)");
gCvars[CVAR_MENU_AUTOCLOSE] = CreateConVar("zr_menu_autoclose", "0", "Automatically close menus on selection. If disabled the menu will remain open.");
gCvars[CVAR_DARK] = CreateConVar("zr_dark", "0", "Default value for darkening maps, most dislike this feature (0: Disable)");
gCvars[CVAR_DARK_LEVEL] = CreateConVar("zr_dark_level", "a", "The darkness of the map, a being the darkest, z being extremely bright when zr_dark is 1 (n: Default)");
gCvars[CVAR_DARK_SKY] = CreateConVar("zr_dark_sky", "sky_borealis01", "The sky the map will have when zr_dark is 1");

View File

@ -9,12 +9,12 @@
MainMenu(client)
{
new Handle:menu_main = CreateMenu(MainMenuHandle);
new itemdraw = (IsClientAdmin(client)) ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED;
SetGlobalTransTarget(client);
SetMenuTitle(menu_main, "%t\n ", "!zmenu title");
decl String:zmenu[128];
decl String:zadmin[128];
decl String:zclass[128];
decl String:zmarket[128];
@ -22,7 +22,6 @@ MainMenu(client)
decl String:ztele[128];
decl String:zhp[128];
Format(zmenu, sizeof(zmenu), "%t", "!zmenu menu");
Format(zadmin, sizeof(zadmin), "%t", "!zmenu admin");
Format(zclass, sizeof(zclass), "%t", "!zmenu class", ITEMDRAW_DISABLED);
Format(zmarket, sizeof(zmarket), "%t", "!zmenu market");
@ -30,17 +29,7 @@ MainMenu(client)
Format(ztele, sizeof(ztele), "%t", "!zmenu tele");
Format(zhp, sizeof(zhp), "%t (%d HP)", "!zmenu hp", GetClientHealth(client));
AddMenuItem(menu_main, "zmenu", zmenu, ITEMDRAW_DISABLED);
if (GetAdminFlag(GetUserAdmin(client), Admin_Generic))
{
AddMenuItem(menu_main, "zadmin", zadmin);
}
else
{
AddMenuItem(menu_main, "zadmin", zadmin, ITEMDRAW_DISABLED);
}
AddMenuItem(menu_main, "zadmin", zadmin, itemdraw);
AddMenuItem(menu_main, "zclass", zclass);
if (market)
@ -65,39 +54,36 @@ public MainMenuHandle(Handle:menu_main, MenuAction:action, client, slot)
{
switch(slot)
{
case 1:
case 0:
{
if (!ZRAdminMenu(client))
{
MainMenu(client);
}
}
case 2:
case 1:
{
/*if (!ZClass(client))
{
MainMenu(client);
}*/
ClassMenuMain(client);
}
case 3:
case 2:
{
if (!ZMarket(client))
{
MainMenu(client);
}
}
case 4:
case 3:
{
ZSpawn(client);
}
case 5:
case 4:
{
if (!ZTele(client))
{
MainMenu(client);
}
}
case 6:
case 5:
{
// Toggle ZHP.
ZHPToggle(client);
@ -187,4 +173,4 @@ public ClassMenuHandle(Handle:menu_classes, MenuAction:action, client, slot)
{
CloseHandle(menu_classes);
}
}*/
}*/

View File

@ -5,7 +5,6 @@
*
* File: apply.inc
* Description: Functions for applying attributes and effects on a client.
* Author: Richard Helgeby
*
* ============================================================================
*/

View File

@ -5,7 +5,6 @@
*
* File: attributes.inc
* Description: Retrieving class attributes from certain caches.
* Author: Richard Helgeby
*
* ============================================================================
*/

View File

@ -0,0 +1,99 @@
/*
* ============================================================================
*
* Zombie:Reloaded
*
* File: classcommands.inc
* Description: Console commands for working with classes.
*
* ============================================================================
*/
/**
* Dumps class data at a specified index in the specified cache.
*/
public Action:Command_ClassDump(client, argc)
{
decl String:syntax[1024];
syntax[0] = 0;
if (argc < 2)
{
// Write syntax info.
StrCat(syntax, sizeof(syntax), "Dumps class data at a specified index in the specified cache. Usage: zr_class_dump <cachetype> <index|targetname>\n\n");
StrCat(syntax, sizeof(syntax), "Cache types:\n");
StrCat(syntax, sizeof(syntax), "original - Unmodified class data\n");
StrCat(syntax, sizeof(syntax), "modified - Newest class data\n");
StrCat(syntax, sizeof(syntax), "player - Players class data\n");
ReplyToCommand(client, syntax);
return Plugin_Handled;
}
new cachetype = -1;
new index = -1;
decl String:type[64];
decl String:target[64];
decl String:buffer[2048];
// Quick initialize buffer.
buffer[0] = 0;
// Get cache type.
GetCmdArg(1, type, sizeof(type));
// Set cache type depending on parameter setting.
if (StrEqual(type, "original", false))
{
cachetype = ZR_CLASS_CACHE_ORIGINAL;
}
else if (StrEqual(type, "modified", false))
{
cachetype = ZR_CLASS_CACHE_MODIFIED;
}
else if (StrEqual(type, "player", false))
{
cachetype = ZR_CLASS_CACHE_PLAYER;
// Get client index.
GetCmdArg(2, target, sizeof(target));
index = FindTarget(client, target, _, false);
// Check if failed.
if (index < 0)
{
ReplyToCommand(client, "Invalid target name.");
return Plugin_Handled;
}
}
// Check if cachetype is valid.
if (cachetype < 0)
{
ReplyToCommand(client, "Invalid cache type.");
return Plugin_Handled;
}
// Validate class index.
if (cachetype != ZR_CLASS_CACHE_PLAYER)
{
// Get class index.
GetCmdArg(2, target, sizeof(target));
index = StringToInt(target);
if (!ClassValidateIndex(index))
{
ReplyToCommand(client, "Invalid class index.");
return Plugin_Handled;
}
}
// Dump the specified cache.
ReplyToCommand(client, "DUMPING CACHE: \"%s\" (%d classes total)\n========================================\n", type, ClassCount);
ClassDumpData(index, cachetype, buffer, sizeof(buffer));
ZR_ReplyToCommandLong(client, buffer);
return Plugin_Handled;
}

View File

@ -5,7 +5,6 @@
*
* File: classevents.inc
* Description: Functions for handling class related events.
* Author: Richard Helgeby
*
* ============================================================================
*/
@ -45,7 +44,7 @@ ClassOnClientSpawn(client)
if (showmenu && !randomclass)
{
//ClassMenu(client);
ClassMenuMain(client);
}
// Assign random classes if enabled.

View File

@ -5,7 +5,6 @@
*
* File: classmenus.inc
* Description: Provides functions for managing class menus.
* Author: Richard Helgeby, Greyscale
*
* ============================================================================
*/
@ -34,15 +33,25 @@ Admin mode is enabled!
*/
/* ------------------------------------
*
* MAIN CLASS MENU
*
* ------------------------------------
*/
/**
* Displays the main class menu with the players class settings.
*
* @param client The client index.
*/
ClassMenuMain(client)
{
new Handle:classmenu = CreateMenu(ClassMenuMainHandle);
new Handle:menu = CreateMenu(ClassMenuMainHandle);
new itemdraw = (IsClientAdmin(client)) ? ITEMDRAW_DEFAULT : ITEMDRAW_DISABLED;
SetGlobalTransTarget(client);
SetMenuTitle(classmenu, "%t\n", "!zclass title");
SetMenuTitle(menu, "%t\n", "!zclass title");
decl String:zombieclass[128];
decl String:humanclass[128];
@ -53,78 +62,216 @@ ClassMenuMain(client)
decl String:adminselect[128];
decl String:inadminmnode[128];
decl String:adminmnode[128];
decl String:toggleadminmnode[128];
decl String:adminmode[128];
decl String:toggleadminmode[128];
// Check if the player is in admin mode.
if (ClassPlayerInAdminMode(client))
if (ClassPlayerInAdminMode[client])
{
// Notify the player.
Format(adminmode, sizeof(adminmode), "%t\n", "!zclass admin mode enabled");
AddMenuItem(classmenu, "", adminmode, ITEMDRAW_RAWLINE);
Format(inadminmnode, sizeof(inadminmnode), "%t\n", "!zclass admin mode enabled");
AddMenuItem(menu, "", inadminmnode, ITEMDRAW_RAWLINE);
}
// List zombie class options.
ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_ZOMBIES, zombieclass, sizeof(zombieclass), ZR_CLASS_CACHE_MODIFIED);
Format(zombieselect, sizeof(zombieselect), "%t\n-%s", "!zclass zombie", zombieclass);
AddMenuItem(classmenu, "", zombieselect);
ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_ZOMBIES], zombieclass, sizeof(zombieclass), ZR_CLASS_CACHE_MODIFIED);
Format(zombieselect, sizeof(zombieselect), "%t\n %s", "!zclass zombie", zombieclass);
AddMenuItem(menu, "", zombieselect);
// List human class options.
ClassGetName(client, humanclass, sizeof(zombieclass));
Format(zombieselect, sizeof(zombieselect), "%t\n-%s", "!zclass human", humanclass);
AddMenuItem(classmenu, "", zombieselect);
// List admin class options.
ClassGetName(client, adminclass, sizeof(adminclass));
Format(adminselect, sizeof(adminselect), "%t\n-%s", "!zclass admin", adminclass);
AddMenuItem(classmenu, "", adminselect);
ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_HUMANS], humanclass, sizeof(humanclass), ZR_CLASS_CACHE_MODIFIED);
Format(humanselect, sizeof(humanselect), "%t\n %s", "!zclass human", humanclass);
AddMenuItem(menu, "", humanselect);
if (IsClientAdmin(client))
{
// Show admin mode toggle option.
AddMenuItem(classmenu, "", " ", ITEMDRAW_SPACER);
// List admin class options.
ClassGetName(ClassSelected[client][ZR_CLASS_TEAM_ADMINS], adminclass, sizeof(adminclass), ZR_CLASS_CACHE_MODIFIED);
Format(adminselect, sizeof(adminselect), "%t\n %s", "!zclass admin", adminclass);
AddMenuItem(menu, "", adminselect, itemdraw);
// TODO: Translate or use core phrases!
// Set admin mode status string.
if (ClassPlayerAdminMode[client])
{
Format(adminmnode, sizeof(adminmnode), "Enabled");
Format(adminmode, sizeof(adminmode), "%t", "On");
}
else
{
Format(adminmnode, sizeof(adminmnode), "Disabled");
Format(adminmode, sizeof(adminmode), "%t", "Off");
}
Format(toggleadminmode, sizeof(toggleadminmode), "%t\n-%s", "!zclass admin mode toggle", adminmode);
// Show admin mode toggle option.
Format(toggleadminmode, sizeof(toggleadminmode), "%t\n %s", "!zclass admin mode toggle", adminmode);
AddMenuItem(menu, "", toggleadminmode);
}
/*for (new x = 0; x < classCount; x++)
{
GetClassName(x, display, sizeof(display));
GetClassMenuDescription(x, menu_description, sizeof(menu_description));
if (pNextClass[client] == -1)
{
if (x == pClass[client])
{
Format(display, sizeof(display), "%s (current)", display);
}
}
else if (x == pNextClass[client])
{
Format(display, sizeof(display), "%s (current)", display);
}
Format(display, sizeof(display), "%s\n %s", display, menu_description);
AddMenuItem(menu_classes, "", display);
}
SetMenuExitBackButton(menu_classes, true);*/
DisplayMenu(classmenu, client, MENU_TIME_FOREVER);
SetMenuExitBackButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
ClassMenuMainHandle(Handle:classmenu, MenuAction:action, client, slot)
/**
* Main class menu handle.
*/
public ClassMenuMainHandle(Handle:menu, MenuAction:action, client, slot)
{
switch (action)
{
case MenuAction_Select:
{
switch(slot)
{
case 0:
{
ClassMenuSelect(client, ZR_CLASS_TEAM_ZOMBIES);
}
case 1:
{
ClassMenuSelect(client, ZR_CLASS_TEAM_HUMANS);
}
case 2:
{
ClassMenuSelect(client, ZR_CLASS_TEAM_ADMINS);
}
case 3:
{
ClassMenuToggleAdmin(client);
}
}
}
case MenuAction_End:
{
CloseHandle(menu);
}
case MenuAction_Cancel:
{
if (slot == MenuCancel_ExitBack)
{
MainMenu(client);
}
}
}
}
/* ------------------------------------
*
* ZOMBIE CLASS SELECTION MENU
*
* ------------------------------------
*/
/**
* Displays the class selection menu.
*
* @param client The client index.
* @param teamid What class types to display.
*/
ClassMenuSelect(client, teamid)
{
new Handle:menu = CreateMenu(ClassMenuSelectHandle);
new arraycount;
new classindex;
decl String:title[64];
decl String:classname[64];
decl String:description[256];
decl String:menuitem[320];
SetGlobalTransTarget(client);
// Set correct menu title depending on team ID.
switch (teamid)
{
case ZR_CLASS_TEAM_ZOMBIES:
{
Format(title, sizeof(title), "%t\n", "!zclass zombie");
}
case ZR_CLASS_TEAM_HUMANS:
{
Format(title, sizeof(title), "%t\n", "!zclass human");
}
case ZR_CLASS_TEAM_ADMINS:
{
Format(title, sizeof(title), "%t\n", "!zclass admin");
}
}
SetMenuTitle(menu, title);
// Create buffer array.
new Handle:classarray = CreateArray();
// Copy all class indexes into the array, with the specified team filter.
if (ClassAddToArray(classarray, teamid))
{
// Get number of classes.
arraycount = GetArraySize(classarray);
// Loop through each class.
for (new i = 0; i < arraycount; i++)
{
// Get index, name and description.
classindex = GetArrayCell(classarray, i);
ClassGetName(classindex, classname, sizeof(classname), ZR_CLASS_CACHE_MODIFIED);
ClassGetDescription(classindex, description, sizeof(description), ZR_CLASS_CACHE_MODIFIED);
// Add menu item.
Format(menuitem, sizeof(menuitem), "%s\n %s", classname, description);
AddMenuItem(menu, classname, menuitem);
}
}
else
SetMenuExitBackButton(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
/**
* Class selection menu handle.
*/
public ClassMenuSelectHandle(Handle:menu, MenuAction:action, client, slot)
{
decl String:classname[64];
new classindex;
new teamid;
new bool:autoclose = GetConVarBool(gCvars[CVAR_MENU_AUTOCLOSE]);
switch (action)
{
case MenuAction_Select:
{
// Get class name from the information string.
GetMenuItem(menu, slot, classname, sizeof(classname));
// Solve class index from the name.
classindex = ClassGetIndex(classname);
// Solve teamid from the class index.
teamid = ClassGetTeamID(classindex, ZR_CLASS_CACHE_MODIFIED);
// Set the players active class to the specified class.
ClassSelected[client][teamid] = classindex;
}
case MenuAction_Cancel:
{
if (slot == MenuCancel_ExitBack)
{
ClassMenuMain(client);
}
}
case MenuAction_End:
{
CloseHandle(menu);
}
}
// Redisplay the main class menu if autoclose is disabled.
if (!autoclose)
{
ClassMenuMain(client);
}
}
ClassMenuToggleAdmin(client)
{
}
}

View File

@ -5,7 +5,6 @@
*
* File: clientalpha.inc
* Description: Handles transparency on clients.
* Author: Richard Helgeby
*
* ============================================================================
*/

View File

@ -5,7 +5,6 @@
*
* File: clientoverlays.inc
* Description: Handles overlays on clients, as a part of class attributes.
* Author: Richard Helgeby
*
* ============================================================================
*/

View File

@ -4,8 +4,7 @@
* Zombie:Reloaded
*
* File: filtertools.inc
* Description: Class system: Validating, getting indexes or lists
* Author: Richard Helgeby
* Description: Class system tools; validating, getting indexes or lists
*
* ============================================================================
*/

View File

@ -5,7 +5,6 @@
*
* File: healthregen.inc
* Description: Functions for managing health regeneration on a client.
* Author: Richard Helgeby
*
* ============================================================================
*/

View File

@ -5,7 +5,6 @@
*
* File: playerclasses.inc
* Description: Provides functions for managing classes.
* Author: Richard Helgeby, Greyscale
*
* ============================================================================
*/
@ -36,12 +35,6 @@
depends on the original class knockback values. A solution might be
to have another array of class data, which is never canged.
TODO: Make a solution with default valueas for each class team, without
using CVARs.
SOLVED: Added boolean team_default class attribute. Default values
will be used from the first class with this value set.
TODO: Make class attributes for for changing model render mode and colors.
TODO: Make class attributes for fancy effects, like a glow (if possible).
@ -249,6 +242,8 @@ new bool:ClassPlayerAdminMode[MAXPLAYERS + 1];
#include "zr/playerclasses/clientalpha"
#include "zr/playerclasses/healthregen"
#include "zr/playerclasses/classevents"
#include "zr/playerclasses/classmenus"
#include "zr/playerclasses/classcommands"
/**
* Loads class attributes from playerclasses.txt into the ClassData array. If
@ -632,3 +627,114 @@ ClassClientSetDefaultIndexes(client = -1)
}
}
}
/**
* Dump class data into a string. String buffer length should be at about 2048
* cells.
*
* @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 (default) - Changed/newest class
* data.
* ZR_CLASS_CACHE_PLAYER - Player cache. If this one is used,
* index will be used as a client index.
* @return Number of cells written.
*/
ClassDumpData(index, cachetype, String:buffer[], maxlen)
{
new cellcount;
decl String:attribute[320];
decl String:format_buffer[256];
if (maxlen == 0)
{
return 0;
}
Format(format_buffer, sizeof(format_buffer), "Class data at index %d:\n", index);
cellcount += StrCat(buffer, maxlen, format_buffer);
cellcount += StrCat(buffer, maxlen, "-------------------------------------------------------------------------------\n");
Format(attribute, sizeof(attribute), "enabled: \"%d\"\n", ClassIsEnabled(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "team: \"%d\"\n", ClassGetTeamID(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "team_default: \"%d\"\n", ClassGetTeamDefault(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
ClassGetName(index, format_buffer, sizeof(format_buffer), cachetype);
Format(attribute, sizeof(attribute), "name: \"%s\"\n", format_buffer);
cellcount += StrCat(buffer, maxlen, attribute);
ClassGetDescription(index, format_buffer, sizeof(format_buffer), cachetype);
Format(attribute, sizeof(attribute), "description: \"%s\"\n", format_buffer);
cellcount += StrCat(buffer, maxlen, attribute);
ClassGetModelPath(index, format_buffer, sizeof(format_buffer), cachetype);
Format(attribute, sizeof(attribute), "model_path: \"%s\"\n", format_buffer);
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "alpha_initial: \"%d\"\n", ClassGetAlphaInitial(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "alpha_damaged: \"%d\"\n", ClassGetAlphaDamaged(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "alpha_damage: \"%d\"\n", ClassGetAlphaDamage(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
ClassGetOverlayPath(index, format_buffer, sizeof(format_buffer), cachetype);
Format(attribute, sizeof(attribute), "overlay_path: \"%s\"\n", format_buffer);
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "nvgs: \"%d\"\n", ClassGetNvgs(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "fov: \"%d\"\n", ClassGetFOV(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "napalm_time: \"%f\"\n", ClassGetNapalmTime(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "immunity_mode: \"%d\"\n", ClassGetImmunityMode(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "immunity_amount: \"%f\"\n", ClassGetImmunityAmount(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "no_fall_damage: \"%d\"\n", ClassGetNoFallDamage(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "health: \"%d\"\n", ClassGetHealth(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "health_regen_interval: \"%f\"\n", ClassGetHealthRegenInterval(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "health_regen_amount: \"%d\"\n", ClassGetHealthRegenAmount(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "health_infect_gain: \"%d\"\n", ClassGetHealthInfectGain(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "kill_bonus: \"%d\"\n", ClassGetKillBonus(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "speed: \"%f\"\n", ClassGetSpeed(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "knockback: \"%f\"\n", ClassGetKnockback(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "jump_height: \"%f\"\n", ClassGetJumpHeight(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
Format(attribute, sizeof(attribute), "jump_distance: \"%f\"\n", ClassGetJumpDistance(index, cachetype));
cellcount += StrCat(buffer, maxlen, attribute);
return cellcount;
}

View File

@ -183,6 +183,23 @@ stock ZR_ReplyToCommand(client, any:...)
ReplyToCommand(client, phrase);
}
/**
* Adds support for printing long strings.
*/
stock ZR_ReplyToCommandLong(client, const String:text[])
{
decl String:partbuffer[1000];
new pos;
new cellswritten = 1; // Initialize for the loop.
while (cellswritten)
{
cellswritten = strcopy(partbuffer, sizeof(partbuffer), text[pos]);
ReplyToCommand(client, partbuffer);
pos += cellswritten;
}
}
stock ZR_PrintToAdminChat(String:message[])
{
decl String:buffer[256];

View File

@ -235,7 +235,7 @@ bool:IsPlayerInList(client)
bool:IsClientPlayer(client)
{
if (client > 0 && client <= maxclients)
if (!IsFakeClient(client) && client > 0 && client <= maxclients)
{
return true;
}
@ -251,7 +251,7 @@ bool:IsClientPlayer(client)
*/
bool:IsClientAdmin(client)
{
if (GetAdminFlag(GetUserAdmin(client), Admin_Generic))
if (IsClientPlayer(client) && GetAdminFlag(GetUserAdmin(client), Admin_Generic))
{
return true;
}