same steps u.u
all changes made:
Globals
PHP Code:
new Array:g_zclass_bombmodel, Array:g_zclass2_bombmodel
in public plugin_precache()
PHP Code:
g_zclass_bombmodel = ArrayCreate(32, 1)
g_zclass2_bombmodel = ArrayCreate(32, 1)
in replace_weapon_models(id, weaponid)
PHP Code:
case CSW_HEGRENADE: // Infection bomb or fire grenade
{
if (g_zombie[id])
{
static bombmodel[100]
ArrayGetString(g_zclass_bombmodel, g_zombieclass[id], bombmodel, charsmax(bombmodel))
format(clawmodel, charsmax(bombmodel), "models/zombie_plague/%s", bombmodel)
set_pev(id, pev_viewmodel2, bombmodel)
}
else
set_pev(id, pev_viewmodel2, model_grenade_fire)
}
in load_customization_from_files()
PHP Code:
else if (equal(key, "BOMBMODEL"))
ArrayPushString(g_zclass2_bombmodel, value)
in save_customization()
PHP Code:
// Add bombmodel
ArrayGetString(g_zclass_bombmodel, i, buffer, charsmax(buffer))
format(buffer, charsmax(buffer), "^nBOMBMODEL = %s", buffer)
fputs(file, buffer)
ArrayDestroy(g_zclass2_bombmodel)
and finally the native
PHP Code:
public native_register_zombie_class(const name[], const info[], const model[], const clawmodel[], const bombmodel[], hp, speed, Float:gravity, Float:knockback)
param_convert(5)
ArrayPushString(g_zclass_bombmodel, bombmodel)
// Replace bombmodel
ArrayGetString(g_zclass2_bombmodel, i, buffer, charsmax(buffer))
ArraySetString(g_zclass_bombmodel, g_zclass_i, buffer)
// Precache bombmodel
formatex(prec_mdl, charsmax(prec_mdl), "models/zombie_plague/%s", buffer)
engfunc(EngFunc_PrecacheModel, prec_mdl)
// Precache default bombmodel
formatex(prec_mdl, charsmax(prec_mdl), "models/zombie_plague/%s", bombmodel)
later
- edit your include file (zombieplague.inc) with const bombmodel[] (native)
- compile again your zclasses (adding the bomb model)
- delete all content from zp_zombieclasses.ini
run the game
__________________