Raised This Month: $32 Target: $400
 8% 

Stupid and annoying error


Post New Thread Reply   
 
Thread Tools Display Modes
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
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 04-21-2014 , 05:25   Re: Stupid and annoying error
Reply With Quote #2

You didn't make crysis_morph, but jumped directly to crysis_weapon. That means the compiler can't see your crysis_morph thus giving you the undefined errors.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
martop5hng
Junior Member
Join Date: Mar 2014
Old 04-22-2014 , 00:28   Re: Stupid and annoying error
Reply With Quote #3

Quote:
Originally Posted by Jelle View Post
You didn't make crysis_morph, but jumped directly to crysis_weapon. That means the compiler can't see your crysis_morph thus giving you the undefined errors.
I not sure i understand what you told me to do . If you have time can you show me how the script should looks like
martop5hng is offline
Bladell
Senior Member
Join Date: Jun 2012
Old 04-28-2014 , 12:12   Re: Stupid and annoying error
Reply With Quote #4

If you really made this hero by yourself you should know how function _morph looks like.
Look at line 58, function crysis_morph(id) do nothing, you have to tell this function how to morph a player.
Bladell is offline
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 16:27.


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