Raised This Month: $151 Target: $400
 37% 

CVARS probs..


Post New Thread Reply   
 
Thread Tools Display Modes
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-06-2009 , 20:37   Re: CVARS probs..
Reply With Quote #31

Did you do as I told you to?
Jelle is offline
Send a message via MSN to Jelle
Lyserinc
Member
Join Date: Aug 2009
Old 09-08-2009 , 10:21   Re: CVARS probs..
Reply With Quote #32

Yes!!!
Lyserinc is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-08-2009 , 18:52   Re: CVARS probs..
Reply With Quote #33

Then use this code:

PHP Code:
// Heavy  

/* CVARS - copy and paste to shconfig.cfg 

//Heavy 
heavy_level 25 
heavy_health 500 
heavy_armor 1000 
heavy_m249speed 670 
heavy_mult 4.0 
heavy_healpoints 25 

*/ 

/* 


*   Heavy with a minigun from TF2 
*/ 

#include <amxmodx>  
#include <superheromod> 
#include <fakemeta> 

new gHeroID 
new const gHeroName[]="Heavy" 
new bool:gHasHeavy[SH_MAXSLOTS+1
new 
gPcvarMultgPcvarHealPoints 
new const g_v_model[] = "models/shmod/Super/v_m249.mdl" 
new const g_p_model[] = "models/shmod/Super/p_m249.mdl" 

public plugin_init()  

    
register_plugin("SUPERHERO Heavy""1.0""Lyserinc"
    
    new 
pcvarLevel register_cvar("heavy_level""25"
    new 
pcvarHealth register_cvar("heavy_health""500"
    new 
pcvarArmor register_cvar("heavy_armor""1000"
    new 
pcvarSpeed register_cvar("heavy_m249speed""670"
    
gPcvarMult register_cvar("heavy_mult""4.0"
    
gPcvarHealPoints register_cvar("heavy_healpoints""25"
     
    
gHeroID sh_create_hero(gHeroNamepcvarLevel
    
sh_set_hero_info(gHeroID"Heavy Machinery""HP/AP/Strong m249"
    
sh_set_hero_hpap(gHeroIDpcvarHealthpcvarArmor
    
sh_set_hero_speed(gHeroIDpcvarSpeed, {CSW_M249}) 
     
    
set_task(1.0"heavy_loop"___"b"


public 
sh_hero_init(idheroIDmode

    if (
gHeroID != heroID) return 
     
    switch(
mode
    { 
        case 
SH_HERO_ADD:  
        { 
            
gHasHeavy[id] = true 
            switchmodel
(id
        } 

        case 
SH_HERO_DROP:  
        { 
            
gHasHeavy[id] = false 
        

    } 


public 
plugin_precache()  

    
precache_model(g_v_model
    
precache_model(g_p_model


public 
heavy_loop() 

    if (!
sh_is_active()) return 

    static 
players[SH_MAXSLOTS], playerCountplayer
    get_players
(playersplayerCount"ah"

    for (
0playerCounti++)  
    { 
        
player players[i

        if (
gHasHeavy[player])  
        { 
            
sh_add_hp(playerget_pcvar_num(gPcvarHealPoints)) 
        } 
    } 


public 
client_damage(attackervictimdamagewpnindexhitplace

    if (!
sh_is_active()) return 
    if (!
is_user_alive(victim) || !is_user_connected(attacker)) return 

    if (
gHasHeavy[attacker] && wpnindex == CSW_M249)  
    { 
        new 
headshot hitplace == 
        
new extraDamage floatround(damage get_pcvar_float(gPcvarMult) - damage
        if (
extraDamage 0sh_extra_damage(victimattackerextraDamage"m249"headshot
    } 


public 
weapon_change(id

    if (!
sh_is_active() || !gHasHeavy[id]) return 

    if (
read_data(2) == CSW_M249switchmodel(id


switchmodel(id

    if (!
sh_is_active() || !is_user_alive(id) || !gHasHeavy[id]) return 

    if (
get_user_weapon(id) == CSW_M249)  
    { 
        
set_pev(idpev_viewmodel2engfunc(EngFunc_AllocStringg_v_model)) 
        
set_pev(idpev_weaponmodel2engfunc(EngFunc_AllocStringg_p_model)) 
    } 

Made by Xel0z .

maybe that works.
Jelle is offline
Send a message via MSN to Jelle
Lyserinc
Member
Join Date: Aug 2009
Old 09-09-2009 , 10:51   Re: CVARS probs..
Reply With Quote #34

Nope, u wont spawn with weapon and model wont work.. DDD:
Lyserinc is offline
Xel0z
Senior Member
Join Date: Apr 2006
Location: Netherlands
Old 09-09-2009 , 14:44   Re: CVARS probs..
Reply With Quote #35

PHP Code:
// Heavy  

/* CVARS - copy and paste to shconfig.cfg 

//Heavy 
heavy_level 25 
heavy_health 500 
heavy_armor 1000 
heavy_m249speed 670 
heavy_mult 4.0 
heavy_healpoints 25 

*/ 

/* 


*   Heavy with a minigun from TF2 
*/ 
 
#include <superheromod> 

new gHeroID 
new const gHeroName[]="Heavy" 
new bool:gHasHeavy[SH_MAXSLOTS+1
new 
gPcvarMultgPcvarHealPoints 
new const g_v_model[] = "models/shmod/heavy_v_m249.mdl" 
new const g_p_model[] = "models/shmod/heavy_p_m249.mdl" 

public plugin_init()  

    
register_plugin("SUPERHERO Heavy""1.0""Lyserinc"
    
    new 
pcvarLevel register_cvar("heavy_level""25"
    new 
pcvarHealth register_cvar("heavy_health""500"
    new 
pcvarArmor register_cvar("heavy_armor""1000"
    new 
pcvarSpeed register_cvar("heavy_m249speed""670"
    
gPcvarMult register_cvar("heavy_mult""4.0"
    
gPcvarHealPoints register_cvar("heavy_healpoints""25"
     
    
gHeroID sh_create_hero(gHeroNamepcvarLevel
    
sh_set_hero_info(gHeroID"Heavy Machinery""HP/AP/Strong m249"
    
sh_set_hero_hpap(gHeroIDpcvarHealthpcvarArmor
    
sh_set_hero_speed(gHeroIDpcvarSpeed, {CSW_M249}) 
     
    
set_task(1.0"heavy_loop"___"b"


public 
sh_hero_init(idheroIDmode

    if (
gHeroID != heroID) return 
     
    switch(
mode
    { 
        case 
SH_HERO_ADD:  
        { 
            
gHasHeavy[id] = true 
            switchmodel
(id
        } 

        case 
SH_HERO_DROP:  
        { 
            
gHasHeavy[id] = false 
        

    } 


public 
plugin_precache()  

    
precache_model(g_v_model
    
precache_model(g_p_model


public 
sh_client_spawn(id)
{
    if (
sh_is_active() && gHasHeavy[id] && is_user_alive(id)) 
    {
        
sh_give_weapon(idCSW_M249)
    }
}    

public 
heavy_loop() 

    if (!
sh_is_active()) return 

    static 
players[SH_MAXSLOTS], playerCountplayer
    get_players
(playersplayerCount"ah"

    for (
0playerCounti++)  
    { 
        
player players[i

        if (
gHasHeavy[player])  
        { 
            
sh_add_hp(playerget_pcvar_num(gPcvarHealPoints)) 
        } 
    } 


public 
client_damage(attackervictimdamagewpnindexhitplace

    if (!
sh_is_active()) return 
    if (!
is_user_alive(victim) || !is_user_connected(attacker)) return 

    if (
gHasHeavy[attacker] && wpnindex == CSW_M249)  
    { 
        new 
headshot hitplace == 
        
new extraDamage floatround(damage get_pcvar_float(gPcvarMult) - damage
        if (
extraDamage 0sh_extra_damage(victimattackerextraDamage"m249"headshot
    } 


public 
weapon_change(id

    if (!
sh_is_active() || !gHasHeavy[id]) return 

    if (
read_data(2) == CSW_M249switchmodel(id


switchmodel(id

    if (!
sh_is_active() || !is_user_alive(id) || !gHasHeavy[id]) return 

    new 
clipammowpnid get_user_weapon(idclipammo)
    
    if (
wpnid == CSW_M249)  
    { 
        
set_pev(idpev_viewmodel2g_v_model)
        
set_pev(idpev_weaponmodel2g_p_model)
    } 

I made some minor mistakes in my previous code.
You should put the models in models/shmod and name them to:
heavy_v_m249.mdl and heavy_p_m249.mdl
__________________
Heroes: TESS-One Working on: Grit (Fixing bugs)
Xel0z is offline
Send a message via MSN to Xel0z
Lyserinc
Member
Join Date: Aug 2009
Old 09-10-2009 , 15:01   Re: CVARS probs..
Reply With Quote #36

Okeey
omg omg omg.. THERE JUST HAS TO BE A PROBLEM WITH THE MODEL cause everything else works, just dont the model!!!!! OMG! I changed the name and everything!!

Last edited by Lyserinc; 09-10-2009 at 15:07.
Lyserinc is offline
[email protected]
Veteran Member
Join Date: May 2008
Location: France Marne
Old 09-10-2009 , 17:18   Re: CVARS probs..
Reply With Quote #37

give me the sma...
Fr33m@n is offline
Lyserinc
Member
Join Date: Aug 2009
Old 09-11-2009 , 09:12   Re: CVARS probs..
Reply With Quote #38

Code:
// Heavy   

/* CVARS - copy and paste to shconfig.cfg  

//Heavy  
heavy_level 25  
heavy_health 500  
heavy_armor 1000  
heavy_m249speed 670  
heavy_mult 4.0  
heavy_healpoints 25  

*/  

/*  
*  
*  
*   Heavy with a minigun from TF2  
*/  
  
#include <superheromod>  

new gHeroID  
new const gHeroName[]="Heavy"  
new bool:gHasHeavy[SH_MAXSLOTS+1]  
new gPcvarMult, gPcvarHealPoints  
new const g_v_model[] = "models/shmod/heavy_v_m249.mdl"  
new const g_p_model[] = "models/shmod/heavy_p_m249.mdl"  

public plugin_init()   
{  
    register_plugin("SUPERHERO Heavy", "1.0", "Lyserinc")  
     
    new pcvarLevel = register_cvar("heavy_level", "25")  
    new pcvarHealth = register_cvar("heavy_health", "500")  
    new pcvarArmor = register_cvar("heavy_armor", "1000")  
    new pcvarSpeed = register_cvar("heavy_m249speed", "670")  
    gPcvarMult = register_cvar("heavy_mult", "4.0")  
    gPcvarHealPoints = register_cvar("heavy_healpoints", "25")  
      
    gHeroID = sh_create_hero(gHeroName, pcvarLevel)  
    sh_set_hero_info(gHeroID, "Heavy Machinery", "HP/AP/Strong m249")  
    sh_set_hero_hpap(gHeroID, pcvarHealth, pcvarArmor)  
    sh_set_hero_speed(gHeroID, pcvarSpeed, {CSW_M249})  
      
    set_task(1.0, "heavy_loop", _, _, _, "b")  
}  

public sh_hero_init(id, heroID, mode)  
{  
    if (gHeroID != heroID) return  
      
    switch(mode)  
    {  
        case SH_HERO_ADD:   
        {  
            gHasHeavy[id] = true  
            switchmodel(id)  
        }  

        case SH_HERO_DROP:   
        {  
            gHasHeavy[id] = false  
        }  
    }  
}  

public plugin_precache()   
{  
    precache_model(g_v_model)  
    precache_model(g_p_model)  
}  

public sh_client_spawn(id) 
{ 
    if (sh_is_active() && gHasHeavy[id] && is_user_alive(id))  
    { 
        sh_give_weapon(id, CSW_M249) 
    } 
}     

public heavy_loop()  
{  
    if (!sh_is_active()) return  

    static players[SH_MAXSLOTS], playerCount, player, i  
    get_players(players, playerCount, "ah")  

    for (i = 0; i < playerCount; i++)   
    {  
        player = players[i]  

        if (gHasHeavy[player])   
        {  
            sh_add_hp(player, get_pcvar_num(gPcvarHealPoints))  
        }  
    }  
}  

public client_damage(attacker, victim, damage, wpnindex, hitplace)  
{  
    if (!sh_is_active()) return  
    if (!is_user_alive(victim) || !is_user_connected(attacker)) return  

    if (gHasHeavy[attacker] && wpnindex == CSW_M249)   
    {  
        new headshot = hitplace == 1 ? 1 : 0  
        new extraDamage = floatround(damage * get_pcvar_float(gPcvarMult) - damage)  
        if (extraDamage > 0) sh_extra_damage(victim, attacker, extraDamage, "m249", headshot)  
    }  
}  

public weapon_change(id)  
{  
    if (!sh_is_active() || !gHasHeavy[id]) return  

    if (read_data(2) == CSW_M249) switchmodel(id)  
}  

switchmodel(id)  
{  
    if (!sh_is_active() || !is_user_alive(id) || !gHasHeavy[id]) return  

    new clip, ammo, wpnid = get_user_weapon(id, clip, ammo) 
     
    if (wpnid == CSW_M249)   
    {  
        set_pev(id, pev_viewmodel2, g_v_model) 
        set_pev(id, pev_weaponmodel2, g_p_model) 
    }  
} 
Lyserinc is offline
[email protected]
Veteran Member
Join Date: May 2008
Location: France Marne
Old 09-11-2009 , 12:59   Re: CVARS probs..
Reply With Quote #39

shconfig.cfg CVARS
Code:
//Heavy
heavy_level 25
heavy_health 500       //Starting health
heavy_armor 1000       //Starting armor
heavy_m249speed 670    //Speed of Heavy when holding M249
heavy_healpoints 25    //The # of HP healed per second
heavy_m249mult 4.0     //Damage multiplyer for his M249
of course you need both v and p model.

Don't post this hero it's a sh 1.2.0 rip. (morpheus+wolverine)
Attached Files
File Type: sma Get Plugin or Get Source (sh_heavy.sma - 582 views - 4.4 KB)

Last edited by [email protected]; 09-11-2009 at 13:04.
Fr33m@n is offline
Reply


Thread Tools
Display Modes

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 01:53.


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