Raised This Month: $51 Target: $400
 12% 

Model is not precached!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MuzzMikkel
Member
Join Date: Aug 2010
Location: Denmark
Old 05-05-2011 , 08:50   Model is not precached!
Reply With Quote #1

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(gHeroIDpcvarHealthpcvarArmor)
    
sh_set_hero_speed(gHeroIDpcvarSpeed)
    
sh_set_hero_dmgmult(gHeroIDpcvarM4A1MultCSW_M4A1)
    
    
register_event("CurWeapon""weapon_change""be""1=1")

}

public 
sh_hero_init(idheroIDmode)
{
    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(idCSW_M4A1true)
            }
        }
    }
}

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(idCSW_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(id1)
    }
}

switch_model(id)
{
    if (!
sh_is_active() || !is_user_alive(id) || !gHasTest[id] ) return
    
    if (
get_user_weapon(id) == CSW_M4A1)
    {
    
set_pev(idpev_viewmodel2gTestM4A1)
    
set_pev(idpev_weaponmodel2gTestM4A12)    
    }

PLEASE HELP ME
MuzzMikkel is offline
Send a message via MSN to MuzzMikkel
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 05-05-2011 , 09:18   Re: Model is not precached!
Reply With Quote #2

PHP Code:
public plugin_precache()
{
    
precache_model(gTestM4A1);
    
precache_model(gTestM4A12);

__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
MuzzMikkel
Member
Join Date: Aug 2010
Location: Denmark
Old 05-05-2011 , 09:31   Re: Model is not precached!
Reply With Quote #3

Quote:
Originally Posted by G-Dog View Post
PHP Code:
public plugin_precache()
{
    
precache_model(gTestM4A1);
    
precache_model(gTestM4A12);

Thank you so much
MuzzMikkel is offline
Send a message via MSN to MuzzMikkel
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode