I made a test hero today cuz, im learning shero scipting. when the server loads my xp, the server crashes and a fatal error pops up
Code:
SV_ModelIndex: model models/shmod/Test/Test_v_m4a1.mdl not precached
Please help "Precache the file/model"
And if it helps i got the sma code here:
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <superheromod>
new gHeroID
new gHasTest[SH_MAXSLOTS+1]
new const gTestM4A1[] = "models/shmod/Test/Test_v_m4a1.mdl"
new const gTestM4A12[] = "models/shmod/Test/Test_p_m4a1.mdl"
public plugin_init()
{
register_plugin("SUPERHERO Test", "1.1", "MuzzMikkel")
new pcvarLevel = register_cvar("Test_level", "10")
new pcvarHealth = register_cvar("Test_health", "200")
new pcvarArmor = register_cvar("Test_armor", "250")
new pcvarSpeed = register_cvar("Test_speed", "300")
new pcvarM4A1Mult = register_cvar("Test_m4a1mult", "5")
gHeroID = sh_create_hero("Test", pcvarLevel)
sh_set_hero_info(gHeroID, "Test", "LOL")
sh_set_hero_hpap(gHeroID, pcvarHealth, pcvarArmor)
sh_set_hero_speed(gHeroID, pcvarSpeed)
sh_set_hero_dmgmult(gHeroID, pcvarM4A1Mult, CSW_M4A1)
register_event("CurWeapon", "weapon_change", "be", "1=1")
}
public sh_hero_init(id, heroID, mode)
{
switch (mode)
{
case SH_HERO_ADD:
{
gHasTest[id] = true
Test_M4A1(id)
switch_model(id)
}
case SH_HERO_DROP:
{
gHasTest[id] = false
if (is_user_alive(id))
{
sh_drop_weapon(id, CSW_M4A1, true)
}
}
}
}
public sh_client_spawn(id)
{
if (gHasTest[id])
{
Test_M4A1(id)
}
}
Test_M4A1(id)
{
if (sh_is_active() && is_user_alive(id) && gHasTest[id] )
{
sh_give_weapon(id, CSW_M4A1)
}
}
public weapon_change(id)
{
if ( !sh_is_active() || !gHasTest[id] ) return
new weaponID = read_data(2)
if (weaponID !=CSW_M4A1) return
switch_model(id)
if (read_data(3) == 0)
{
sh_reload_ammo(id, 1)
}
}
switch_model(id)
{
if (!sh_is_active() || !is_user_alive(id) || !gHasTest[id] ) return
if (get_user_weapon(id) == CSW_M4A1)
{
set_pev(id, pev_viewmodel2, gTestM4A1)
set_pev(id, pev_weaponmodel2, gTestM4A12)
}
}
PLEASE HELP ME