View Single Post
Author Message
martop5hng
Junior Member
Join Date: Mar 2014
Old 04-18-2014 , 20:50   Stupid and annoying error
Reply With Quote #1

there was a new request for hero : Crysis and i found the models so i was going to make his hero but then appear 1 error which i got long ago and now again:
Error: Undefined symbol "crysis_weapon" on line 35
Error: Undefined symbol "crysis_weapon" on line 54
Error: Undefined symbol "crysis_weapon" on line 59

Here is the sma/code
Code:
#include <superheromod>

new gHeroID
new gHeroName[] = "Crysis" 
new bool:gHasCrysisPower[SH_MAXSLOTS+1] 
new const gCrysisPlayer[] = "models/player/crysis/crysis.mdl"
new const gCrysisWeapon[] = "models/shmod/v_crysis_bow.mdl"
new const gCrysisWeaponP[] = "models/shmod/p_crysis_bow.mdl"

public plugin_init()
{
    register_plugin("SUPERHERO Crysis", "1.0", "martop5hng")
    register_event("CurWeapon", "weapon_change", "be", "1=1")
    

    new pcvarLevel = register_cvar("crysis_level", "0") 
    new pcvarArmor = register_cvar("crysis_armor", "150")
    
    gHeroID = sh_create_hero(gHeroName, pcvarLevel)
    sh_set_hero_info(gHeroID, "Crysis nanosuit", "Crysis nanosuit + lankas")
    sh_set_hero_hpap(gHeroID, 0, pcvarArmor)
    
}

public sh_hero_init(id, heroID, mode)
{
    if (gHeroID != heroID) return
    
    switch(mode)
    {
        case SH_HERO_ADD:
        {
            gHasCrysisPower[id] = true
	    crysis_morph (id)
	    crysis_weapon(id)
	    switch_model(id)
        }
        case SH_HERO_DROP:
        {
            gHasCrysisPower[id] = false
	    crysis_unmorph(id)
	    if (is_user_alive(id))
            {
                sh_drop_weapon(id, CSW_SCOUT, true)
            }
        }
    }
}  
public sh_client_spawn(id)
{
    if (gHasCrysisPower[id])
    {
        crysis_morph(id)
        crysis_weapon(id)
    }
}

crysis_morph(id)
crysis_weapon(id)
{
    if (sh_is_active() && is_user_alive(id) && gHasCrysisPower[id] )
    {
        sh_give_weapon(id, CSW_SCOUT)
    }
}
{
    {
    cs_set_user_model(id, "crysis")
    if (sh_is_active() && is_user_alive(id) && gHasCrysisPower[id] )

        sh_give_weapon(id, CSW_SCOUT)
    }
}
crysis_unmorph(id)
{
    cs_reset_user_model(id)
}  
public weapon_change(id)
{
    if ( !sh_is_active() || !gHasCrysisPower[id] ) return
    
    new weaponID = read_data(2)
    if (weaponID !=CSW_SCOUT) return
    
    switch_model(id)
    

    if (read_data(3) == 0)
    {
        sh_reload_ammo(id, 1)
        /*after the id I made a 1 number
        look at the superheromod.inc and you will see this
        0 - follow server sh_reloadmode CVAR
        1 - continuous shooting, no reload
        2 - fill the backpack (must reload)
        3 - drop the gun and get a new one with full clip
        That should explain it*/
    }
}

switch_model(id)
{
    if (!sh_is_active() || !is_user_alive(id) || !gHasCrysisPower[id] ) return
    
    if (get_user_weapon(id) == CSW_SCOUT)
    {
        set_pev(id, pev_viewmodel2, gCrysisWeapon)
        set_pev(id, pev_viewmodel2, gCrysisWeaponP)
    }
}  
public plugin_precache()
{
   
    precache_model(gCrysisPlayer)
    precache_model(gCrysisWeapon)
    precache_model(gCrysisWeaponP)
}

Last edited by martop5hng; 04-18-2014 at 20:53.
martop5hng is offline