View Single Post
Scooby Doo
Junior Member
Join Date: Aug 2007
Location: Denmark soon United States of America...
Old 12-07-2007 , 03:12   Re: Hero Request : Skull Head
Reply With Quote #3

Yes, but i still dont know, how to make AMXX... Pleas help me!

i got the sma, here
Code:
//Skull Head! - use ur\' ultimate power with Skull head
//This hero was made was using jtpizzalover's superhero generator
/* CVARS - copy and paste to shconfig.cfg
//Skull Head 
Skull Head_level 21 
Skull Head_health 800 //Default 100 (no extra health)
Skull Head_armor 999  //Default 150
Skull Head_gravity 0,35 //Default 1.0 = no extra gravity (0.50 is 50% normal gravity, ect.)
Skull Head_speed 999  //Default -1 = no extra speed, this cvar is for all weapons (for faster then normal speed set to 261 or higher)
Skull Head_ak47mult 5,0  //Damage multiplyer for his ak47 
*/
#include <amxmodx>
#include <superheromod>
#include <fakemeta> 
new HeroName[] = "Skull Head"
new bool:HasHero[SH_MAXSLOTS+1]
new bool:HeroModelSet[SH_MAXSLOTS+1] 
new Cvarak47DmgMult 
public plugin_init()
{
 // Plugin Info
 register_plugin("SUPERHERO Skull Head","1,0","Shadow")
 
 // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
 register_cvar("Skull Head_level", "21")
 register_cvar("Skull Head_health", "800")
 register_cvar("Skull Head_armor", "999")
 register_cvar("Skull Head_gravity", "0,35")
 register_cvar("Skull Head_speed", "999")
 Cvarak47DmgMult = register_cvar("Skull Head_ak47mult", "5,0") 
 // FIRE THE EVENT TO CREATE THIS SUPERHERO!
 shCreateHero(HeroName, "Hp,Armor, new weapon, new model! AND MORE!!", "use ur\' ultimate power with Skull head", false, "Skull Head_level")
 
 // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
 // INIT
 register_srvcmd("Skull Head_init", "Skull Head_init")
 shRegHeroInit(HeroName, "Skull Head_init")
  
 // EVENTS
 register_event("ResetHUD", "new_spawn", "b")
 register_event("DeathMsg", "Skull Head_death", "a") 
 register_event("CurWeapon", "weapon_change", "be", "1=1")
 register_event("Damage", "Skull Head_damage", "b", "2!0") 
 // Let Server know about the hero's variables
 shSetShieldRestrict(HeroName)
 shSetMaxHealth(HeroName, "Skull Head_health")
 shSetMaxArmor(HeroName, "Skull Head_armor")
 shSetMinGravity(HeroName, "Skull Head_gravity")
 shSetMaxSpeed(HeroName, "Skull Head_speed", "[0]")
}
public plugin_precache()
{ 
 precache_model("models/shmod/Skull_Head_v_ak47.mdl")
 precache_model("models/shmod/Skull_Head_p_ak47.mdl")
 precache_model("models/player/Skull_Head/Skull_Head.mdl")  
} 
public Skull Head_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) 
 //This hero was made was using jtpizzalover's superhero generator
 // Reset their shield restrict status
 // Shield restrict MUST be before weapons are given out
 shResetShield(id)
 switch(hasPowers)
 {
  case true:
  {
   HasHero[id] = true
   if ( is_user_alive(id) )
   { 
    Skull Head_weapons(id)
    switch_model(id)
   }
  } 
  case false:
  { 
   // Check is needed since this gets run on clearpowers even if user didn't have this hero
 if ( is_user_alive(id) && HasHero[id] )
   {
    // This gets run if they had the power but don't anymore
    engclient_cmd(id, "drop", "weapon_ak47") 
    Skull Head_unmorph(id) 
    shRemHealthPower(id)
    shRemArmorPower(id)
    shRemGravityPower(id)
    shRemSpeedPower(id)
   }
 HasHero[id] = false 
   }
 } 
}
public new_spawn(id)
{
 if ( shModActive() && is_user_alive(id) && HasHero[id] )
 {
  set_task(0.1, "Skull Head_weapons", id)
  Skull Head_tasks(id)
 }
}
Skull Head_tasks(id)
{
 set_task(1.0, "Skull Head_morph", id)
} 
public Skull Head_weapons(id)
{
 if ( !shModActive() || !is_user_alive(id) || !HasHero[id] )
  return
 shGiveWeapon(id, "weapon_ak47")
}
switch_model(id)
{
 if ( !shModActive() || !is_user_alive(id) || !HasHero[id] )
  return
 new clip, ammo, wpnid = get_user_weapon(id, clip, ammo)
 if ( wpnid == CSW_AK47 )
 {
  set_pev(id, pev_viewmodel2, "models/shmod/Skull_Head_v_ak47.mdl")
  set_pev(id, pev_weaponmodel2, "models/shmod/Skull_Head_p_ak47.mdl")
 }
}
public weapon_change(id)
{
 if ( !shModActive() || !HasHero[id] )
  return
 new wpnid = read_data(2)
 if ( wpnid != CSW_AK47 )
  return
 switch_model(id)
 new clip = read_data(3)
 // Never Run Out of Ammo!
 if ( clip == 0 )
  shReloadAmmo(id)
}
public Skull Head_damage(id)
{
 if ( !shModActive() || !is_user_alive(id) )
  return
 new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
 if ( attacker <= 0 || attacker > SH_MAXSLOTS )
  return
 if ( HasHero[attacker] && weapon == CSW_AK47 && is_user_alive(id) )
 {
  new damage = read_data(2)
  new headshot = bodypart == 1 ? 1 : 0
  // do extra damage
  new extraDamage = floatround(damage * get_pcvar_float(Cvarak47DmgMult) - damage)
  if ( extraDamage > 0 )
   shExtraDamage(id, attacker, extraDamage, "ak47", headshot)
 }
} 
public Skull Head_morph(id)
{
 if ( HeroModelSet[id] || !is_user_alive(id) || !HasHero[id] )
  return
 cs_set_user_model(id, "Hero")
 HeroModelSet[id] = true
}
Skull Head_unmorph(id)
{
 if ( HeroModelSet[id] && is_user_connected(id) )
  {
  cs_reset_user_model(id)
  HeroModelSet[id] = false
 }
}
public Skull Head_death()
{
 new id = read_data(2)
 if ( !HasHero[id] )
 return
 Skull Head_unmorph(id)
}
public client_connect(id)
{
 HasHero[id] = false
 HeroModelSet[id] = false
}
Attached Files
File Type: sma Get Plugin or Get Source (sh_skullhead.sma.sma - 180 views - 5.4 KB)
__________________
Pleas + My Carma! -->
I am 59% addicted to Counterstrike. What about you?

Last edited by Scooby Doo; 12-07-2007 at 03:17. Reason: maked a quote, that was wrong
Scooby Doo is offline
Send a message via AIM to Scooby Doo Send a message via MSN to Scooby Doo Send a message via Skype™ to Scooby Doo