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

Help with "my" hero...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
123
Veteran Member
Join Date: Apr 2005
Location: Katy, TX
Old 09-22-2004 , 14:50   Help with "my" hero...
Reply With Quote #1

I have "created" a hero just for fun...
The onky thing I have done is to edit the tutorial by asskickr.
But it can't be compiled...
Anyone who knows what is wrong ?
It shows 20 errors.

There is a pic of the errors, and the code is attached.
Attached Images
File Type: jpg errors.JPG (107.3 KB, 232 views)
Attached Files
File Type: sma Get Plugin or Get Source (sh.sma - 866 views - 12.9 KB)
__________________
//ShadowLeader - 123
123 is offline
123
Veteran Member
Join Date: Apr 2005
Location: Katy, TX
Old 09-22-2004 , 14:51  
Reply With Quote #2

Sorry for the big pic...
Edit: Pic fixed...
__________________
//ShadowLeader - 123
123 is offline
Prowler
Senior Member
Join Date: Nov 2004
Old 09-22-2004 , 21:06  
Reply With Quote #3

at first glance i think the main problem is the name of the hero "123" it doesnt like numbers it would seem, hence all the "" errors and _damage etc.

I downloaded the SMA and replaced 123 with OneTwoThree and it compiled fine except for "symbol is never used (id)" which is the same error if you attempt to compile the tutorial hero by itself.

Just go to edit -> replace and replace OneTwoThree with the name of your choice
Attached Files
File Type: sma Get Plugin or Get Source (sh.sma - 160 views - 13.5 KB)
Prowler is offline
123
Veteran Member
Join Date: Apr 2005
Location: Katy, TX
Old 09-23-2004 , 05:22  
Reply With Quote #4

HEHE !

Okay...
Now I got it to wwork but it's powers doesn't work
I think it is because it is taken directly from the toturial...
__________________
//ShadowLeader - 123
123 is offline
imported_Phiber
Senior Member
Join Date: Jul 2004
Location: Sweden
Old 09-23-2004 , 07:24  
Reply With Quote #5

I made my first hero from the tutorial but i removed all the hp regen stuff so that the hero only gave me hp, ap and gravity. And i had no problem or errors with the tutorial code so maybe you got a bug in your code 123.

Btw 123, im Eyeless
imported_Phiber is offline
Send a message via MSN to imported_Phiber Send a message via Yahoo to imported_Phiber
123
Veteran Member
Join Date: Apr 2005
Location: Katy, TX
Old 09-23-2004 , 13:05  
Reply With Quote #6

Okay... Now my hero works. Or worked
Until I would get it to autoheal like wolverine...
I would like if someone could take a look at the code and tell me what is wrong...

Code:
#include <amxmod.inc>
#include <xtrafun>
#include <superheromod.inc>
#include <Vexd_Utilities>

// SHADOWLEADER!

// CREDITS
// {HOJ} Batman
// Asskickr
// Freecode

// CVARS


// VARIABLES
new gHeroName[]="ShadowLeader"
new gHasshadowPower[SH_MAXSLOTS+1]
new gHealPoints
//-------------------------------------------------------------------------------------------
public plugin_init()
{
	register_plugin("SUPERHERO ShadowLeader","1.0","ShadowLeader")
	
	if ( isDebugOn() ) server_print("Attempting to create shadow Hero")
    register_cvar("shadow_level", "3" )
    shCreateHero(gHeroName, "Mp5 - Hp/Ap/Gravity", "New Mp5 does more dmg - Hp/Ap/Gravity", false, "shadow_level" )
    
    register_srvcmd("shadow_init", "shadow_init")
    shRegHeroInit(gHeroName, "shadow_init")
    
    register_event("ResetHUD","newRound","b")
    register_event("WeapPickup","model","b","1=19")
    register_event("CurWeapon","check_mp5","be","1=1")
    register_event("Damage", "shadow_damage", "b", "2!0")
    
	// HEAL LOOP
  register_srvcmd("shadow_loop", "shadow_loop")
  //shRegLoop1P0(gHeroName, "shadow_loop", "ac") // Alive shadowHeros="ac"
  set_task(1.0,"shadow_loop",0,"",0,"b" )
  
    //Cvars
    
    register_cvar("shadow_gravity", "0.35" )
    register_cvar("shadow_armor", "250")
    register_cvar("shadow_health", "250")
    register_cvar("shadow_speed", "300")
    register_cvar("shadow_mp5mult", "2.5")
	register_cvar("shadow_healpoints", "3" )
  gHealPoints=get_cvar_num("shadow_healpoints")
    
    shSetMaxHealth(gHeroName, "shadow_health" ) 
    shSetMinGravity(gHeroName, "shadow_gravity" )
    shSetMaxArmor(gHeroName, "shadow_armor" )
    shSetMaxSpeed(gHeroName, "shadow_speed", "[0]" )
    
}
//-------------------------------------------------------------------------------------------

