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

sh_eldiablo


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dark Ruler
Member
Join Date: Jul 2006
Old 09-03-2006 , 21:07   sh_eldiablo
Reply With Quote #1

Ok i just need help with this hero. Its called El Diablo. I dunno why i named it that. But i was bored so i made a hero based on my leader of my clan. So i just need help compiling it. I did but i got some errors. Here they are.

Code:
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(23) : error 055: start of function body without function header
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(25) : error 021: symbol already defined: "register_plugin"
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(28) : error 021: symbol already defined: "register_cvar"
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(34) : error 025: function heading differs from prototype
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(38) : error 021: symbol already defined: "shCreateHero"
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(39) : error 025: function heading differs from prototype
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(42) : error 021: symbol already defined: "shRegHeroInit"
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(43) : error 021: symbol already defined: "register_event"
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(46) : error 021: symbol already defined: "register_srvcmd"
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(48) : error 021: symbol already defined: "shRegMaxHealth"
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(68) : error 017: undefined symbol "gPlayerMaxHealth"
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(68) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(68) : error 001: expected token: ";", but found "]"
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(68) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpvx4AYI.sma(68) : fatal error 107: too many error messages on one line
And here is the full code of the hero

Code:
//El Diablo - Skin + Gun

/* CVARS - Copy and paste to shconfig.cfg

//El Diablo
eldiablo_level 42           //Level El Diablo is. Default
eldiablo_health 500            //Health
eldiablo_armor 500            //Armor
eldiablo_sig552mult 3.5    //Damage of Sig 552 Weapon

*/

#include <amxmodx>
#include <xtrafun>
#include <superheromod>

//Global Variables
new gHeroName[]="El Diablo"
new bool:gHasElDiabloPower[SH_MAXSLOTS+1]
new CvarSG552DmgMult
//--------------------------------------------------------------------------------------------------
public plugin_info
{
    // Plugin Info
    register_plugin("SUPERHERO El Diablo", "1.7", "El Diablo")
    
    // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    register_cvar("eldiablo_level", "40")
    register_cvar("eldiablo_health", "500")
    register_cvar("eldiablo_armor", "500")
    CvarSG552DmgMult = register_cvar("eldiablo_sg552mult", "3.5")
    
    // FIRE THE EVENT TO CREATE THIS SUPERHERO!
    shCreateHero(gHeroName, "Pwning Time", "Act like -={YD}=- El Diablo {[Ldr]}", false , "eldiablo_level")
    
    // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    register_srvcmd("eldiablo_init", "eldiablo_init")
    shRegHeroInit(gHeroName, "eldiablo_init")
    
    // EVENTS
    register_event("ResetHUD", "newSpawn", "b")
    register_event("CurWeapon", "weaponChange", "be", "1=1")
    
    // Let server know about El Diablo's Variables
    register_srvcmd("eldiablo_maxhealth", "eldiablo_maxhealth")
    shRegMaxHealth(gHeroName, "eldiablo_maxhealth")
}
//--------------------------------------------------------------------------------------------------
public plugin_precache()
{
    precache_model("models/shmod/v_sg552.mdl")
    precache_model("models/shmod/p_sg552.mdl")
    precache_model("models/shmod/w_sg552.mdl")
}
//--------------------------------------------------------------------------------------------------
public eldiablo_init()
{
    // First Argument is an id
    new temp[6]
    read_argv(1, temp, 5)
    new id = str_to_num(temp)

    // 2nd Argument is 0 or 1 depending on whether the id has the hero
    read_argv(2, temp, 5)
    new hasPowers = str_to_num(temp)

    gPlayerMaxHealth[id] = 100
    
    switch(hasPowers)
    {
        case true:
        {
        gHasElDiabloPower[id] = true

        if ( is_user_alive(id) )
        {
            eldiablo_weapons(id)
            switchmodel(id)
        }
            }
            case false:
        {
        if ( is_user_alive(id) && gHasElDiabloPower[id] )
            engclient_cmd(id, "drop", "weapon_sg552")

        gHasElDiabloPower[id] = false
        }
    }
}
//--------------------------------------------------------------------------------------------------
public eldiablo_maxhealth()
{
    new id[6]
    new health[9]

    read_argv(1, id, 5)
    read_argv(2, health, 8)

    gPlayerMaxHealth[str_to_num(id)] = str_to_num(health)
}    
//--------------------------------------------------------------------------------------------------
public newSpawn(id)
{
    if ( gHasElDiabloPower[id] && is_user_alive(id) && shModActive() )
        set_task(0.1, "eldiablo_weapons", id)
}
//--------------------------------------------------------------------------------------------------
public eldiablo_weapons(id)
{
    if ( !shModActive() || !is_user_alive(id) || !gHasElDiabloPower[id] )
        return
    
    shGiveWeapon(id, "weapon_sg552")
}
//--------------------------------------------------------------------------------------------------
public switchmodel(id)
{
    if ( !shModActive() || !is_user_alive(id) || !gHasElDiabloPower[id] )
        return

    new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)

    if ( wpnid == CSW_SG552 )
    {
        set_pev(id, pev_viewmodel2, "models/shmod/v_sg552.mdl")
        set_pev(id, pev_viewmodel2, "models/shmod/p_sg552.mdl")
        set_pev(id, pev_viewmodel2, "models/shmod/w_sg552.mdl")
    }
}
//--------------------------------------------------------------------------------------------------
public weaponChange(id)
{
    if ( !gHasElDiabloPower[id] || !shModActive() )
        return

    new wpnid = read_data(2)

    if ( wpnid != CSW_SG552 )
        return

    switchmodel(id)

    new clip = read_data(3)

    // Never Run Out of Ammo!
    if ( clip == 0 )
    shReloadAmmo(id)
}
//--------------------------------------------------------------------------------------------------
public client_connect(id)
{
    gHasElDiabloPower[id] = false
}
//----------------------------------------
Thanx if you can help.
Dark Ruler is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 09-03-2006 , 22:43   Re: sh_eldiablo
Reply With Quote #2

