Raised This Month: $ Target: $400
 0% 

sh_maclaren


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
El Diablo
Guest
Old 07-16-2006 , 19:27   sh_maclaren
Reply With Quote #1

Code:
 // Maclaren - Based on car
/* CVARS - copy and past to shconfig.cfg 
// Maclaren Hero!
Maclaren_level 9    //level you get it -default
Maclaren_gravity 0.40 //gravity and hight -default 
Maclaren_armor 300 //armor -default
Maclaren_health 400  //health -default
Maclaren_deagle 1.5 //mutilper for deagle damage 
*/

#include <amxmod>
#include <superheromod>
// variables
new=gHeroName[]="Maclaren"
//--------------------------------------------------------------------------------------------------
public plugin_init () 
{
    register_plugin("SuperHero Maclaren", "1.71" "Diablo")
    // edit the shconfig.cfg not this
    register_cvar ("Maclaren_level", "2")
    register_cvar ("Maclaren_gravity", "0.40")
    register_cvar ("Maclaren_armor", "300")
    register_cvar ("Maclaren_health", "400")
    // create its events
    shCreateHero(gHeroName, "New Dealge w/ SuperFast", "Fast!", false, "Maclaren_level")
    // INIT
    register_srvcmd ("Maclaren_init", "Maclaren_init")
    shRegHeroInit{gHeroName, "Maclaren_init") 
    // give server its variables
    shSetMaxHealth(gHeroName, "Maclaren_health")
    shSetMaxGravity(gHeroName, "Maclaren_gravity")
    shSetMaxArmor(gHeroName, "Maclaren_armor")
    shSetMaxSpeed(gHeroName, "Maclaren_speed", "[0]")
}
//--------------------------------------------------------------------------------------------------
public plugin_precache()
{
    precachemodel("models/shmod/maclaren_deagle")
}
//--------------------------------------------------------------------------------------------------
public plugin_precache()
{
    precachesound("shmod/de_clipin.wav")
    precachesound("shmod/de_clipout.wav")
    precachesound("shmod/de_deploy.wav")
    precachesound("shmod/end.wav")
    precachesound("shmod/de_slideback")
    precachesound("shmod/deagle-1.wav")
    precachesound("shmod/deagle-2.wav")
}    precachemodel("models/shmod/maclaren_deagle")
//--------------------------------------------------------------------------------------------------
publice Maclaren_init()
{
    // First agrument is and id
    new temp[6]
    read_argv(1,temp,5)
    new id = str_to_num(temp)

    // 2nd agrument is 0 to 1 depending the id has the hero
    read_argv(2,temp,5)
    new hasPowers = str_to_num(temp)
    
    gHasMaclarenPower[id] = (hasPowers !=0)
    
    // Reset their shield restrict status
    // Shield restrict MUST be before weapons are given out
    shResetShielf(id)
    
    if ( !is_user_alive(id) ) return
    
    if ( gHasMaclarenPower[id] ) {
        maclaren_weapons(id)
        switchmodel(id)
    }
    else {
        engclient_cmd(id, "drop", "weapon_deagle")
        shRemGravityPower(id)
    }
}
//--------------------------------------------------------------------------------------------------
public plugin_cfg(id)
{
    loadCVAR(id)
}
//--------------------------------------------------------------------------------------------------
public newSpawn(id)
{
    
    if ( gHasMaclarenPower[id] && is_user_alive(id) && shModActive() ) {
        set_task(0.1, "maclaren_weapons", id)

        new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
        if ( wpnid != CSW_DEAGLE && wpnid > 0 ) {
            new wpn[32]
            get_weaponname(wpnid, wpn, 31)
            engclient_cmd(id, wpn)
        }
    }
}
//--------------------------------------------------------------------------------------------------
public weaponChange(id)
{
    
    if ( !gHasMaclarenPower[id] || !shModActive() ) return

    new wpnid = read_data(2)
    new clip = read_data(3)

    if ( wpnid != CSW_DEAGLE ) return

    switchmodel(id)

    // Never Run Out of Ammo!
    if ( clip == 0 ) {
        shReloadAmmo(id)
    }
}
//--------------------------------------------------------------------------------------------------
public maclaren_damage(id)
{
    
    if ( !shModActive() || !is_user_alive(id) ) return

    new damage = read_data(2)
    new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
    new headshot = bodypart == 1 ? 1 : 0

    if ( attacker <= 0 || attacker > SH_MAXSLOTS ) return

    if ( gHasMaclarenPower[attacker] && weapon == CSW_DEAGLE && is_user_alive(id) ) {
        // do extra damage
        new extraDamage = floatround(damage * get_cvar_float("usmarine_deagle") - damage)
        if (extraDamage > 0) shExtraDamage(id, attacker, extraDamage, "deagle", headshot)
    }
}
//--------------------------------------------------------------------------------------------------
Can you fix this hero? cuz when i try compiling i get 6 errors
dawe
Member
Join Date: Jan 2006
Location: sweden
Old 07-17-2006 , 03:24   Re: sh_maclaren
Reply With Quote #2

LOOK HERE
new extraDamage = floatround(damage * get_cvar_float("usmarine_deagle") change here!!! the name


and you need to make more of this } !!!!!!

Last edited by dawe; 07-17-2006 at 03:30.
dawe is offline
Send a message via MSN to dawe
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 05:05.


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