//-------------------------------------------------------------------------------------------
public plugin_precache()
{
 precache_model("models/shadow/v_mp5.mdl")
 
  return PLUGIN_CONTINUE
}
//-------------------------------------------------------------------------------------------
public shadow_init()
{
  new temp[6]
  read_argv(1,temp,5)
  new id=str_to_num(temp)
  
  read_argv(2,temp,5)
  new hasPowers=str_to_num(temp)
  gHasshadowPower[id]=(hasPowers!=0)
  
  if ( hasPowers )
  {
  gHasshadowPower[id]=true
  }

  if ( !hasPowers  && is_user_connected(id) )
  {
	gHasshadowPower[id]=false
    shRemHealthPower(id)
    shRemGravityPower(id)
    shRemArmorPower(id)
    shRemSpeedPower(id)
  }
}
//------------------------------------------------------------------------------------------- 
public newRound(id) {
  if ( gHasshadowPower[id] && is_user_alive(id) && shModActive() ) {
    shadow_weapons(id)
  }
  return PLUGIN_CONTINUE
}
//-------------------------------------------------------------------------------------------
public shadow_weapons(id) {
  if ( !is_user_alive(id) ) return PLUGIN_CONTINUE 
  shGiveWeapon(id,"weapon_mp5navy") 
  shGiveWeapon(id,"ammo_9mm") 
  model(id)
  return PLUGIN_HANDLED
} 
//--------------------------------------------------------------------------------------------
 public model(id) { 
  if ( !is_user_alive(id) ) return PLUGIN_CONTINUE 
  Entvars_Set_String(id, EV_SZ_viewmodel, "models/shadow/v_mp5.mdl") 
  new iCurrent 
  iCurrent = FindEntity(-1,"weapon_mp5navy") 
  while(iCurrent != -1) { 
    iCurrent = FindEntity(iCurrent,"weapon_mp5navy") 
   } 
  return PLUGIN_HANDLED
}
//--------------------------------------------------------------------------------------------
public check_mp5(id)
{ 
if ( !gHasshadowPower[id] || !shModActive() ) return PLUGIN_CONTINUE
new clip, ammo 
new wpn_id=get_user_weapon(id, clip, ammo)

if ( wpn_id == CSW_MP5NAVY ) model(id)

if ( !gHasshadowPower[id] || !shModActive() ) return PLUGIN_CONTINUE

new wpn[32]
if ( wpn_id!=CSW_MP5NAVY ) return PLUGIN_CONTINUE
    
    // Never Run Out of Ammo!
if ( clip == 0 )
 {
  get_weaponname(wpn_id,wpn,31)
  give_item(id,wpn)
  engclient_cmd(id, wpn ) 
  engclient_cmd(id, wpn ) 
  engclient_cmd(id, wpn )
 }
return PLUGIN_CONTINUE 
}
//--------------------------------------------------------------------------------------------
public shadow_damage(id)
{
    if (!shModActive()) return PLUGIN_CONTINUE

    new damage = read_data(2)
    new weapon, bodypart, attacker = get_user_attacker(id,weapon,bodypart)
    
    if ( attacker <=0 || attacker>SH_MAXSLOTS ) return PLUGIN_CONTINUE
    
    if ( gHasshadowPower[attacker] && weapon == CSW_MP5NAVY && is_user_alive(id) )
    {
       // do extra damage
       new extraDamage = floatround(damage * get_cvar_float("shadow_mp5mult") - damage)
       shExtraDamage( id, attacker, extraDamage, "mp5navy" )
    }
    return PLUGIN_CONTINUE
}
//--------------------------------------------------------------------------------------------
public shadow_loop()
{
  for ( new id=1; id<=SH_MAXSLOTS; id++ )
  {
    if (  g_hasshadowPowers[id] && is_user_alive(id)  )  
    {
      // Let the server add the hps back since the # of max hps is controlled by it
      // I.E. Superman has more than 100 hps etc.
      // So we don't have to pass server messages - I'm going to set a cvar here...
      //shAddHPs(id, get_cvar_num("shadow_healpoints") )
      shAddHPs(id, gHealPoints, 100 )
    }
  }
}
//--------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------
Attached Images
File Type: jpg error.jpg (18.6 KB, 276 views)
__________________
//ShadowLeader - 123
123 is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-23-2004 , 13:20  
Reply With Quote #7

cant you look at the errors and look at the line with error and maybe try to fix it. These errors are very easy to fix. its all common sense
Freecode is offline
reaper
Senior Member
Join Date: May 2004
Old 09-23-2004 , 14:43  
Reply With Quote #8

Here you go bro you had G_hasshadowPowers when it should have been gHasshadowPower and the loose inditations are just lil gramatical errors or w/e you didnt hit space or w/e iunno i just no ho to fix them well you only have to loose inditations here ya go bro
Attached Files
File Type: zip shadow.zip (5.0 KB, 137 views)
reaper is offline
Send a message via AIM to reaper Send a message via Yahoo to reaper
123
Veteran Member
Join Date: Apr 2005
Location: Katy, TX
Old 09-24-2004 , 10:27  
Reply With Quote #9

Quote:
Originally Posted by Freecode
cant you look at the errors and look at the line with error and maybe try to fix it. These errors are very easy to fix. its all common sense
-> I'm not good at scripting heroes... This is my first...


reaper -> thanks it worked.

Also I have also coded ithius's esp rings into it - just for fun...
so it is only a rip-off hero.
But i'm not going to realese it...
__________________
//ShadowLeader - 123
123 is offline
reaper
Senior Member
Join Date: May 2004
Old 09-24-2004 , 21:29  
Reply With Quote #10

ite bro your welcome any time i could help i do
reaper is offline
Send a message via AIM to reaper Send a message via Yahoo to reaper
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 06:52.


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