Raised This Month: $104 Target: $400
 26% 

Scripting help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
&|Spartan|{IV}-Leader-&
Junior Member
Join Date: Aug 2007
Location: Washington, Seatle
Old 08-17-2007 , 10:40   Scripting help!
Reply With Quote #1

Can someone please fix this script it compiles but when i use my power on the server it does nothing its their but when i choose it it does nothing at all. i need someone to fix it and make it admin only please thanks you
Code:
//GuerillaSpartan! - Become a GuerillaSpartan
//This hero was made was using jtpizzalover's superhero generator
/* CVARS - copy and paste to shconfig.cfg
//GuerillaSpartan 
GuerillaSpartan_level 20 
GuerillaSpartan_health 500 //Default 100 (no extra health)
GuerillaSpartan_armor 500  //Default 150
GuerillaSpartan_gravity 1 //Default 1.0 = no extra gravity (0.50 is 50% normal gravity, ect.)
GuerillaSpartan_speed 1000  //Default -1 = no extra speed, this cvar is for all weapons (for faster then normal speed set to 261 or higher)
GuerillaSpartan_augmult 4  //Damage multiplyer for his aug 
*/
#include <amxmodx>
#include <superheromod>
#include <fakemeta> 
new HeroName[] = "GuerillaSpartan"
new bool:HasHero[SH_MAXSLOTS+1]
new bool:HeroModelSet[SH_MAXSLOTS+1] 
new CvaraugDmgMult 
public plugin_init()
{
 // Plugin Info
 register_plugin("SUPERHERO GuerillaSpartan","amxx","&|Spartan|{IV}-Leader-&")
 
 // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
 register_cvar("GuerillaSpartan_level", "20")
 register_cvar("GuerillaSpartan_health", "500")
 register_cvar("GuerillaSpartan_armor", "500")
 register_cvar("GuerillaSpartan_gravity", "1")
 register_cvar("GuerillaSpartan_speed", "1000")
 CvaraugDmgMult = register_cvar("GuerillaSpartan_augmult", "4") 
 // FIRE THE EVENT TO CREATE THIS SUPERHERO!
 shCreateHero(HeroName, "GuerillaSpartan", "Become a GuerillaSpartan", false, "GuerillaSpartan_level")
 
 // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
 // INIT
 register_srvcmd("GuerillaSpartan_init", "GuerillaSpartan_init")
 shRegHeroInit(HeroName, "GuerillaSpartan_init")
  
 // EVENTS
 register_event("ResetHUD", "new_spawn", "b")
 register_event("DeathMsg", "GuerillaSpartan_death", "a") 
 register_event("CurWeapon", "weapon_change", "be", "1=1")
 register_event("Damage", "GuerillaSpartan_damage", "b", "2!0") 
 // Let Server know about the hero's variables
 shSetShieldRestrict(HeroName)
 shSetMaxHealth(HeroName, "GuerillaSpartan_health")
 shSetMaxArmor(HeroName, "GuerillaSpartan_armor")
 shSetMinGravity(HeroName, "GuerillaSpartan_gravity")
 shSetMaxSpeed(HeroName, "GuerillaSpartan_speed", "[0]")
}
public plugin_precache()
{ 
        precache_model("models/shmod/GuerillaSpartan_v_aug.mdl")
 precache_model("models/shmod/GuerillaSpartan_p_aug.mdl")
 precache_model("models/shmod/GuerillaSpartan_w_aug.mdl")
        precache_model("models/player/GuerillaSpartan/GuerillaSpartan.mdl")  
} 
public GuerillaSpartan_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) )
   { 
    GuerillaSpartan_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_aug") 
    GuerillaSpartan_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, "GuerillaSpartan_weapons", id)
  GuerillaSpartan_tasks(id)
 }
}
GuerillaSpartan_tasks(id)
{
 set_task(1.0, "GuerillaSpartan_morph", id)
} 
public GuerillaSpartan_weapons(id)
{
 if ( !shModActive() || !is_user_alive(id) || !HasHero[id] )
  return
 shGiveWeapon(id, "weapon_aug")
}
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_AUG )
 {
  set_pev(id, pev_viewmodel2, "models/shmod/GuerillaSpartan_v_aug.mdl")
  set_pev(id, pev_weaponmodel2, "models/shmod/GuerillaSpartan_w_aug.mdl")
 }
}
public weapon_change(id)
{
 if ( !shModActive() || !HasHero[id] )
  return
 new wpnid = read_data(2)
 if ( wpnid != CSW_AUG )
  return
 switch_model(id)
 new clip = read_data(3)
 // Never Run Out of Ammo!
 if ( clip == 0 )
  shReloadAmmo(id)
}
public GuerillaSpartan_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_AUG && 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(CvaraugDmgMult) - damage)
  if ( extraDamage > 0 )
   shExtraDamage(id, attacker, extraDamage, "aug", headshot)
 }
} 
public GuerillaSpartan_morph(id)
{
 if ( HeroModelSet[id] || !is_user_alive(id) || !HasHero[id] )
  return
 cs_set_user_model(id, "Hero")
 HeroModelSet[id] = true
}
GuerillaSpartan_unmorph(id)
{
 if ( HeroModelSet[id] && is_user_connected(id) )
  {
  cs_reset_user_model(id)
  HeroModelSet[id] = false
 }
}
public GuerillaSpartan_death()
{
 new id = read_data(2)
 if ( !HasHero[id] )
 return
 GuerillaSpartan_unmorph(id)
}
public client_connect(id)
{
 HasHero[id] = false
 HeroModelSet[id] = false
}
__________________
Help me = Good Karma I am 45% addicted to Counterstrike. What about you?
&|Spartan|{IV}-Leader-& is offline
&|Spartan|{IV}-Leader-&
Junior Member
Join Date: Aug 2007
Location: Washington, Seatle
Old 08-17-2007 , 22:27   Re: Scripting help!
Reply With Quote #2

