Added support for model with multiple skins (model_skin_index class attribute). Compiles, but not tested.
This commit is contained in:
parent
7e72ede0ca
commit
28e54c36a7
@ -24,6 +24,7 @@
|
|||||||
// name text The class name used in class menu.
|
// name text The class name used in class menu.
|
||||||
// description text The class description used in class menu.
|
// description text The class description used in class menu.
|
||||||
// model_path text Path to model to use. Relative to cstrike folder.
|
// model_path text Path to model to use. Relative to cstrike folder.
|
||||||
|
// model_skin_index number Model skin index to use if model support multiple skins. First skin is 0.
|
||||||
// alpha_initial number Initial transparency setting.
|
// alpha_initial number Initial transparency setting.
|
||||||
// alpha_damaged number Transparency when damaged.
|
// alpha_damaged number Transparency when damaged.
|
||||||
// alpha_damage number How much damage to do before switching alpha.
|
// alpha_damage number How much damage to do before switching alpha.
|
||||||
@ -79,6 +80,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "models/player/zh/zh_corpse002.mdl"
|
"model_path" "models/player/zh/zh_corpse002.mdl"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -124,6 +126,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "models/player/zh/zh_charple001.mdl"
|
"model_path" "models/player/zh/zh_charple001.mdl"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -169,6 +172,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "models/player/zh/zh_zombie003.mdl"
|
"model_path" "models/player/zh/zh_zombie003.mdl"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -214,6 +218,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "models/player/ics/hellknight_red/t_guerilla.mdl"
|
"model_path" "models/player/ics/hellknight_red/t_guerilla.mdl"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -259,6 +264,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "models/player/zh/zh_zombie003.mdl"
|
"model_path" "models/player/zh/zh_zombie003.mdl"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -304,6 +310,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "models/player/zh/zh_charple001.mdl"
|
"model_path" "models/player/zh/zh_charple001.mdl"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -355,6 +362,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "default"
|
"model_path" "default"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -400,6 +408,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "default"
|
"model_path" "default"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -445,6 +454,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "default"
|
"model_path" "default"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -490,6 +500,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "default"
|
"model_path" "default"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
@ -535,6 +546,7 @@
|
|||||||
|
|
||||||
// Model
|
// Model
|
||||||
"model_path" "default"
|
"model_path" "default"
|
||||||
|
"model_skin_index" "0"
|
||||||
"alpha_initial" "255"
|
"alpha_initial" "255"
|
||||||
"alpha_damaged" "255"
|
"alpha_damaged" "255"
|
||||||
"alpha_damage" "0"
|
"alpha_damage" "0"
|
||||||
|
@ -1138,11 +1138,28 @@ the admin-only flag in the <span class="code">flags</span> attribute.</p>
|
|||||||
players.</td>
|
players.</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table></blockquote>
|
</table></blockquote>
|
||||||
|
<p><strong>Warning:</strong> If specifying a model path here, remember to add a
|
||||||
|
matching model entry in the model config file (models.txt), or you will get an error
|
||||||
|
about model was not precached. In worst case the server will crash.</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="commandheader">alpha_spawn</td>
|
<td class="commandheader">model_skin_index</td>
|
||||||
|
<td class="commandheader">number</td>
|
||||||
|
<td class="commandheader">0 - <em>last skin index</em></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="indent" colspan="3">
|
||||||
|
<p>The model skin index to use if the model support multiple skins. First skin is 0.</p>
|
||||||
|
<p><strong>Warning:</strong> Zombie:Reloaded doesn't know how many skins a model has,
|
||||||
|
make sure you use a valid index if modifying it. An invalid value might in worst case
|
||||||
|
crash the server/client.</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td class="commandheader">alpha_initial</td>
|
||||||
<td class="commandheader">number</td>
|
<td class="commandheader">number</td>
|
||||||
<td class="commandheader">0 - 255</td>
|
<td class="commandheader">0 - 255</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -1462,7 +1479,7 @@ the admin-only flag in the <span class="code">flags</span> attribute.</p>
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<p>Formula for converting LMV speed into a prop speed offset:</p>
|
<p>Formula for converting LMV speed into a prop speed offset:</p>
|
||||||
<blockquote><code><em>prop speed offset</em> = ((<em>lmv speed</em> / 300) * 250) - 250</code></blockquote>
|
<blockquote><div><code><em>prop speed offset</em> = ((<em>lmv speed</em> / 300) * 250) - 250</code></div></blockquote>
|
||||||
<p>This calculation can be done directly on a calculator, without any use of parentheses
|
<p>This calculation can be done directly on a calculator, without any use of parentheses
|
||||||
(they aren't needed in this one anyways).</p>
|
(they aren't needed in this one anyways).</p>
|
||||||
</td>
|
</td>
|
||||||
|
@ -88,6 +88,7 @@ bool:ClassApplyModel(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER)
|
|||||||
new ModelTeam:team;
|
new ModelTeam:team;
|
||||||
new access;
|
new access;
|
||||||
new model;
|
new model;
|
||||||
|
new skinIndex = 0;
|
||||||
|
|
||||||
// Get correct index according to cache type.
|
// Get correct index according to cache type.
|
||||||
if (cachetype == ZR_CLASS_CACHE_PLAYER)
|
if (cachetype == ZR_CLASS_CACHE_PLAYER)
|
||||||
@ -102,6 +103,9 @@ bool:ClassApplyModel(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER)
|
|||||||
// Get the model path from the specified cache.
|
// Get the model path from the specified cache.
|
||||||
ClassGetModelPath(index, modelpath, sizeof(modelpath), cachetype);
|
ClassGetModelPath(index, modelpath, sizeof(modelpath), cachetype);
|
||||||
|
|
||||||
|
// Get model skin index.
|
||||||
|
skinIndex = ClassGetModelSkinIndex(index, cachetype);
|
||||||
|
|
||||||
// Get model team setting from the specified cache.
|
// Get model team setting from the specified cache.
|
||||||
team = ModelsTeamIdToTeam(ClassGetTeamID(index, cachetype));
|
team = ModelsTeamIdToTeam(ClassGetTeamID(index, cachetype));
|
||||||
|
|
||||||
@ -185,6 +189,8 @@ bool:ClassApplyModel(client, classindex, cachetype = ZR_CLASS_CACHE_PLAYER)
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetEntityModel(client, modelpath);
|
SetEntityModel(client, modelpath);
|
||||||
|
SetEntProp(client, Prop_Send, "m_nSkin", skinIndex);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,6 +347,38 @@ stock ClassGetModelPath(index, String:buffer[], maxlen, cachetype = ZR_CLASS_CAC
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the model skin index 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 The model skin index in the specified class. -1 on error.
|
||||||
|
*/
|
||||||
|
stock ClassGetModelSkinIndex(index, cachetype = ZR_CLASS_CACHE_PLAYER)
|
||||||
|
{
|
||||||
|
switch (cachetype)
|
||||||
|
{
|
||||||
|
case ZR_CLASS_CACHE_ORIGINAL:
|
||||||
|
{
|
||||||
|
return ClassData[index][Class_ModelSkinIndex];
|
||||||
|
}
|
||||||
|
case ZR_CLASS_CACHE_MODIFIED:
|
||||||
|
{
|
||||||
|
return ClassDataCache[index][Class_ModelSkinIndex];
|
||||||
|
}
|
||||||
|
case ZR_CLASS_CACHE_PLAYER:
|
||||||
|
{
|
||||||
|
return ClassPlayerCache[index][Class_ModelSkinIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the initial alpha value from the specified class.
|
* Gets the initial alpha value from the specified class.
|
||||||
*
|
*
|
||||||
@ -1137,6 +1169,10 @@ stock ClassAttributeNameToFlag(const String:attributename[])
|
|||||||
{
|
{
|
||||||
return ZR_CLASS_MODEL_PATH;
|
return ZR_CLASS_MODEL_PATH;
|
||||||
}
|
}
|
||||||
|
else if (StrEqual(attributename, "model_skin_index", false))
|
||||||
|
{
|
||||||
|
return ZR_CLASS_MODEL_SKIN_INDEX;
|
||||||
|
}
|
||||||
else if (StrEqual(attributename, "alpha_initial", false))
|
else if (StrEqual(attributename, "alpha_initial", false))
|
||||||
{
|
{
|
||||||
return ZR_CLASS_ALPHA_INITIAL;
|
return ZR_CLASS_ALPHA_INITIAL;
|
||||||
@ -1299,6 +1335,7 @@ stock ClassDataTypes:ClassGetAttributeType(attributeflag)
|
|||||||
|
|
||||||
// Integer.
|
// Integer.
|
||||||
case ZR_CLASS_FLAGS,
|
case ZR_CLASS_FLAGS,
|
||||||
|
ZR_CLASS_MODEL_SKIN_INDEX,
|
||||||
ZR_CLASS_ALPHA_INITIAL,
|
ZR_CLASS_ALPHA_INITIAL,
|
||||||
ZR_CLASS_ALPHA_DAMAGED,
|
ZR_CLASS_ALPHA_DAMAGED,
|
||||||
ZR_CLASS_ALPHA_DAMAGE,
|
ZR_CLASS_ALPHA_DAMAGE,
|
||||||
|
@ -702,6 +702,11 @@ stock ClassModifyInteger(classindex, attributeflag, value, Float:multiplier = 0.
|
|||||||
ClassDataCache[classindex][Class_Flags] = value;
|
ClassDataCache[classindex][Class_Flags] = value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case ZR_CLASS_MODEL_SKIN_INDEX:
|
||||||
|
{
|
||||||
|
ClassDataCache[classindex][Class_ModelSkinIndex] = value;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
case ZR_CLASS_ALPHA_INITIAL:
|
case ZR_CLASS_ALPHA_INITIAL:
|
||||||
{
|
{
|
||||||
if (ismultiplier)
|
if (ismultiplier)
|
||||||
|
@ -213,6 +213,17 @@ stock ClassValidateAttributes(classindex, bool:logErrors = false)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Model skin index.
|
||||||
|
new model_skin_index = ClassData[classindex][Class_ModelSkinIndex];
|
||||||
|
if (model_skin_index < ZR_CLASS_MODEL_SKIN_INDEX_MIN)
|
||||||
|
{
|
||||||
|
flags += ZR_CLASS_MODEL_SKIN_INDEX;
|
||||||
|
if (logErrors)
|
||||||
|
{
|
||||||
|
LogEvent(false, LogType_Error, LOG_CORE_EVENTS, LogModule_Playerclasses, "Config Validation", "Warning: Invalid model_skin_index at index %d: %d", classindex, model_skin_index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Alpha, initial.
|
// Alpha, initial.
|
||||||
new alpha_initial = ClassData[classindex][Class_AlphaInitial];
|
new alpha_initial = ClassData[classindex][Class_AlphaInitial];
|
||||||
if (!(alpha_initial >= ZR_CLASS_ALPHA_INITIAL_MIN && alpha_initial <= ZR_CLASS_ALPHA_INITIAL_MAX))
|
if (!(alpha_initial >= ZR_CLASS_ALPHA_INITIAL_MIN && alpha_initial <= ZR_CLASS_ALPHA_INITIAL_MAX))
|
||||||
@ -446,6 +457,13 @@ stock ClassValidateEditableAttributes(attributes[ClassEditableAttributes])
|
|||||||
{
|
{
|
||||||
new flags;
|
new flags;
|
||||||
|
|
||||||
|
// Model skin index.
|
||||||
|
new model_skin_index = attributes[ClassEdit_ModelSkinIndex];
|
||||||
|
if (model_skin_index < ZR_CLASS_MODEL_SKIN_INDEX_MIN)
|
||||||
|
{
|
||||||
|
flags += ZR_CLASS_MODEL_SKIN_INDEX;
|
||||||
|
}
|
||||||
|
|
||||||
// Alpha initial.
|
// Alpha initial.
|
||||||
new alphaInitial = attributes[ClassEdit_AlphaInitial];
|
new alphaInitial = attributes[ClassEdit_AlphaInitial];
|
||||||
if (alphaInitial >= 0)
|
if (alphaInitial >= 0)
|
||||||
|
@ -107,6 +107,7 @@
|
|||||||
#define ZR_CLASS_DEFAULT_NAME "classic"
|
#define ZR_CLASS_DEFAULT_NAME "classic"
|
||||||
#define ZR_CLASS_DEFAULT_DESCRIPTION "Need brains!!! Arrrrggghh!"
|
#define ZR_CLASS_DEFAULT_DESCRIPTION "Need brains!!! Arrrrggghh!"
|
||||||
#define ZR_CLASS_DEFAULT_MODEL_PATH "models/player/zh/zh_zombie003.mdl"
|
#define ZR_CLASS_DEFAULT_MODEL_PATH "models/player/zh/zh_zombie003.mdl"
|
||||||
|
#define ZR_CLASS_DEFAULT_MODEL_SKIN_INDEX 0
|
||||||
#define ZR_CLASS_DEFAULT_ALPHA_INITIAL 255
|
#define ZR_CLASS_DEFAULT_ALPHA_INITIAL 255
|
||||||
#define ZR_CLASS_DEFAULT_ALPHA_DAMAGED 255
|
#define ZR_CLASS_DEFAULT_ALPHA_DAMAGED 255
|
||||||
#define ZR_CLASS_DEFAULT_ALPHA_DAMAGE 0
|
#define ZR_CLASS_DEFAULT_ALPHA_DAMAGE 0
|
||||||
@ -142,6 +143,7 @@
|
|||||||
#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. */
|
||||||
|
#define ZR_CLASS_MODEL_SKIN_INDEX_MIN 0
|
||||||
#define ZR_CLASS_ALPHA_INITIAL_MIN 0
|
#define ZR_CLASS_ALPHA_INITIAL_MIN 0
|
||||||
#define ZR_CLASS_ALPHA_INITIAL_MAX 255
|
#define ZR_CLASS_ALPHA_INITIAL_MAX 255
|
||||||
#define ZR_CLASS_ALPHA_DAMAGED_MIN 0
|
#define ZR_CLASS_ALPHA_DAMAGED_MIN 0
|
||||||
@ -191,27 +193,28 @@
|
|||||||
#define ZR_CLASS_NAME (1<<5)
|
#define ZR_CLASS_NAME (1<<5)
|
||||||
#define ZR_CLASS_DESCRIPTION (1<<6)
|
#define ZR_CLASS_DESCRIPTION (1<<6)
|
||||||
#define ZR_CLASS_MODEL_PATH (1<<7)
|
#define ZR_CLASS_MODEL_PATH (1<<7)
|
||||||
#define ZR_CLASS_ALPHA_INITIAL (1<<8)
|
#define ZR_CLASS_MODEL_SKIN_INDEX (1<<8)
|
||||||
#define ZR_CLASS_ALPHA_DAMAGED (1<<9)
|
#define ZR_CLASS_ALPHA_INITIAL (1<<9)
|
||||||
#define ZR_CLASS_ALPHA_DAMAGE (1<<10)
|
#define ZR_CLASS_ALPHA_DAMAGED (1<<10)
|
||||||
#define ZR_CLASS_OVERLAY_PATH (1<<11)
|
#define ZR_CLASS_ALPHA_DAMAGE (1<<11)
|
||||||
#define ZR_CLASS_NVGS (1<<12)
|
#define ZR_CLASS_OVERLAY_PATH (1<<12)
|
||||||
#define ZR_CLASS_FOV (1<<13)
|
#define ZR_CLASS_NVGS (1<<13)
|
||||||
#define ZR_CLASS_HAS_NAPALM (1<<14)
|
#define ZR_CLASS_FOV (1<<14)
|
||||||
#define ZR_CLASS_NAPALM_TIME (1<<15)
|
#define ZR_CLASS_HAS_NAPALM (1<<15)
|
||||||
#define ZR_CLASS_IMMUNITY_MODE (1<<16)
|
#define ZR_CLASS_NAPALM_TIME (1<<16)
|
||||||
#define ZR_CLASS_IMMUNITY_AMOUNT (1<<17)
|
#define ZR_CLASS_IMMUNITY_MODE (1<<17)
|
||||||
#define ZR_CLASS_IMMUNITY_COOLDOWN (1<<18)
|
#define ZR_CLASS_IMMUNITY_AMOUNT (1<<18)
|
||||||
#define ZR_CLASS_NO_FALL_DAMAGE (1<<19)
|
#define ZR_CLASS_IMMUNITY_COOLDOWN (1<<19)
|
||||||
#define ZR_CLASS_HEALTH (1<<20)
|
#define ZR_CLASS_NO_FALL_DAMAGE (1<<20)
|
||||||
#define ZR_CLASS_HEALTH_REGEN_INTERVAL (1<<21)
|
#define ZR_CLASS_HEALTH (1<<21)
|
||||||
#define ZR_CLASS_HEALTH_REGEN_AMOUNT (1<<22)
|
#define ZR_CLASS_HEALTH_REGEN_INTERVAL (1<<22)
|
||||||
#define ZR_CLASS_HEALTH_INFECT_GAIN (1<<23)
|
#define ZR_CLASS_HEALTH_REGEN_AMOUNT (1<<23)
|
||||||
#define ZR_CLASS_KILL_BONUS (1<<24)
|
#define ZR_CLASS_HEALTH_INFECT_GAIN (1<<24)
|
||||||
#define ZR_CLASS_SPEED (1<<25)
|
#define ZR_CLASS_KILL_BONUS (1<<25)
|
||||||
#define ZR_CLASS_KNOCKBACK (1<<26)
|
#define ZR_CLASS_SPEED (1<<26)
|
||||||
#define ZR_CLASS_JUMP_HEIGHT (1<<27)
|
#define ZR_CLASS_KNOCKBACK (1<<27)
|
||||||
#define ZR_CLASS_JUMP_DISTANCE (1<<28)
|
#define ZR_CLASS_JUMP_HEIGHT (1<<28)
|
||||||
|
#define ZR_CLASS_JUMP_DISTANCE (1<<29)
|
||||||
/**
|
/**
|
||||||
* @endsection
|
* @endsection
|
||||||
*/
|
*/
|
||||||
@ -232,6 +235,7 @@
|
|||||||
* ClassGetAttributeType
|
* ClassGetAttributeType
|
||||||
* ClassValidateAttributes
|
* ClassValidateAttributes
|
||||||
* ClassModify* in classcommands.inc
|
* ClassModify* in classcommands.inc
|
||||||
|
* VolEmptyAttributes
|
||||||
* Update docs with detailed attribute description
|
* Update docs with detailed attribute description
|
||||||
*/
|
*/
|
||||||
enum ClassAttributes
|
enum ClassAttributes
|
||||||
@ -248,6 +252,7 @@ enum ClassAttributes
|
|||||||
|
|
||||||
/* Model */
|
/* Model */
|
||||||
String:Class_ModelPath[PLATFORM_MAX_PATH],
|
String:Class_ModelPath[PLATFORM_MAX_PATH],
|
||||||
|
Class_ModelSkinIndex,
|
||||||
Class_AlphaInitial,
|
Class_AlphaInitial,
|
||||||
Class_AlphaDamaged,
|
Class_AlphaDamaged,
|
||||||
Class_AlphaDamage,
|
Class_AlphaDamage,
|
||||||
@ -292,7 +297,8 @@ enum ClassAttributes
|
|||||||
enum ClassEditableAttributes
|
enum ClassEditableAttributes
|
||||||
{
|
{
|
||||||
/* Model */
|
/* Model */
|
||||||
ClassEdit_AlphaInitial = 0,
|
ClassEdit_ModelSkinIndex = 0,
|
||||||
|
ClassEdit_AlphaInitial,
|
||||||
ClassEdit_AlphaDamaged,
|
ClassEdit_AlphaDamaged,
|
||||||
ClassEdit_AlphaDamage,
|
ClassEdit_AlphaDamage,
|
||||||
|
|
||||||
@ -593,6 +599,7 @@ ClassLoad()
|
|||||||
KvGetString(kvClassData, "model_path", model_path, sizeof(model_path), ZR_CLASS_DEFAULT_MODEL_PATH);
|
KvGetString(kvClassData, "model_path", model_path, sizeof(model_path), ZR_CLASS_DEFAULT_MODEL_PATH);
|
||||||
strcopy(ClassData[ClassCount][Class_ModelPath], PLATFORM_MAX_PATH, model_path);
|
strcopy(ClassData[ClassCount][Class_ModelPath], PLATFORM_MAX_PATH, model_path);
|
||||||
|
|
||||||
|
ClassData[ClassCount][Class_ModelSkinIndex] = KvGetNum(kvClassData, "model_skin_index", ZR_CLASS_DEFAULT_MODEL_SKIN_INDEX);
|
||||||
ClassData[ClassCount][Class_AlphaInitial] = KvGetNum(kvClassData, "alpha_initial", ZR_CLASS_DEFAULT_ALPHA_INITIAL);
|
ClassData[ClassCount][Class_AlphaInitial] = KvGetNum(kvClassData, "alpha_initial", ZR_CLASS_DEFAULT_ALPHA_INITIAL);
|
||||||
ClassData[ClassCount][Class_AlphaDamaged] = KvGetNum(kvClassData, "alpha_damaged", ZR_CLASS_DEFAULT_ALPHA_DAMAGED);
|
ClassData[ClassCount][Class_AlphaDamaged] = KvGetNum(kvClassData, "alpha_damaged", ZR_CLASS_DEFAULT_ALPHA_DAMAGED);
|
||||||
ClassData[ClassCount][Class_AlphaDamage] = KvGetNum(kvClassData, "alpha_damage", ZR_CLASS_DEFAULT_ALPHA_DAMAGE);
|
ClassData[ClassCount][Class_AlphaDamage] = KvGetNum(kvClassData, "alpha_damage", ZR_CLASS_DEFAULT_ALPHA_DAMAGE);
|
||||||
@ -744,6 +751,7 @@ bool:ClassReloadDataCache()
|
|||||||
|
|
||||||
/* Model */
|
/* Model */
|
||||||
strcopy(ClassDataCache[classindex][Class_ModelPath], PLATFORM_MAX_PATH, ClassData[classindex][Class_ModelPath]);
|
strcopy(ClassDataCache[classindex][Class_ModelPath], PLATFORM_MAX_PATH, ClassData[classindex][Class_ModelPath]);
|
||||||
|
ClassDataCache[classindex][Class_ModelSkinIndex] = ClassData[classindex][Class_ModelSkinIndex];
|
||||||
ClassDataCache[classindex][Class_AlphaInitial] = ClassData[classindex][Class_AlphaInitial];
|
ClassDataCache[classindex][Class_AlphaInitial] = ClassData[classindex][Class_AlphaInitial];
|
||||||
ClassDataCache[classindex][Class_AlphaDamaged] = ClassData[classindex][Class_AlphaDamaged];
|
ClassDataCache[classindex][Class_AlphaDamaged] = ClassData[classindex][Class_AlphaDamaged];
|
||||||
ClassDataCache[classindex][Class_AlphaDamage] = ClassData[classindex][Class_AlphaDamage];
|
ClassDataCache[classindex][Class_AlphaDamage] = ClassData[classindex][Class_AlphaDamage];
|
||||||
@ -810,6 +818,7 @@ bool:ClassReloadPlayerCache(client, classindex, cachetype = ZR_CLASS_CACHE_MODIF
|
|||||||
|
|
||||||
/* Model */
|
/* Model */
|
||||||
strcopy(ClassPlayerCache[client][Class_ModelPath], PLATFORM_MAX_PATH, ClassData[classindex][Class_ModelPath]);
|
strcopy(ClassPlayerCache[client][Class_ModelPath], PLATFORM_MAX_PATH, ClassData[classindex][Class_ModelPath]);
|
||||||
|
ClassPlayerCache[client][Class_ModelSkinIndex] = ClassData[classindex][Class_ModelSkinIndex];
|
||||||
ClassPlayerCache[client][Class_AlphaInitial] = ClassData[classindex][Class_AlphaInitial];
|
ClassPlayerCache[client][Class_AlphaInitial] = ClassData[classindex][Class_AlphaInitial];
|
||||||
ClassPlayerCache[client][Class_AlphaDamaged] = ClassData[classindex][Class_AlphaDamaged];
|
ClassPlayerCache[client][Class_AlphaDamaged] = ClassData[classindex][Class_AlphaDamaged];
|
||||||
ClassPlayerCache[client][Class_AlphaDamage] = ClassData[classindex][Class_AlphaDamage];
|
ClassPlayerCache[client][Class_AlphaDamage] = ClassData[classindex][Class_AlphaDamage];
|
||||||
@ -851,6 +860,7 @@ bool:ClassReloadPlayerCache(client, classindex, cachetype = ZR_CLASS_CACHE_MODIF
|
|||||||
|
|
||||||
/* Model */
|
/* Model */
|
||||||
strcopy(ClassPlayerCache[client][Class_ModelPath], PLATFORM_MAX_PATH, ClassDataCache[classindex][Class_ModelPath]);
|
strcopy(ClassPlayerCache[client][Class_ModelPath], PLATFORM_MAX_PATH, ClassDataCache[classindex][Class_ModelPath]);
|
||||||
|
ClassPlayerCache[client][Class_ModelSkinIndex] = ClassDataCache[classindex][Class_ModelSkinIndex];
|
||||||
ClassPlayerCache[client][Class_AlphaInitial] = ClassDataCache[classindex][Class_AlphaInitial];
|
ClassPlayerCache[client][Class_AlphaInitial] = ClassDataCache[classindex][Class_AlphaInitial];
|
||||||
ClassPlayerCache[client][Class_AlphaDamaged] = ClassDataCache[classindex][Class_AlphaDamaged];
|
ClassPlayerCache[client][Class_AlphaDamaged] = ClassDataCache[classindex][Class_AlphaDamaged];
|
||||||
ClassPlayerCache[client][Class_AlphaDamage] = ClassDataCache[classindex][Class_AlphaDamage];
|
ClassPlayerCache[client][Class_AlphaDamage] = ClassDataCache[classindex][Class_AlphaDamage];
|
||||||
@ -1355,6 +1365,9 @@ ClassDumpData(index, cachetype, String:buffer[], maxlen)
|
|||||||
Format(attribute, sizeof(attribute), "model_path: \"%s\"\n", format_buffer);
|
Format(attribute, sizeof(attribute), "model_path: \"%s\"\n", format_buffer);
|
||||||
cellcount += StrCat(buffer, maxlen, attribute);
|
cellcount += StrCat(buffer, maxlen, attribute);
|
||||||
|
|
||||||
|
Format(attribute, sizeof(attribute), "model_skin_index: \"%d\"\n", ClassGetModelSkinIndex(index, cachetype));
|
||||||
|
cellcount += StrCat(buffer, maxlen, attribute);
|
||||||
|
|
||||||
Format(attribute, sizeof(attribute), "alpha_initial: \"%d\"\n", ClassGetAlphaInitial(index, cachetype));
|
Format(attribute, sizeof(attribute), "alpha_initial: \"%d\"\n", ClassGetAlphaInitial(index, cachetype));
|
||||||
cellcount += StrCat(buffer, maxlen, attribute);
|
cellcount += StrCat(buffer, maxlen, attribute);
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
* Empty attribute structure with all settings set to be ignored.
|
* Empty attribute structure with all settings set to be ignored.
|
||||||
*/
|
*/
|
||||||
new VolEmptyAttributes[ClassEditableAttributes] = {
|
new VolEmptyAttributes[ClassEditableAttributes] = {
|
||||||
|
-1, /** ModelSkinIndex */
|
||||||
-1, /** AlphaInitial */
|
-1, /** AlphaInitial */
|
||||||
-1, /** AlphaDamaged */
|
-1, /** AlphaDamaged */
|
||||||
-1, /** AlphaDamage */
|
-1, /** AlphaDamage */
|
||||||
|
Loading…
Reference in New Issue
Block a user