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

help me wiht my hero


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Killer Mc Killer
Member
Join Date: Aug 2005
Old 09-06-2005 , 04:46   help me wiht my hero
Reply With Quote #1

/* CVARS - copy and paste to shconfig.cfg

//Justice League
justiceleague_level 1
justiceleague_laser_ammo 50 //total # of shots given each round
justiceleague_laser_burndecals 1 //Show the burn decals on the walls
justiceleague_cooldown2 0.10 //cooldown timer between laser shots
justiceleague_multishot 0.10 //Delay for multishots on holding key down
justiceleague_cooldown 45 //Cooldown for the mirrordamage
justiceleague_damage 75 //How many damage the backdamage does
justiceleague_health 150 //How many HP the hero has
justiceleague_armor 150 //How many AP the hero has

*/

#include <amxmod>
#include <Vexd_Utilities>
#include <xtrafun>
#include <superheromod>

// Damage Variables
#define h1_dam 200 //head
#define h2_dam 70 //body
#define h3_dam 75 //stomach
#define h4_dam 50 //arm
#define h6_dam 50 //leg

// GLOBAL VARIABLES
new smoke, laser, laser_shots[SH_MAXSLOTS+1]
new bool:gHasJusticeLeaguePower[SH_MAXSLOTS+1]
new gSpriteLightning
new gLastWeapon[SH_MAXSLOTS+1]
new gUsingLaser[SH_MAXSLOTS+1]
new gHeroName[]="Justice League"
static const burn_decal[5] = {199,200,201,202,203}
new gCurrentWeapon[SH_MAXSLOTS+1]
new gmsgSetFOV

#define giveTotal 8
new weapArray[giveTotal][24] = {
"weapon_flashbang",
"weapon_smokegrenade",
"weapon_deagle",
"weapon_mp5navy",
"weapon_xm1014",
"weapon_sg552",
"weapon_awp",
"weapon_m4a1"
}
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Justice League","1.0","Killer Mc Killer")

// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("justiceleague_level", "1" )
register_cvar("justiceleague_laser_ammo", "50")
register_cvar("justiceleague_laser_burndecals ", "1")
register_cvar("justiceleague_cooldown2", "0.10" )
register_cvar("justiceleague_multishot", "0.10" )
register_cvar("justiceleague_cooldown", "45" )
register_cvar("justiceleague_damage", "75" )
register_cvar("justiceleague_health", "150")
register_cvar("justiceleague_armor", "150")

// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "Laser/HP/AP/No Clip/Guns/Mirrordamage", "Free Guns, Backdamage, More HP and AP and you will have a Laser.", true, "justiceleague_level" )

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

//Weapons
register_event("CurWeapon","changeWeapon","be ","1=1")

//NEW ROUND
register_event("ResetHUD","newSpawn","b")

//Back damage
register_event("Damage", "justiceleague_damage", "b", "2!0")

// KEY DOWN
register_srvcmd("justiceleague_kd", "justiceleague_kd")
shRegKeyDown(gHeroName, "justiceleague_kd")
register_srvcmd("justiceleague_ku", "justiceleague_ku")
shRegKeyUp(gHeroName, "justiceleague_ku")

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

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

// Let Server know about Justice League's Variable
// It is possible that another hero has more hps, less gravity, or more armor
// so rather than just setting these - let the superhero module decide each round
shSetMaxHealth(gHeroName, "justiceleague_health" )
shSetMaxArmor(gHeroName, "justiceleague_armor" )
shSetShieldRestrict(gHeroName)

gmsgSetFOV = get_user_msgid("SetFOV")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
gSpriteLightning = precache_model("sprites/lgtning.spr")
smoke = precache_model("sprites/steam1.spr")
laser = precache_model("sprites/laserbeam.spr")
precache_sound("weapons/electro5.wav")
precache_sound("weapons/xbow_hitbod2.wav")
}
//----------------------------------------------------------------------------------------------
public justiceleague_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 justiceleague powers
read_argv(2,temp,5)
new hasPowers=str_to_num(temp)

gHasJusticeLeaguePower[id] = (hasPowers!=0)

justiceleague_giveweapons(id)