last time i checked it was
Code:
public plugin_init()
and not
Code:
public plugin_info
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Dark Ruler
Member
Join Date: Jul 2006
Old 09-04-2006 , 10:28   Re: sh_eldiablo
Reply With Quote #3

is that the only one wrong?
__________________

Last edited by Dark Ruler; 09-04-2006 at 10:40.
Dark Ruler is offline
Dark Ruler
Member
Join Date: Jul 2006
Old 09-04-2006 , 11:40   Re: sh_eldiablo
Reply With Quote #4

Ok now i only got 4 errors. Here they are.

Code:
/home/groups/amxmodx/tmp3/phpDN8zPX.sma(68) : error 017: undefined symbol "gPlayerMaxHealth"
/home/groups/amxmodx/tmp3/phpDN8zPX.sma(68) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpDN8zPX.sma(68) : error 001: expected token: ";", but found "]"
/home/groups/amxmodx/tmp3/phpDN8zPX.sma(68) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpDN8zPX.sma(68) : fatal error 107: too many error messages on one line
__________________
Dark Ruler is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 09-04-2006 , 16:58   Re: sh_eldiablo
Reply With Quote #5

add to the global variables
Code:
new gPlayerMaxHealth[SH_MAXSLOTS+1]
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Dark Ruler
Member
Join Date: Jul 2006
Old 09-05-2006 , 18:32   Re: sh_eldiablo
Reply With Quote #6

ok i still get this error
Code:
/home/groups/amxmodx/tmp3/phpQdsK7X.sma(127) : error 017: undefined symbol "set_pev"
/home/groups/amxmodx/tmp3/phpQdsK7X.sma(127) : warning 215: expression has no effect
/home/groups/amxmodx/tmp3/phpQdsK7X.sma(127) : error 001: expected token: ";", but found ")"
/home/groups/amxmodx/tmp3/phpQdsK7X.sma(127) : error 029: invalid expression, assumed zero
/home/groups/amxmodx/tmp3/phpQdsK7X.sma(127) : fatal error 107: too many error messages on one line
__________________
Dark Ruler is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 09-05-2006 , 20:32   Re: sh_eldiablo
Reply With Quote #7

#include <fakemeta> << Add that.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Dark Ruler
Member
Join Date: Jul 2006
Old 09-06-2006 , 20:00   Re: sh_eldiablo
Reply With Quote #8

OMFG THANX SO MUCH. THANK U. Ur the best u get a karma.
__________________
Dark Ruler 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 15:17.


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