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

I dont know what is bad


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KukuxC
Junior Member
Join Date: Dec 2010
Old 12-08-2010 , 09:01   I dont know what is bad
Reply With Quote #1

Hello! I made my first hero
It gives you 1000 HP 500 AP, a M429 and infinite bullets
But when I go to Cs the hero only have infinite bullets help!!

PHP Code:
// Terminator

/* CVARS - copy and paste to shconfig.cfg

//Terminator
termi_level 20
termi_mult 4.0            
termi_armor 500
termi_health 1000
termi_grav 500
*/
#include<amxmod>
#include<superheromod>
new gHeroID
new const gHeroName[] = "Terminator"
new bool:gHasSuperPower[SH_MAXSLOTS+1]

public 
plugin_init()
{
    
register_plugin("SUPERHERO Terminator""1.0""KukuxC")
    
    new 
pcvarLevel register_cvar("termi_level""20")
    new 
pcvarHealth register_cvar("termi_health""1000")
    new 
pcvarArmor register_cvar("termi_armor""500")
    new 
pcvarGrav register_cvar("termi_grav""500")
    new 
pcvarMult register_cvar("termi_mult""5")
    
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_hpap(gheroIDpcvarHealth0)
    
sh_set_hero_hpap(gheroID0pcvarArmor)
    
sh_set_hero_grav(gHeroIDpcvarGrav)
    
sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_M429)
    
    
sh_set_hero_info(gHeroID"Terminator mod""Hp/Ap M429 and infinite ammo")
}
public 
sh_hero_init(idheroIDmode)
{
    if (
gHeroID != heroID) return
    
    switch(
mode)
    {
        case 
SH_HERO_ADD:
        {
            
gHasSuperPower[id] = true
}
                  case 
SH_HERO_DROP:
          {
              
gHasSuperPower[id] = false
        
}
    }
}          
public 
sh_client_spawn(id)
{
    if (
gHasSuperPower[id])
    {
        
termi_weapon(id)
    }
}
super_weapon(id
{
    if (
sh_is_active() && is_user_alive(id) && gHasSuperPower[id] )
    {
        
sh_give_weapon(idCSW_M429)
    }
}
public 
weapon_change(id)
{
    if ( !
sh_is_active() || !gHasSuperPower[id] ) return
    
    new 
weaponID read_data(2)
    
    if (
weaponID !=CSW_M429) return
    
    
switch_model(id)
    
    if (
read_data(3) == 0)
    {
        
sh_reload_ammo(id1)
    }

Errors: I cant compilate :
Line28: undefined symbol "sh_create_hero"

Line29: undefined symbol "sh_set_hero_hpap"
expresion has no effect
excepted token: ";", but found )
Invalid expression, assumed zero

Last edited by KukuxC; 12-08-2010 at 11:20.
KukuxC is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 12-08-2010 , 10:40   Re: I dont know what is bad
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=120051
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
KukuxC
Junior Member
Join Date: Dec 2010
Old 12-08-2010 , 10:51   Re: I dont know what is bad
Reply With Quote #3

Thanx for the tutorial but can you tell me what is bad please??
KukuxC is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 12-08-2010 , 11:01   Re: I dont know what is bad
Reply With Quote #4

Yes. You made it using the old ways. Create one using the new ways and I will be able to help you.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
KukuxC
Junior Member
Join Date: Dec 2010
Old 12-08-2010 , 11:21   Re: I dont know what is bad
Reply With Quote #5

ok I made it with the new way i edited the post but now i cant compile it =L
KukuxC is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 12-08-2010 , 11:29   Re: I dont know what is bad
Reply With Quote #6

PHP Code:
new gHeroID
    sh_set_hero_hpap
(gheroIDpcvarHealth0)
    
sh_set_hero_hpap(gheroID0pcvarArmor)
    
sh_set_hero_grav(gHeroIDpcvarGrav
It is case sensitive. gheroID and gHeroID is not the same, and as you didn't define gheroID anywhere it will give an error.

PHP Code:
public sh_client_spawn(id)
{
    if (
gHasSuperPower[id])
    {
        
termi_weapon(id)
    }
}
super_weapon(id
{
    if (
sh_is_active() && is_user_alive(id) && gHasSuperPower[id] )
    {
        
sh_give_weapon(idCSW_M429)
    }

1. You didn't close it with a )
2. is termi_weapon and super_weapon the same? It doesn't look like the same to me.

PHP Code:
#include<amxmod> 
Why did you include amxmod? amxmod is old and should never be used. Also superheromod includes amxmodx.
__________________
No idea what to write here...

Last edited by Jelle; 12-08-2010 at 11:34.
Jelle is offline
Send a message via MSN to Jelle
KukuxC
Junior Member
Join Date: Dec 2010
Old 12-08-2010 , 11:43   Re: I dont know what is bad
Reply With Quote #7

Quote:
Why did you include amxmod? amxmod is old and should never be used. Also superheromod includes amxmodx.
When I only use superheromod appears 23 errors =L
KukuxC is offline
KukuxC
Junior Member
Join Date: Dec 2010
Old 12-08-2010 , 12:01   Re: I dont know what is bad
Reply With Quote #8

I download the newest superhero version but now I have 5 errors:
Line32: Undefined symbol "CSW_M429"
Line 32---34: number of arguments doesnt match definitions
Line 63: Undefined symbol "CSW_M429"
Line 72:Undefined symbol "CSW_M429"
Line 74: Undefined symbol "switch_model"
KukuxC is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 12-08-2010 , 12:12   Re: I dont know what is bad
Reply With Quote #9

The weapon is called M249, not M429. The warning about switch_model is because you use it, but you never created it.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
KukuxC
Junior Member
Join Date: Dec 2010
Old 12-08-2010 , 12:40   Re: I dont know what is bad
Reply With Quote #10

I made It!!!!
PHP Code:
// Terminator

/* CVARS - copy and paste to shconfig.cfg

//Terminator
termi_level 20
termi_mult 4.0            
termi_armor 500
termi_health 1000
termi_grav 500
*/
#include<superheromod>

new gHeroID
new const gHeroName[] = "Terminator"
new bool:gHasSuperPower[SH_MAXSLOTS+1]
new const 
gSuperWeapon[] = "models/shmod/v_m249.mdl"
public plugin_init()
{
    
register_plugin("SUPERHERO Terminator""1.0""KukuxC")
    
    new 
pcvarLevel register_cvar("termi_level""20")
    new 
pcvarHealth register_cvar("termi_health""1000")
    new 
pcvarArmor register_cvar("termi_armor""500")
    new 
pcvarGrav register_cvar("termi_grav""500")
    new 
pcvarMult register_cvar("termi_mult""5")
    
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_hpap(gHeroIDpcvarHealth0)
    
sh_set_hero_hpap(gHeroID0pcvarArmor)
    
sh_set_hero_grav(gHeroIDpcvarGrav)
    
sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_M249)
    
    
sh_set_hero_info(gHeroID"Terminator mod""Hp/Ap M249 and infinite ammo")
    
    
register_event("CurWeapon""weapon_change""be""1=1")
}
public 
sh_hero_init(idheroIDmode)
{
    if (
gHeroID != heroID) return
    
    switch(
mode)
    {
        case 
SH_HERO_ADD:
        {
            
gHasSuperPower[id] = true
}
                  case 
SH_HERO_DROP:
          {
              
gHasSuperPower[id] = false
        
}
    }
}          
public 
sh_client_spawn(id)
{
    if (
gHasSuperPower[id])
    {
        
termi_weapon(id)
    }
}
termi_weapon(id)
{
    if (
sh_is_active() && is_user_alive(id) && gHasSuperPower[id] )
    {
        
sh_give_weapon(idCSW_M249)
    }
}
public 
weapon_change(id)
{
    if ( !
sh_is_active() || !gHasSuperPower[id] ) return
    
    new 
weaponID read_data(2)
    
    if (
weaponID !=CSW_M249) return
    
    
switch_model(id)
    
    if (
read_data(3) == 0)
    {
        
sh_reload_ammo(id1)
    }
}
switch_model(id)
{
    if (!
sh_is_active() || !is_user_alive(id) || !gHasSuperPower[id] ) return
    
    if (
get_user_weapon(id) == CSW_M249)
    {
        
set_pev(idpev_viewmodel2gSuperWeapon)
    }

Now I have a question: I downloaded a m249 skin with 3 files:
v_m249.mdl
w_m249.mdl
p_m249.mdl
Which i need to put in
PHP Code:
new const gSuperWeapon[] = "models/shmod/...." 
KukuxC 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 17:45.


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