PDA

View Full Version : need help with a hero


FLASHBANGER14
08-21-2004, 02:07
i have a hero i need help with that im kinda learning how to make heros so its kida same as cyclops but a differ name but it wont compile cause i have 10 errors can someone help me

vittu
08-21-2004, 02:09
well maybe if you post what the errors are from the compile someone can help...

But I dont think there is a need for another cyclops hero.

FLASHBANGER14
08-21-2004, 03:03
i no theres not but im trying to learn how to make heros

here they r

C:\Valve\Steam\SteamApps\noname289\dedicate d server\cstrike\addons\amx\examples\sh_terra.s ma(29) : error 001: expected token: ";", but found "-identifier-"
C:\Valve\Steam\SteamApps\noname289\dedicate d server\cstrike\addons\amx\examples\sh_terra.s ma(71) : error 017: undefined symbol "g_hasTerraPower"
C:\Valve\Steam\SteamApps\noname289\dedicate d server\cstrike\addons\amx\examples\sh_terra.s ma(71) : warning 215: expression has no effect
C:\Valve\Steam\SteamApps\noname289\dedicate d server\cstrike\addons\amx\examples\sh_terra.s ma(71) : error 001: expected token: ";", but found "]"
C:\Valve\Steam\SteamApps\noname289\dedicate d server\cstrike\addons\amx\examples\sh_terra.s ma(71) : error 029: invalid expression, assumed zero
C:\Valve\Steam\SteamApps\noname289\dedicate d server\cstrike\addons\amx\examples\sh_terra.s ma(71 -- 73) : warning 215: expression has no effect
C:\Valve\Steam\SteamApps\noname289\dedicate d server\cstrike\addons\amx\examples\sh_terra.s ma(139) : error 017: undefined symbol "shSwitchWeaponID"
C:\Valve\Steam\SteamApps\noname289\dedicate d server\cstrike\addons\amx\examples\sh_terra.s ma(294) : warning 203: symbol is never used: "gHasTerraPower"

5 Errors.

Night Slayer
08-21-2004, 03:32
can u guys help me also http://forums.alliedmods.net/showthread.php?t=30693

jtp10181
08-21-2004, 10:00
need the code as well....

FLASHBANGER14
08-21-2004, 14:24
#include <amxmod.inc>
#include <xtrafun>
#include <superheromod.inc>

// Terra - The spying teen titan with powers to control earth

// VARIABLES
new smoke
new laser
new laser_shots[33]

// Damage Variables
#define h1_dam 100 //head
#define h2_dam 56 //body
#define h3_dam 56 //stomach
#define h4_dam 36 //arm
#define h6_dam 36 //leg