// Got to slow down a cat that lost his powers...
if ( !hasPowers && is_user_connected(id) ){
}
else {
switchmodel(id)
}
//This gets run if they had the power but don't anymore
if ( gHasJusticeLeaguePower[id] ) {
shRemHealthPower(id)
shRemArmorPower(id)
justiceleague_dropweapons(id)
}
if (gHasJusticeLeaguePower[id]) {
gPlayerUltimateUsed[id] = false
laser_shots[id] = get_cvar_num("justiceleague_laser_ammo")
}
}
//----------------------------------------------------------------------------------------------
public justiceleague_death()
{
new id = read_data(2)

if ( id <= 0 || id > SH_MAXSLOTS ) return
remove_task(id)
}
//----------------------------------------------------------------------------------------------
public newRound(id)
{
if ( gHasJusticeLeaguePower[id] && is_user_alive(id) && shModActive() ) {
set_task(0.1, "justiceleague_giveweapons",id)
}
remove_task(id)
laser_shots[id] = get_cvar_num("justiceleague_laser_ammo")
gPlayerUltimateUsed[id] = false
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
if ( gHasJusticeLeaguePower[id] && is_user_alive(id) && shModActive() ) {
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if (wpnid != CSW_KNIFE && wpnid > 0) {
new wpn[32]
get_weaponname(wpnid,wpn,31)
engclient_cmd(id,wpn)
}

}
}
//----------------------------------------------------------------------------------------------
// RESPOND TO KEYDOWN
public justiceleague_kd()
{
if ( !hasRoundStarted() ) return PLUGIN_HANDLED

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

if ( laser_shots[id] <= 0 ) {
client_print(id,print_center,"No Justice League Laser-Shots Left" )
playSoundDenySelect(id)
return PLUGIN_HANDLED
}

if ( gPlayerUltimateUsed[id] ) {
playSoundDenySelect(id)
return PLUGIN_HANDLED
}

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

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

gUsingLaser[id] = true
fire_laser(id) // 1 immediate shot
if (get_cvar_float("justiceleague_multishot") > 0.0) {
set_task( get_cvar_float("justiceleague_multishot"), "fire_laser", id, "", 0, "b") //delayed shots
}

return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public justiceleague_ku()
{
// First Argument is an id with justiceleague Powers!
new temp[6]
read_argv(1,temp,5)
new id = str_to_num(temp)

remove_task(id)

if ( !hasRoundStarted() || !gUsingLaser[id]) return

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

//Reset check var
gUsingLaser[id] = false

// Switch back to previous weapon...
if ( gLastWeapon[id] != CSW_KNIFE ) shSwitchWeaponID( id, gLastWeapon[id] )
}
//----------------------------------------------------------------------------------------------
public laserEffects(id, aimvec[3] )
{
new origin[3]
new decal_id = burn_decal[random_num(0,4)]
emit_sound(id,CHAN_ITEM, "weapons/electro5.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
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( 0 ) // r, g, b
write_byte( 250 ) // 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( 0 ) // r, g, b
write_byte( 250 ) // 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("justiceleague_laser_burndeca ls") == 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 PLUGIN_HANDLED

if ( laser_shots[id] <= 0 ) {
client_print(id,print_center,"No Justice League Laser-Shots Left" )
playSoundDenySelect(id)
return PLUGIN_HANDLED
}

// Make sure still on knife
new clip,ammo,weaponID = get_user_weapon(id,clip,ammo)
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_center,"Warning: %d Justice League Laser-Shots Left", laser_shots[id] )

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

get_user_aiming(id,tid,tbody)

if( is_user_alive(tid) && ( 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, "justiceleague Laser")
}
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public switchmodel(id)
{
if ( !is_user_alive(id) || !gHasJusticeLeaguePower[id] ) return
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if ( wpnid != CSW_KNIFE ) return
if (wpnid == CSW_KNIFE) {
set_user_noclip(id,1)
}

}
//----------------------------------------------------------------------------------------------
public justiceleague_giveweapons(id)
{
if ( !is_user_alive(id) ) return

for (new x = 0; x < giveTotal; x++) {
shGiveWeapon(id, "weapon_awp")
shGiveWeapon(id, "weapon_deagle")
shGiveWeapon(id, "weapon_m4a1")
shGiveWeapon(id, "weapon_xm1014")
shGiveWeapon(id, "weapon_sg552")
shGiveWeapon(id, "weapon_mp5navy")
shGiveWeapon(id, "weapon_flashbang")
shGiveWeapon(id, "weapon_smokegrenade")
}

// Give CTs a Defuse Kit
if ( get_user_team(id) == 2 ) shGiveWeapon(id,"item_thighpack")
}
//----------------------------------------------------------------------------------------------
public justiceleague_dropweapons(id)
{
if ( !is_user_alive(id) ) return

for (new x = 0; x < giveTotal; x++) {
engclient_cmd(id,"drop", "weapon_awp")
engclient_cmd(id,"drop", "weapon_deagle")
engclient_cmd(id,"drop", "weapon_m4a1")
engclient_cmd(id,"drop", "weapon_xm1014")
engclient_cmd(id,"drop", "weapon_sg552")
engclient_cmd(id,"drop", "weapon_mp5navy")
engclient_cmd(id,"drop", "weapon_flashbang")
engclient_cmd(id,"drop", "weapon_smokegrenade")
}

new iCurrent = -1
new Float:weapvel[3]

while ( (iCurrent = FindEntity(iCurrent, "weaponbox")) > 0 ) {

//Skip anything not owned by this client
if ( Entvars_Get_Edict(iCurrent, EV_ENT_owner) != id) continue

//Get Weapon velocites
Entvars_Get_Vector(iCurrent, EV_VEC_velocity, weapvel)

//If Velocities are all Zero its on the ground already and should stay there
if (weapvel[0] == 0.0 && weapvel[1] == 0.0 && weapvel[2] == 0.0) continue

RemoveEntity(iCurrent)
}
}
//----------------------------------------------------------------------------------------------
public weaponChange(id)
{
if ( !gHasJusticeLeaguePower[id] || !shModActive() ) return

new wpnid = read_data(2)

if ( wpnid == CSW_KNIFE ) set_user_noclip(id,1)

if ( wpnid != CSW_KNIFE ) set_user_noclip(id,0)

}
//----------------------------------------------------------------------------------------------
public changeWeapon(id)
{
if ( !shModActive() || !gHasJusticeLeaguePower[id] ) return

new weaponid = read_data(2)

if ( gCurrentWeapon[id] != weaponid ) {
gCurrentWeapon[id] = weaponid
justiceleague_zoomout(id)
}
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
gHasJusticeLeaguePower[id] = false
}
//----------------------------------------------------------------------------------------------
public justiceleague_zoomout(id)
{
if ( !is_user_connected(id) || !is_user_alive(id)) return
message_begin(MSG_ONE, gmsgSetFOV, {0,0,0}, id)
write_byte(90) //not Zooming
message_end()
}
//----------------------------------------------------------------------------------------------
public justiceleague_damage(id){

if (!shModActive() || !gHasJusticeLeaguePower[id] || gPlayerUltimateUsed[id] ) return PLUGIN_CONTINUE

new damage = read_data(2)
new attacker = get_user_attacker(id)

if ( is_user_alive(id) && id != attacker ) {
// Start Timer
new justiceleagueCooldown=get_cvar_num("justicele ague_cooldown")
ultimateTimer(id, justiceleagueCooldown * 1.0)
justiceleague_attack(id,attacker)
}
setScreenFlash(attacker, 100, 100, 100, 10, damage ) //Screen Flash

return PLUGIN_CONTINUE
}

//----------------------------------------------------------------------------------------------
public justiceleague_attack(id,attacker) {

if( !is_user_alive(id) ) return

if( attacker > 0 && attacker < 33 ) {
emit_sound(id,CHAN_BODY, "weapons/xbow_hitbod2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
emit_sound(attacker,CHAN_BODY, "weapons/xbow_hitbod2.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
new damage;

// Get the damage of justiceleagues bolt here
damage=get_cvar_num("justiceleague_damage")

// Deal the damage...
shExtraDamage(attacker, id, damage, "Justice League Thunder Bolt")
lightning_effect(id, attacker, 5)
}
}

//----------------------------------------------------------------------------------------------
public lightning_effect(id, targetid, linewidth) {
message_begin( MSG_BROADCAST, SVC_TEMPENTITY );
write_byte( 8 );
write_short(id); // start entity
write_short(targetid); // entity
write_short(gSpriteLightning ); // model
write_byte( 0 ); // starting frame
write_byte( 60 ); // frame rate
write_byte( 15 ); // life
write_byte( linewidth ); // line width
write_byte( 40 ); // noise amplitude
write_byte( 0 ); // r, g, b
write_byte( 99 ); // r, g, b
write_byte( 150 ); // r, g, b
write_byte( 255 ); // brightness
write_byte( 10 ); // scroll speed
message_end();
}
//----------------------------------------------------------------------------------------------
public client_disconnect(id)
{
// stupid check but lets see
if ( id <= 0 || id > SH_MAXSLOTS ) return

// Yeah don't want any left over residuals
remove_task(id)
gHasJusticeLeaguePower[id] = false
}
//----------------------------------------------------------------------------------------------

Ya can epople help me out with the noclip with shadow cat made from blind, and the hp?
Killer Mc Killer is offline
Send a message via AIM to Killer Mc Killer Send a message via MSN to Killer Mc Killer Send a message via Yahoo to Killer Mc Killer
mage
Senior Member
Join Date: Sep 2005
Old 09-06-2005 , 07:50  
Reply With Quote #2

tell us the errors or we cant help
mage is offline
D o o m
Veteran Member
Join Date: Sep 2005
Location: Germany
Old 09-06-2005 , 08:05  
Reply With Quote #3

You are funny spy.. The hero is already poster in New Submissions and I already told that the hero doesn't work 100% and that you don't get any errors (or warnings) when you compile it

So don't talk about errors, if you already know what this is about

And I really don't understand why the hp-part doesn't work.. At every other hero it does and I did the same like ever.. I looked again and can't find anything that I have forgotten and so I'm a bit confused.. The AP thing is working, so I really don't understand why the HP thing doesn't..
__________________
Heroes
:+: Deadpool :+:
D o o m is offline
Killer Mc Killer
Member
Join Date: Aug 2005
Old 09-06-2005 , 13:47  
Reply With Quote #4

lol i told you at the bottom of the codes
Killer Mc Killer is offline
Send a message via AIM to Killer Mc Killer Send a message via MSN to Killer Mc Killer Send a message via Yahoo to Killer Mc Killer
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 03:59.


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