Can anyone help me please?
__________________
Help me = Good Karma I am 45% addicted to Counterstrike. What about you?
&|Spartan|{IV}-Leader-& is offline
stealth5706
Junior Member
Join Date: Jun 2007
Old 08-17-2007 , 22:32   Re: Scripting help!
Reply With Quote #3

first of all it looks like your ripping superaug and second you dont need a w model you cant set one in shero...
__________________


I am 77% addicted to Counterstrike. What about you?
stealth5706 is offline
Send a message via AIM to stealth5706 Send a message via MSN to stealth5706
&|Spartan|{IV}-Leader-&
Junior Member
Join Date: Aug 2007
Location: Washington, Seatle
Old 08-17-2007 , 22:42   Re: Scripting help!
Reply With Quote #4

1. i didnt rip it from superaug i made it using superhero generator
2. it shows the power on the showmenu list but when i get it it does nothing..
__________________
Help me = Good Karma I am 45% addicted to Counterstrike. What about you?
&|Spartan|{IV}-Leader-& is offline
stealth5706
Junior Member
Join Date: Jun 2007
Old 08-17-2007 , 22:45   Re: Scripting help!
Reply With Quote #5

ok now i see that but also dude just use superaug and change the weapon model cause thats all it looks like your trying to do...
__________________


I am 77% addicted to Counterstrike. What about you?
stealth5706 is offline
Send a message via AIM to stealth5706 Send a message via MSN to stealth5706
stealth5706
Junior Member
Join Date: Jun 2007
Old 08-17-2007 , 22:46   Re: Scripting help!
Reply With Quote #6

seriously just use superaug cause thats all your trying to do and you used the generator so please dont complain...

Quote:
Originally Posted by vittu View Post
Run the generator again, this time do not put any spaces in the hero name.

And if you post this I will shoot you.
__________________


I am 77% addicted to Counterstrike. What about you?

Last edited by stealth5706; 08-17-2007 at 22:47. Reason: needed to be
stealth5706 is offline
Send a message via AIM to stealth5706 Send a message via MSN to stealth5706
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 21:47.


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