new gHeroName[]="Terra"
new gHasTerraPower[SH_MAXSLOTS+1]
new gLastWeapon[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Terra","1.14.4","FLASHBANGER")

// FIRE THE EVENT TO CREATE THIS SUPERHERO!
if (!cvar_exists("Terra_level")) register_cvar("Terra_level", "16" ) shCreateHero(gHeroName, "Laser", "Hold down a key to fire your laser beam!", true, "Terra_level" )

// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
register_event("ResetHUD","newRound","b")

// KEY DOWN
register_srvcmd("Terra_kd", "Terra_kd")
shRegKeyDown(gHeroName, "Terra_kd")
register_srvcmd("Terra_ku", "Terra_ku")
shRegKeyUp(gHeroName, "Terra_ku")

// INIT
register_srvcmd("Terra_init", "Terra_init")
shRegHeroInit(gHeroName, "Terra_init")

// DEATH
register_event("DeathMsg", "Terra_death", "a")

register_cvar("Terra_laser_ammo", "20") // total # of shots...
register_cvar("Terra_laser_burndecals", "1")
register_cvar("Terra_cooldown", "0.20" )
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
smoke = precache_model("sprites/steam1.spr")
laser = precache_model("sprites/laserbeam.spr")
precache_sound("weapons/electro5.wav")
precache_sound("weapons/xbow_hitbod2.wav")
}
//----------------------------------------------------------------------------------------------
public Terra_init()
{
new temp[128]
// First Argument is an id
read_argv(1,temp,5)
new id=str_to_num(temp)

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

g_hasTerraPower[id]=(hasPowers!=0)

}
//----------------------------------------------------------------------------------------------
public Terra_death()
{
new id=read_data(2)

if ( id<0 || id>SH_MAXSLOTS ) return PLUGIN_CONTINUE
remove_task(id)
return PLUGIN_CONTINUE

}
//----------------------------------------------------------------------------------------------
public newRound(id)
{
if ( !hasRoundStarted() )
{
laser_shots[id] = get_cvar_num("Terra_laser_ammo")
gPlayerUltimateUsed[id]=false
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
// RESPOND TO KEYDOWN
public Terra_kd()
{
new temp[6]

if ( !hasRoundStarted() ) return PLUGIN_HANDLED

// First Argument is an id with Terra Powers!
read_argv(1,temp,5)
new id=str_to_num(temp)
if ( !is_user_alive(id) ) return PLUGIN_HANDLED

// Remember this weapon...
new clip,ammo,weaponID=get_user_weapon(id,clip,am mo);
gLastWeapon[id]=weaponID

// switch to knife
engclient_cmd(id,"weapon_knife")

// Let them know they already used their ultimate if they have
new parm[1]
parm[0]=id
TerraFire(parm) // 1 immediate shot
set_task( get_cvar_float("Terra_cooldown"), "TerraFire", id, parm, 1, "b") //delayed shots

return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public TerraFire(parm[])
{
fire_laser(parm[0])
}
//----------------------------------------------------------------------------------------------
public Terra_ku()
{
new temp[6]

// First Argument is an id with Terra Powers!
read_argv(1,temp,5)
new id=str_to_num(temp)

remove_task(id)

// Switch back to previous weapon...
if ( gLastWeapon[id]!=CSW_KNIFE ) shSwitchWeaponID( id, gLastWeapon[id])
}
//----------------------------------------------------------------------------------------------
public laserEffects(id, aimvec[3] )
{
new choose_decal,decal_id

emit_sound(id,CHAN_ITEM, "weapons/electro5.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

choose_decal = random_num(0,0)
switch(choose_decal)
{
case 0: decal_id = 28
case 1: decal_id = 103
case 2: decal_id = 198
case 3: decal_id = 199
}

new origin[3]
get_user_origin(id, origin, 1)

// DELIGHT
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 27 )
write_coord( origin[0] ) //pos
write_coord( origin[1] )
write_coord( origin[2] )
write_byte( 10 )
write_byte( 250 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte( 2 ) // life
write_byte( 1 ) // decay
message_end()

//BEAMENTPOINTS
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte ( 0 ) //TE_BEAMENTPOINTS 0
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
write_coord(aimvec[0])
write_coord(aimvec[1])
write_coord(aimvec[2])
write_short( laser )
write_byte( 1 ) // framestart
write_byte( 5 ) // framerate
write_byte( 2 ) // life
write_byte( 40 ) // width
write_byte( 0 ) // noise
write_byte( 250 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte( 200 ) // brightness
write_byte( 200 ) // speed
message_end()

//Sparks
message_begin( MSG_PVS, SVC_TEMPENTITY)
write_byte( 9 )
write_coord( aimvec[0] )
write_coord( aimvec[1] )
write_coord( aimvec[2] )
message_end()

//Smoke
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 5 ) // 5
write_coord(aimvec[0])
write_coord(aimvec[1])
write_coord(aimvec[2])
write_short( smoke )
write_byte( 22 ) // 10
write_byte( 10 ) // 10
message_end()

if(get_cvar_num("Terra_laser_burndecals") == 1)
{
//TE_GUNSHOTDECAL
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte( 109 ) // decal and ricochet sound
write_coord( aimvec[0] ) //pos
write_coord( aimvec[1] )
write_coord( aimvec[2] )
write_short (0) // I have no idea what thats supposed to be
write_byte (decal_id) //decal
message_end()
}

}
//----------------------------------------------------------------------------------------------
public fire_laser(id)
{
new aimvec[3]
new tid,tbody
new FFOn= get_cvar_num("mp_friendlyfire")

if( !is_user_alive(id) ) return

if ( laser_shots[id]<=0 )
{
playSoundDenySelect(id)
return
}

// Use the ultimate
// ultimateTimer(id, get_cvar_float("Terra_cooldown") )

// Make sure still on knife
new clip,ammo,weaponID=get_user_weapon(id,clip,am mo);
if ( weaponID != CSW_KNIFE ) engclient_cmd(id,"weapon_knife")

// Warn How many Blasts Left...
laser_shots[id]--
if(laser_shots[id] < 6) client_print(id,print_chat,"Warning %d Terra Shots Left", laser_shots[id] )

get_user_origin(id,aimvec,3)
laserEffects(id, aimvec)

get_user_aiming(id,tid,tbody,9999)

if( tid > 0 && tid < 33 && ( FFOn || get_user_team(id)!=get_user_team(tid) ) )
{
emit_sound(tid,CHAN_BODY, "weapons/xbow_hitbod2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

// Determine the damage
new damage;
switch(tbody)
{
case 1: damage=h1_dam
case 2: damage=h2_dam
case 3: damage=h3_dam
case 4: damage=h4_dam
case 5: damage=h4_dam
case 6: damage=h6_dam
case 7: damage=h6_dam
}

// Deal the damage...
shExtraDamage(tid, id, damage, "Terra Laser")
}
}
//----------------------------------------------------------------------------------------------
public client_disconnect(id)
{
// stupid check but lets see
if ( id <=0 || id>32 ) return PLUGIN_CONTINUE

// Yeah don't want any left over residuals
remove_task(id)

return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------

jtp10181
08-21-2004, 17:02
your line 29 is actually two lines of code, put an enter right before the
"shCreateHero(gHeroName, "Laser", ....." part

FLASHBANGER14
08-21-2004, 17:08
ok and i also need help on setting up my lvls so i can have 30 lvls

jtp10181
08-21-2004, 17:11
edit the superhero.ini

edit the superheromod.inc file and insrease the max levels and recompile the plugin.

FLASHBANGER14
08-21-2004, 17:18
i dunno how lol

because ive tried it already and it wont work

jtp10181
08-21-2004, 17:22
sucks for you, i have a compiler package and some basic directions on how to change it and compile. No sense in me repeating whats already in the docs when you can just go read it.

Also just saying "it wont work" == NO HELP from me

FLASHBANGER14
08-22-2004, 20:23
ok i found help in another forum but when i have it set for 30 lvls it says this in the console [AMX] NUMLEVELS in superhero.ini is defined higher than SH_MAXLEVELS in the include file. Adjusting NUMLEVELS to 20

jtp10181
08-22-2004, 20:27
http://forums.alliedmods.net/showthread.php?p=260447#3538