Raised This Month: $ Target: $400
 0% 

Hero compile error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kennarn
Junior Member
Join Date: Sep 2009
Old 08-22-2010 , 00:38   Hero compile error
Reply With Quote #1

Hello!
I tried to compile my hero, which i made following Jelles tutorial, but i got 26 errors, all the same.

Code:
/home/groups/amxmodx/compiler3/core(0) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(3) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(4) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(6) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(7) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(8) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(9) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(10) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(11) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(12) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(13) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(14) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(15) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(17) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(18) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(19) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(20) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(21) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(22) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(23) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(24) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(25) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(26) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(27) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(28) : error 075: input line too long (after substitutions)
/home/groups/amxmodx/compiler3/core(29) : error 075: input line too long (after substitutions)

Compilation aborted.
26 Errors.
What does that errors means? I'm new to coding heroes, so i don't understand what is wrong.

Here is the .sma:
PHP Code:
#include<superheromod>

new gHeroID
new const gHeroName[] = "Golden Ak"
new const gGoldenAkWeapon[] = "models/shmod/goldenak_ak47.mdl")
new 
bool:gHasGoldenAkPower[SH_MAXSLOTS+1]

public 
plugin_init()
{
register_plugin("SUPERHERO Golden Ak""1.0""uprize/Kennarn")

new 
pcvarLevel register_cvar("goldenak_level""5")
new 
pcvarMult register_cvar("goldenak_ak47mult""1.4")

gHeroID sh_create_hero(gHeroNamepcvarLevel)

sh_set_hero_info(gHeroID"Golden Ak""Get a golden AK47 which does more damage")
}

sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_AK47)

register_event("CurWeapon, "weapon_change", "be", "1=1")


public sh_hero_init(id, heroID, mode)
{

if (gHeroID != heroID) return


switch(mode)
{

case SH_HERO_ADD:

gHasGoldenAkPower[id] = true
goldenak_weapon(id)
switch_model(id)
}

case SH_HERO_DROP:
{

gHasGoldenAkPower[id] = false
if (is_user_alive(id)
{
sh_drop_weapon(id, CSW_AK47, true)
}
}
}
}

public sh_client_spawn(id)
{
if (gHasGoldenAkPower[id])
{
goldenak_weapon(id)
{
if (shModActive() && is_user_alive(id) && gHasGoldenAkPower[id] )
{
sh_give_weapon(id, CSW_AK47)
}
}

public weapon_change(id)
{
if ( !sh_is_active() || !gHasGoldenAkPower[id] ) return

new weaponID = read_data(2)
if weaponID !=CSW_AK47) return

switch_model(id)

if (real_data(3) == 0)
{
sh_reload_ammo(id, 1)
}
}

switch_model(id)
{
if (!shModActive() || !is_user_alive(id) || !gHasGoldenAkPower[id] ) return

if (get_user_weapon(id) == CSW_AK47)
{
set_pev(id, pev_viewmodel2, gGoldenAkWeapon) 
EDIT: I see now that the whole .sma is wrong, but im not experienced so i don't know where the source is..

Last edited by Kennarn; 08-22-2010 at 00:40.
Kennarn is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 08-22-2010 , 06:40   Re: Hero compile error
Reply With Quote #2

4 closing brackets?..

Just ask me in steam and Ill help you.
__________________
The Art of War is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 08-22-2010 , 09:59   Re: Hero compile error
Reply With Quote #3

Change this:

PHP Code:
public plugin_init()
{
register_plugin("SUPERHERO Golden Ak""1.0""uprize/Kennarn")

new 
pcvarLevel register_cvar("goldenak_level""5")
new 
pcvarMult register_cvar("goldenak_ak47mult""1.4")

gHeroID sh_create_hero(gHeroNamepcvarLevel)

sh_set_hero_info(gHeroID"Golden Ak""Get a golden AK47 which does more damage")
}

sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_AK47)

register_event("CurWeapon, "weapon_change", "be", "1=1") 
to this:

PHP Code:
public plugin_init()
{
register_plugin("SUPERHERO Golden Ak""1.0""uprize/Kennarn")

new 
pcvarLevel register_cvar("goldenak_level""5")
new 
pcvarMult register_cvar("goldenak_ak47mult""1.4")

gHeroID sh_create_hero(gHeroNamepcvarLevel)

sh_set_hero_info(gHeroID"Golden Ak""Get a golden AK47 which does more damage")

sh_set_hero_dmgmult(gHeroIDpcvarMultCSW_AK47)

register_event("CurWeapon""weapon_change""be""1=1")

__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Kennarn
Junior Member
Join Date: Sep 2009
Old 08-22-2010 , 13:25   Re: Hero compile error
Reply With Quote #4

Well, i fixed that hero.
I found out that the "{" icons were on wrong places, and that was a result of using notepad, so i downloaded AMXX Studio

Also, I tried to change the swat hero from giving m4a1, knife, playermodel, ap and missile to only missile and ap, but it looks like i failed, because nothing happends when i hit "f" (binded +power1 key)

Could someone please try to make it for me?

Normal swat.sma file:
PHP Code:
// S.W.A.T!

/* CVARS - copy and paste to shconfig.cfg

//SWAT
swat_level 8
swat_armor 200  //how much armor swat has
swat_m4a1mult 1.5  //Damage multiplyer for his M4A1
swat_knifemult 4.0  //Damage multiplyer for his knife.
swat_damage 1000 //How much damage the rocket does.
swat_cooldown 30 //How long till he can use rocket again.
swat_radius 1000  //How powerful the blast is.


*/

#include <amxmod>
#include <Vexd_Utilities>
#include <superheromod>
#include <engine>

// GLOBAL VARIABLES
new gHeroName[]="Swat"
new bool:gHasSwatPower[SH_MAXSLOTS+1]
new 
explodeModellaserBeamringSprite
new entityCreated[33]
new 
bool:doesLaserExist false
new Float:playerPosition[33][3]
new 
Float:entityPosition[33][3]
new 
Float:distances[33]
new 
bool:is_a_swat[33]
new 
target[33//the attacker's target.
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Swat""1.0""Tassadarmaster / v2kEazyE / Batman/Gorlag")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
register_cvar("swat_level""8")
    
register_cvar("swat_armor""200")
    
register_cvar("swat_m4a1mult""1.5")
    
register_cvar("swat_knifemult""4.0")
    
register_cvar("swat_damage""1000")
    
register_cvar("swat_cooldown""30.0")
    
register_cvar("swat_radius""1000")

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
shCreateHero(gHeroName"Cool Colt""Stronger Colt with more armor."true"swat_level")

    
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    
register_srvcmd("swat_init""swat_init")
    
shRegHeroInit(gHeroName"swat_init")
    
register_srvcmd("swat_kd""swat_kd")
    
shRegKeyDown(gHeroName"swat_kd")

    
// EVENTS
    
register_event("ResetHUD""newSpawn","b")
    
register_event("CurWeapon""weaponChange""be""1=1")
    
register_event("Damage""swat_damage""b""2!0")
    
register_event("DeathMsg""swat_modelReset""a")

    
// Let Server know about Swat's Variable
    
shSetMaxHealth(gHeroName"swat_health")
    
shSetMaxArmor(gHeroName"swat_armor")
    
shSetShieldRestrict(gHeroName)

    
//Touch event
    
register_touch("guided_laser""*""laser_touch")

}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
precache_model("models/shmod/swat_v_m4a1.mdl")
    
precache_model("models/shmod/swat_p_m4a1.mdl")
    
precache_model("models/rpgrocket.mdl")
    
precache_model("models/player/swat/swat.mdl")
    
precache_model("models/shmod/swat_v_knife.mdl")
    
precache_model("models/shmod/swat_p_knife.mdl")
    
ringSprite precache_model("sprites/white.spr")
    
explodeModel precache_model("sprites/zerogxplode.spr")
    
laserBeam precache_model("sprites/smoke.spr")
    
precache_sound("weapons/egon_run3.wav")
    
precache_sound("weapons/egon_windup2.wav")
    
precache_sound("weapons/mortar.wav")
    
precache_sound("ambience/particle_suck2.wav")
}
//----------------------------------------------------------------------------------------------
public swat_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)

    if (!
is_user_connected(id)) return

    
//Reset thier shield restrict status
    //Shield restrict MUST be before weapons are given out
    
shResetShield(id)

    if ( 
is_user_alive(id) ) {
        if ( 
hasPowers ) {
            
swat_weapons(id)
            
switchmodel(id)
        }
    
//This gets run if they had the power but don't anymore
        
else if ( !hasPowers && gHasSwatPower[id] ) {
            
engclient_cmd(id"drop""weapon_m4a1")
            
shRemHealthPower(id)
            
shRemArmorPower(id)
            if(
is_a_swat[id]){
                
cs_reset_user_model(id)
                
is_a_swat[id] = false
            
}
        }
    }
    
//Sets this variable to the current status
    
gHasSwatPower[id] = (hasPowers != 0)
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
    
gPlayerUltimateUsed[id] = false
    
if ( shModActive() && gHasSwatPower[id] && is_user_alive(id) ) {
        
set_task(0.1"swat_weapons"id)

        new 
clipammowpnid get_user_weapon(idclipammo)
        if (
wpnid != CSW_M4A1 && wpnid 0) {
            new 
wpn[32]
            
get_weaponname(wpnidwpn31)
            
engclient_cmd(idwpn)
        }
    }
}
//----------------------------------------------------------------------------------------------
public swat_kd()
{
    
// First Argument is an id
    
new temp[6]
    
read_argv(1,temp,5)
    new 
id str_to_num(temp)

    if(!
is_user_alive(id) || !gHasSwatPower[id]) return
/*
    new entity, body;
    get_user_aiming(id, entity, body)

    if(is_valid_ent(entity)){
        new classname[41]
        entity_get_string(entity, EV_SZ_classname, classname, 40)
        client_print(id, print_chat, "The classname of the entity is %s", classname)
    }
*/ 
    
if(gPlayerUltimateUsed[id] || !hasRoundStarted()){
        
playSoundDenySelect(id)
        return
    }
    
fireBeam(id)
    if(
get_cvar_float("swat_cooldown") > 0.0)
        
ultimateTimer(idget_cvar_float("swat_cooldown"))
}
//-----------------------------------------------------------------------------------------------
public swat_weapons(id)
{
    if ( 
shModActive() && is_user_alive(id) ) {
        
shGiveWeapon(id,"weapon_m4a1")
        
shGiveWeapon(id,"weapon_knife")
        
shGiveWeapon(id,"item_thighpack")
        if(!
is_a_swat[id]){
            
cs_set_user_model(id"swat")
            
is_a_swat[id] = true
        
}
    }
}
//----------------------------------------------------------------------------------------------
public switchmodel(id)
{
    if ( !
is_user_alive(id) ) return

    new 
clipammowpnid get_user_weapon(idclipammo)
    if ( 
wpnid == CSW_M4A1 ) {
        
// Weapon Model change thanks to [CCC]Taz-Devil
        
Entvars_Set_String(idEV_SZ_viewmodel"models/shmod/swat_v_m4a1.mdl")
        
// Weapon Model change for 3rd person view - vittu
        
Entvars_Set_String(idEV_SZ_weaponmodel"models/shmod/swat_p_m4a1.mdl")
    }
    else if(
wpnid == CSW_KNIFE){
        
entity_set_string(idEV_SZ_viewmodel"models/shmod/swat_v_knife.mdl")
        
entity_set_string(idEV_SZ_weaponmodel"models/shmod/swat_p_knife.mdl")
    }
}
//----------------------------------------------------------------------------------------------
public weaponChange(id)
{
    if ( !
gHasSwatPower[id] || !shModActive() ) return

    new 
wpnid read_data(2)
    new 
clip read_data(3)

    if ( 
wpnid != CSW_M4A1 && wpnid != CSW_KNIFE) return

    
switchmodel(id)

    
// Never Run Out of Ammo!
    
if ( clip == ) {
        
shReloadAmmo(id)
    }
}
//----------------------------------------------------------------------------------------------
public swat_damage(id)
{
    if ( !
shModActive() || !is_user_alive(id) ) return

    new 
damage read_data(2)
    new 
weaponbodypartattacker get_user_attacker(idweaponbodypart)
    new 
headshot bodypart == 0

    
if ( attacker <= || attacker SH_MAXSLOTS ) return

    if ( 
gHasSwatPower[attacker] && weapon == CSW_M4A1 && is_user_alive(id) ) {
        
// do extra damage
        
new extraDamage floatround(damage get_cvar_float("swat_m4a1mult") - damage)
        if (
extraDamage 0shExtraDamage(idattackerextraDamage"m4a1"headshot)
    }

    else if(
gHasSwatPower[attacker] && weapon == CSW_KNIFE && is_user_alive(id) ){
        new 
extraDamage floatround(damage get_cvar_float("swat_knifemult") - damage)
        if(
extraDamage 0shExtraDamage(idattackerextraDamage"knife"headshot)
    }
}
//----------------------------------------------------------------------------------------------
public swat_modelReset()
{
    new 
id read_data(2)
    if(
is_a_swat[id]){
        
cs_reset_user_model(id)
        
is_a_swat[id] = false
    
}
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
    
gHasSwatPower[id] = false
    entityCreated
[id] = 0
    distances
[id] = 1000000.0
    target
[id] = 0
}
//----------------------------------------------------------------------------------------------
public client_PostThink(id)
{
    if(
doesLaserExist == true){
        if(
is_user_alive(id))
            
entity_get_vector(idEV_VEC_originplayerPosition[id])
        if(
is_valid_ent(entityCreated[id])){
            
entity_get_vector(entityCreated[id], EV_VEC_originentityPosition[id])
            new 
Float:distance 0.0
            
//this part might cause the server to lag, maybe
            
for(new counter 1counter 33counter++){
                if(
is_user_alive(counter) && get_user_team(id) != get_user_team(counter)){
                    
distance vector_distance(playerPosition[counter], entityPosition[id])
                    if(
distance == 0.0distance 1.0
                    
if(distance distances[id]){
                        
distances[id] = distance  //store the shortest distance
                        
target[id] = counter    //store the player to be targeted
                    
}
                }
            }
            
guideLaser(id)
        }
    }
}
//----------------------------------------------------------------------------------------------
public fireBeam(id)
{
    new 
beamHead create_entity("info_target")
    
entityCreated[id] = beamHead
    entity_set_string
(beamHeadEV_SZ_classname"guided_laser")
    
entity_set_edict(beamHeadEV_ENT_ownerid)
    new 
Float:origin[3], Float:offset[3], Float:angle[3]
    
entity_get_vector(idEV_VEC_originorigin)
    
entity_set_model(beamHead"models/rpgrocket.mdl")
    
entity_set_int(beamHeadEV_INT_effectsEF_LIGHT)
    
velocity_by_aim(id10offset)
    
origin[0] += offset[0]
    
origin[1] += offset[1]
    
origin[2] += offset[2]
    
entity_set_vector(beamHeadEV_VEC_originorigin)
    
entity_set_int(beamHeadEV_INT_movetypeMOVETYPE_FLY)
    
entity_set_int(beamHeadEV_INT_solidSOLID_BBOX)
    new 
Float:velocity[3]
    
velocity_by_aim(id1000velocity)
    
entity_set_vector(beamHeadEV_VEC_velocityvelocity)
    new 
Float:minBound[3] = {-8.0, -8.0, -8.0}, Float:maxBound[3] = {8.08.08.0}
    
entity_set_size(beamHeadminBoundmaxBound)
    
entity_get_vector(idEV_VEC_anglesangle)
    
entity_set_vector(beamHeadEV_VEC_anglesangle)

    
//Makes the trail effect
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(22)
    
write_short(beamHead)
    
write_short(laserBeam)
    
write_byte(200)  //makes the trail last a long time
    
write_byte(100)  //width of trail sprite
    
write_byte(255)  //red
    
write_byte(0)  //green
    
write_byte(0)    //blue
    
write_byte(255)  //Makes the trail really bright
    
message_end()

    
doesLaserExist true

    emit_sound
(beamHeadCHAN_STATIC"weapons/egon_run3.wav"1.0ATTN_NORM0PITCH_NORM)
    
emit_sound(idCHAN_STATIC"weapons/egon_windup2.wav"1.0ATTN_NORM0PITCH_NORM)
}
//----------------------------------------------------------------------------------------------
public laser_touch(pToucherpTouched)
{
    if(!
is_valid_ent(pToucher)) return PLUGIN_HANDLED
    explode
(pToucher)

    return 
PLUGIN_CONTINUE
}
//-----------------------------------------------------------------------------------------------
public explode(pToucher)
{
    new 
attacker entity_get_edict(pToucherEV_ENT_owner)
    new 
Float:missileVelocity[3]
    
entity_get_vector(pToucherEV_VEC_velocitymissileVelocity)

    new 
Float:origin[3]
    new 
notFloat[3]
    
entity_get_vector(pToucherEV_VEC_originorigin)
    
FVecIVec(originnotFloat)

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(3)  //EXPLOSION
    
write_coord(notFloat[0])
    
write_coord(notFloat[1])
    
write_coord(notFloat[2])
    
write_short(explodeModel)
    
write_byte(255//Make the sprite big
    
write_byte(20)  //explosion should run at 20 frames per second
    
write_byte(0)  //default half-life explosion
    
message_end()

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY//message begin 
    
write_byte(21
    
write_coord(notFloat[0]) // center position 
    
write_coord(notFloat[1]) 
    
write_coord(notFloat[2]) 
    
write_coord(notFloat[0]) // axis and radius 
    
write_coord(notFloat[1]) 
    
write_coord(notFloat[2] + 1000
    
write_short(ringSprite// sprite index 
    
write_byte(0// starting frame 
    
write_byte(1// frame rate in 0.1's 
    
write_byte(50// life in 0.1's 
    
write_byte(8// line width in 0.1's 
    
write_byte(10// noise amplitude in 0.01's 
    
write_byte(255//colour 
    
write_byte(0
    
write_byte(0
    
write_byte(255// brightness 
    
write_byte(0// scroll speed in 0.1's 
    
message_end() 


    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(14)
    
write_coord(notFloat[0])
    
write_coord(notFloat[1])
    
write_coord(notFloat[2])
    
write_byte(255)
    
write_byte(30)
    
write_byte(50)
    
message_end()



    new const 
SOUND_STOP = (<< 5)
    
emit_sound(pToucherCHAN_STATIC"weapons/egon_run3.wav"1.0ATTN_NORMSOUND_STOPPITCH_NORM)
    
emit_sound(attackerCHAN_STATIC"weapons/egon_windup2.wav"1.0ATTN_NORMSOUND_STOPPITCH_NORM
    
emit_sound(pToucherCHAN_AUTO"weapons/mortar.wav"1.0ATTN_NORM0PITCH_NORM)
    
emit_sound(pToucherCHAN_VOICE"ambience/particle_suck2.wav"1.0ATTN_NORM0PITCH_NORM)



    
remove_entity(pToucher)
    
entityCreated[attacker] = 0
    
for(new counter 0counter 33counter++){
        if(
entityCreated[counter] == 0){
            
doesLaserExist false
        
}
        else{
            
doesLaserExist true
            
break
        }
    }



    
//Thanks to the code from Goten
    
new FFOn get_cvar_num("mp_friendlyfire")
    new 
damageRadius get_cvar_num("swat_radius")
    new 
damageFloat:damageRatio
    
for(new vic 1vic 33vic++){
        if(
is_user_alive(vic) && (get_user_team(attacker) != get_user_team(vic) || FFOn || vic == attacker)){
            new 
uOrigin[3]
            
get_user_origin(vicuOrigin0)
            new 
distance get_distance(notFloatuOrigin)
            if(
distance damageRadius){
                
damageRatio float(distance)/float(damageRadius)
                
damage get_cvar_num("swat_damage") - floatround(get_cvar_num("swat_damage") * damageRatio)
                if(
vic == attackerdamage floatround(damage/2.0)
                
shExtraDamage(vicattackerdamage"Swat's laser-guided blast")
                
sh_screenShake(vic10050100)
                
sh_setScreenFlash(vic2550010050)
                new 
Float:forceFactor[3]
                if(
distance 5){
                    
forceFactor[0] = missileVelocity[0] * 2.0  
                    forceFactor
[1] = missileVelocity[1] * 2.0
                    forceFactor
[2] = (missileVelocity[2] * 2.0) + 700.0
                    entity_set_vector
(vicEV_VEC_velocityforceFactor)
                }
                else{
                    
forceFactor[0] = (uOrigin[0] - notFloat[0])/distance 700.0
                    forceFactor
[1] = (uOrigin[1] - notFloat[1])/distance 700.0
                    forceFactor
[2] = 500.0
                    entity_set_vector
(vicEV_VEC_velocityforceFactor)
                }
            }
        }
    }

    new 
breakable find_ent_by_class(-1"func_breakable")
    new 
bool:hasBeenFound[1200]
    new 
Float:brushOrigin[3], Float:min[3], Float:max[3]
    while(
breakable != && hasBeenFound[breakable] == false){
        
//Where the brush is, and the actual entity is
        //is not the same, tested it.
        
entity_get_vector(breakableEV_VEC_minsmin)
        
entity_get_vector(breakableEV_VEC_maxsmax)
        
brushOrigin[0] = (min[0] + max[0])/2
        brushOrigin
[1] = (min[1] + max[1])/2
        brushOrigin
[2] = (min[2] + max[2])/2  
        
new Float:distance vector_distance(originbrushOrigin)
        if(
distance float(damageRadius)){
            
//debugging here;)
            
new classname[71], Float:healthFloat:takeDamage
            entity_get_string
(breakableEV_SZ_classnameclassname70)
            
takeDamage entity_get_float(breakableEV_FL_takedamage)
            
health entity_get_float(breakableEV_FL_health)

            if(
health 0.0){
                if(
takeDamage 1.0)
                    
entity_set_float(breakableEV_FL_takedamage1.0)
                new 
hurt_trigger create_entity("trigger_hurt")
                
entity_set_float(hurt_triggerEV_FL_dmg2000.0)
                
DispatchSpawn(hurt_trigger)
                
fake_touch(hurt_triggerbreakable)
                
remove_entity(hurt_trigger)
                if(
entity_get_float(breakableEV_FL_health) <= 0.0)
                    
entity_set_float(breakableEV_FL_takedamage0.0)
            }
        }
        
hasBeenFound[breakable] = true
        breakable 
find_ent_by_class(breakable"func_breakable")
    }

    new 
weapon find_ent_by_class(-1"weaponbox")
    while(
weapon != && hasBeenFound[weapon] == false){
        new 
Float:weaponOrigin[3], Float:distance
        entity_get_vector
(weaponEV_VEC_originweaponOrigin)
        
distance vector_distance(originweaponOrigin)
        if(
distance float(damageRadius)){
            new 
Float:forceFactor[3]
            
forceFactor[0] = (weaponOrigin[0] - origin[0])/distance 700.0
            forceFactor
[1] = (weaponOrigin[1] - origin[1])/distance 700.0
            forceFactor
[2] = 500.0
            entity_set_vector
(weaponEV_VEC_velocityforceFactor)
        }
        
hasBeenFound[weapon] = true
        weapon 
find_ent_by_class(weapon"weaponbox")
    }

    
hurt_monster(origin"monster_alien_controller"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_alien_grunt"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_alien_slave"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_apache"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_babycrab"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_barnacle"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_barney"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_bigmomma"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_bloater"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_bullchicken"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_cockroach"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_flyer_flock"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_gargantua"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_gman"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_headcrab"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_houndeye"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_human_assassin"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_human_grunt"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_ichthyosaur"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_leech"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_nihilanth"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_scientist"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_snark"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_tentacle"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_zombie"damageRadiushasBeenFound)
    
hurt_monster(origin"hostage_entity"damageRadiushasBeenFound)
    
hurt_monster(origin"bazooka_missile_ent"damageRadiushasBeenFound)
    
hurt_monster(origin"demoman_tripmines"damageRadiushasBeenFound)



    
target[attacker] = 0
    distances
[attacker] = 1000000.0
}
//---------------------------------------------------------------------------
public guideLaser(id)
{
    new 
targets target[id]
    new 
Float:distance distances[id]
    if(
distance == 1000000.0) return
    new 
Float:lengthComponent[3]
    
lengthComponent[0] = playerPosition[targets][0] - entityPosition[id][0]
    
lengthComponent[1] = playerPosition[targets][1] - entityPosition[id][1]
    
lengthComponent[2] = playerPosition[targets][2] - entityPosition[id][2]
    new 
Float:velocity[3]
    
velocity[0] = lengthComponent[0]/distance 1000.0
    velocity
[1] = lengthComponent[1]/distance 1000.0
    velocity
[2] = lengthComponent[2]/distance 1000.0
    
//Let's change the angle of the model as well
    
lengthComponent[0] /= distance
    lengthComponent
[1] /= distance
    lengthComponent
[2] /= distance
    
new Float:angleOffset[3]
    
vector_to_angle(lengthComponentangleOffset)
    
entity_set_vector(entityCreated[id], EV_VEC_anglesangleOffset)
    
entity_set_vector(entityCreated[id], EV_VEC_velocityvelocity)
}
//----------------------------------------------------------------------------
public hurt_monster(Float:blastOrigin[3], monsterClassname[], damageRadiusbool:hasBeenFound[])
{
    new 
monster find_ent_by_class(-1monsterClassname)
    new 
Float:monsterOrigin[3], Float:distance
    
while(monster != && hasBeenFound[monster] == false){
        
entity_get_vector(monsterEV_VEC_originmonsterOrigin)
        
distance vector_distance(blastOriginmonsterOrigin)
        if(
distance float(damageRadius)){
            if(
entity_get_float(monsterEV_FL_health) > 0.0){
                if(
entity_get_float(monsterEV_FL_takedamage) < 1.0)
                    
entity_set_float(monsterEV_FL_takedamage1.0)
                new 
hurt_trigger create_entity("trigger_hurt")
                if(
equal(monsterClassname"bazooka_missile_ent")){
                    
entity_set_float(hurt_triggerEV_FL_dmg30000.0)  //Make sure it can kill the rocket
                
}
                else{
                    
entity_set_float(hurt_triggerEV_FL_dmg2000.0)
                }
                
DispatchSpawn(hurt_trigger)
                
fake_touch(hurt_triggermonster)
                
remove_entity(hurt_trigger)
                new 
Float:forceFactor[3]
                
forceFactor[0] = (monsterOrigin[0] - blastOrigin[0])/distance 700.0
                forceFactor
[1] = (monsterOrigin[1] - blastOrigin[1])/distance 700.0
                forceFactor
[2] = 700.0
                entity_set_vector
(monsterEV_VEC_velocityforceFactor)
                if(
entity_get_float(monsterEV_FL_health) <= 0.0)
                    
entity_set_float(monsterEV_FL_takedamage0.0)
            }
        }
        
hasBeenFound[monster] = true
        monster 
find_ent_by_class(monstermonsterClassname)
    }
}
//------------------------------------------------------------------------------------
/*public smartGuide(id, obstruction[3])
{
    new Float:angle[3], Float:velocity[3], Float:temp[3], Float:offset[3]
    entity_get_vector(entityCreated[id], EV_VEC_angles, angle)
    temp[0] = angle[0]
    temp[1] = angle[1]
    temp[2] = angle[2]
    for(; (temp[1] < angle[1] + 360); temp[1] += 10){
        offset[0] = floatcos(temp[1], degrees) * (200)
        offset[1] = floatsin(temp[1], degrees) * (200)
        offset[2] = floatcos(temp[0] + 90, degrees) * (200)
        trace_line(entityCreated[id], entityPosition[id], offset, obstruction)
        if(offset[2] != obstruction[2]){
            temp[0] += 10
        }
        if(vector_distance(entityPosition[id], obstruction) == 200.0){
            velocity[0] = offset[0]/200 * 1000
            velocity[1] = offset[1]/200 * 1000
            velocity[2] = offset[2]/200 * 1000
            entity_set_vector(entityCreated[id], EV_VEC_velocity, velocity)
            entity_set_vector(entityCreated[id], EV_VEC_angles, temp)
*/ 
My swat .sma file (which i tried to edit):
PHP Code:
// S.W.A.T!

/* CVARS - copy and paste to shconfig.cfg

//SWAT
swat_level 8
swat_armor 200  //how much armor swat has
swat_m4a1mult 1.5  //Damage multiplyer for his M4A1
swat_knifemult 4.0  //Damage multiplyer for his knife.
swat_damage 1000 //How much damage the rocket does.
swat_cooldown 30 //How long till he can use rocket again.
swat_radius 1000  //How powerful the blast is.


*/

#include <amxmod>
#include <Vexd_Utilities>
#include <superheromod>
#include <engine>

// GLOBAL VARIABLES
new gHeroName[]="Swat"
new bool:gHasSwatPower[SH_MAXSLOTS+1]
new 
explodeModellaserBeamringSprite
new entityCreated[33]
new 
bool:doesLaserExist false
new Float:playerPosition[33][3]
new 
Float:entityPosition[33][3]
new 
Float:distances[33]
new 
bool:is_a_swat[33]
new 
target[33//the attacker's target.
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Swat""1.0""Tassadarmaster / v2kEazyE / Batman/Gorlag")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
register_cvar("swat_level""8")
    
register_cvar("swat_armor""200")
    
register_cvar("swat_damage""1000")
    
register_cvar("swat_cooldown""30.0")
    
register_cvar("swat_radius""1000")

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
shCreateHero(gHeroName"Cool Colt""Stronger Colt with more armor."true"swat_level")

    
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    
register_srvcmd("swat_init""swat_init")
    
shRegHeroInit(gHeroName"swat_init")
    
register_srvcmd("swat_kd""swat_kd")
    
shRegKeyDown(gHeroName"swat_kd")

    
// EVENTS
    
register_event("DeathMsg""swat_modelReset""a")

    
// Let Server know about Swat's Variable
    
shSetMaxHealth(gHeroName"swat_health")
    
shSetMaxArmor(gHeroName"swat_armor")
    
shSetShieldRestrict(gHeroName)

    
//Touch event
    
register_touch("guided_laser""*""laser_touch")

}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{

    
precache_model("models/rpgrocket.mdl")
    
ringSprite precache_model("sprites/white.spr")
    
explodeModel precache_model("sprites/zerogxplode.spr")
    
laserBeam precache_model("sprites/smoke.spr")
    
precache_sound("weapons/egon_run3.wav")
    
precache_sound("weapons/egon_windup2.wav")
    
precache_sound("weapons/mortar.wav")
    
precache_sound("ambience/particle_suck2.wav")
}
//----------------------------------------------------------------------------------------------
public swat_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)

    if (!
is_user_connected(id)) return

    
//Reset thier shield restrict status
    //Shield restrict MUST be before weapons are given out
    
shResetShield(id)

    if ( 
is_user_alive(id) ) 
    {
        if ( 
hasPowers ) return
    
//This gets run if they had the power but don't anymore
        
else if ( !hasPowers && gHasSwatPower[id] ) 
        {
            
shRemHealthPower(id)
            
shRemArmorPower(id)
            if(
is_a_swat[id])
            {
                
is_a_swat[id] = false
            
}
        }
    }
    
//Sets this variable to the current status
    
gHasSwatPower[id] = (hasPowers != 0)
}
//----------------------------------------------------------------------------------------------
public swat_kd()
{
    
// First Argument is an id
    
new temp[6]
    
read_argv(1,temp,5)
    new 
id str_to_num(temp)

    if(!
is_user_alive(id) || !gHasSwatPower[id]) return
/*
    new entity, body;
    get_user_aiming(id, entity, body)

    if(is_valid_ent(entity)){
        new classname[41]
        entity_get_string(entity, EV_SZ_classname, classname, 40)
        client_print(id, print_chat, "The classname of the entity is %s", classname)
    }
*/ 
    
if(gPlayerUltimateUsed[id] || !hasRoundStarted()){
        
playSoundDenySelect(id)
        return
    }
    
fireBeam(id)
    if(
get_cvar_float("swat_cooldown") > 0.0)
        
ultimateTimer(idget_cvar_float("swat_cooldown"))
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
    
gHasSwatPower[id] = false
    entityCreated
[id] = 0
    distances
[id] = 1000000.0
    target
[id] = 0
}
//----------------------------------------------------------------------------------------------
public client_PostThink(id)
{
    if(
doesLaserExist == true){
        if(
is_user_alive(id))
            
entity_get_vector(idEV_VEC_originplayerPosition[id])
        if(
is_valid_ent(entityCreated[id])){
            
entity_get_vector(entityCreated[id], EV_VEC_originentityPosition[id])
            new 
Float:distance 0.0
            
//this part might cause the server to lag, maybe
            
for(new counter 1counter 33counter++){
                if(
is_user_alive(counter) && get_user_team(id) != get_user_team(counter)){
                    
distance vector_distance(playerPosition[counter], entityPosition[id])
                    if(
distance == 0.0distance 1.0
                    
if(distance distances[id]){
                        
distances[id] = distance  //store the shortest distance
                        
target[id] = counter    //store the player to be targeted
                    
}
                }
            }
            
guideLaser(id)
        }
    }
}
//----------------------------------------------------------------------------------------------
public fireBeam(id)
{
    new 
beamHead create_entity("info_target")
    
entityCreated[id] = beamHead
    entity_set_string
(beamHeadEV_SZ_classname"guided_laser")
    
entity_set_edict(beamHeadEV_ENT_ownerid)
    new 
Float:origin[3], Float:offset[3], Float:angle[3]
    
entity_get_vector(idEV_VEC_originorigin)
    
entity_set_model(beamHead"models/rpgrocket.mdl")
    
entity_set_int(beamHeadEV_INT_effectsEF_LIGHT)
    
velocity_by_aim(id10offset)
    
origin[0] += offset[0]
    
origin[1] += offset[1]
    
origin[2] += offset[2]
    
entity_set_vector(beamHeadEV_VEC_originorigin)
    
entity_set_int(beamHeadEV_INT_movetypeMOVETYPE_FLY)
    
entity_set_int(beamHeadEV_INT_solidSOLID_BBOX)
    new 
Float:velocity[3]
    
velocity_by_aim(id1000velocity)
    
entity_set_vector(beamHeadEV_VEC_velocityvelocity)
    new 
Float:minBound[3] = {-8.0, -8.0, -8.0}, Float:maxBound[3] = {8.08.08.0}
    
entity_set_size(beamHeadminBoundmaxBound)
    
entity_get_vector(idEV_VEC_anglesangle)
    
entity_set_vector(beamHeadEV_VEC_anglesangle)

    
//Makes the trail effect
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(22)
    
write_short(beamHead)
    
write_short(laserBeam)
    
write_byte(200)  //makes the trail last a long time
    
write_byte(100)  //width of trail sprite
    
write_byte(255)  //red
    
write_byte(0)  //green
    
write_byte(0)    //blue
    
write_byte(255)  //Makes the trail really bright
    
message_end()

    
doesLaserExist true

    emit_sound
(beamHeadCHAN_STATIC"weapons/egon_run3.wav"1.0ATTN_NORM0PITCH_NORM)
    
emit_sound(idCHAN_STATIC"weapons/egon_windup2.wav"1.0ATTN_NORM0PITCH_NORM)
}
//----------------------------------------------------------------------------------------------
public laser_touch(pToucherpTouched)
{
    if(!
is_valid_ent(pToucher)) return PLUGIN_HANDLED
    explode
(pToucher)

    return 
PLUGIN_CONTINUE
}
//-----------------------------------------------------------------------------------------------
public explode(pToucher)
{
    new 
attacker entity_get_edict(pToucherEV_ENT_owner)
    new 
Float:missileVelocity[3]
    
entity_get_vector(pToucherEV_VEC_velocitymissileVelocity)

    new 
Float:origin[3]
    new 
notFloat[3]
    
entity_get_vector(pToucherEV_VEC_originorigin)
    
FVecIVec(originnotFloat)

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(3)  //EXPLOSION
    
write_coord(notFloat[0])
    
write_coord(notFloat[1])
    
write_coord(notFloat[2])
    
write_short(explodeModel)
    
write_byte(255//Make the sprite big
    
write_byte(20)  //explosion should run at 20 frames per second
    
write_byte(0)  //default half-life explosion
    
message_end()

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY//message begin 
    
write_byte(21
    
write_coord(notFloat[0]) // center position 
    
write_coord(notFloat[1]) 
    
write_coord(notFloat[2]) 
    
write_coord(notFloat[0]) // axis and radius 
    
write_coord(notFloat[1]) 
    
write_coord(notFloat[2] + 1000
    
write_short(ringSprite// sprite index 
    
write_byte(0// starting frame 
    
write_byte(1// frame rate in 0.1's 
    
write_byte(50// life in 0.1's 
    
write_byte(8// line width in 0.1's 
    
write_byte(10// noise amplitude in 0.01's 
    
write_byte(255//colour 
    
write_byte(0
    
write_byte(0
    
write_byte(255// brightness 
    
write_byte(0// scroll speed in 0.1's 
    
message_end() 


    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(14)
    
write_coord(notFloat[0])
    
write_coord(notFloat[1])
    
write_coord(notFloat[2])
    
write_byte(255)
    
write_byte(30)
    
write_byte(50)
    
message_end()



    new const 
SOUND_STOP = (<< 5)
    
emit_sound(pToucherCHAN_STATIC"weapons/egon_run3.wav"1.0ATTN_NORMSOUND_STOPPITCH_NORM)
    
emit_sound(attackerCHAN_STATIC"weapons/egon_windup2.wav"1.0ATTN_NORMSOUND_STOPPITCH_NORM
    
emit_sound(pToucherCHAN_AUTO"weapons/mortar.wav"1.0ATTN_NORM0PITCH_NORM)
    
emit_sound(pToucherCHAN_VOICE"ambience/particle_suck2.wav"1.0ATTN_NORM0PITCH_NORM)



    
remove_entity(pToucher)
    
entityCreated[attacker] = 0
    
for(new counter 0counter 33counter++){
        if(
entityCreated[counter] == 0){
            
doesLaserExist false
        
}
        else{
            
doesLaserExist true
            
break
        }
    }



    
//Thanks to the code from Goten
    
new FFOn get_cvar_num("mp_friendlyfire")
    new 
damageRadius get_cvar_num("swat_radius")
    new 
damageFloat:damageRatio
    
for(new vic 1vic 33vic++){
        if(
is_user_alive(vic) && (get_user_team(attacker) != get_user_team(vic) || FFOn || vic == attacker)){
            new 
uOrigin[3]
            
get_user_origin(vicuOrigin0)
            new 
distance get_distance(notFloatuOrigin)
            if(
distance damageRadius){
                
damageRatio float(distance)/float(damageRadius)
                
damage get_cvar_num("swat_damage") - floatround(get_cvar_num("swat_damage") * damageRatio)
                if(
vic == attackerdamage floatround(damage/2.0)
                
shExtraDamage(vicattackerdamage"Swat's laser-guided blast")
                
sh_screenShake(vic10050100)
                
sh_setScreenFlash(vic2550010050)
                new 
Float:forceFactor[3]
                if(
distance 5){
                    
forceFactor[0] = missileVelocity[0] * 2.0  
                    forceFactor
[1] = missileVelocity[1] * 2.0
                    forceFactor
[2] = (missileVelocity[2] * 2.0) + 700.0
                    entity_set_vector
(vicEV_VEC_velocityforceFactor)
                }
                else{
                    
forceFactor[0] = (uOrigin[0] - notFloat[0])/distance 700.0
                    forceFactor
[1] = (uOrigin[1] - notFloat[1])/distance 700.0
                    forceFactor
[2] = 500.0
                    entity_set_vector
(vicEV_VEC_velocityforceFactor)
                }
            }
        }
    }

    new 
breakable find_ent_by_class(-1"func_breakable")
    new 
bool:hasBeenFound[1200]
    new 
Float:brushOrigin[3], Float:min[3], Float:max[3]
    while(
breakable != && hasBeenFound[breakable] == false){
        
//Where the brush is, and the actual entity is
        //is not the same, tested it.
        
entity_get_vector(breakableEV_VEC_minsmin)
        
entity_get_vector(breakableEV_VEC_maxsmax)
        
brushOrigin[0] = (min[0] + max[0])/2
        brushOrigin
[1] = (min[1] + max[1])/2
        brushOrigin
[2] = (min[2] + max[2])/2  
        
new Float:distance vector_distance(originbrushOrigin)
        if(
distance float(damageRadius)){
            
//debugging here;)
            
new classname[71], Float:healthFloat:takeDamage
            entity_get_string
(breakableEV_SZ_classnameclassname70)
            
takeDamage entity_get_float(breakableEV_FL_takedamage)
            
health entity_get_float(breakableEV_FL_health)

            if(
health 0.0){
                if(
takeDamage 1.0)
                    
entity_set_float(breakableEV_FL_takedamage1.0)
                new 
hurt_trigger create_entity("trigger_hurt")
                
entity_set_float(hurt_triggerEV_FL_dmg2000.0)
                
DispatchSpawn(hurt_trigger)
                
fake_touch(hurt_triggerbreakable)
                
remove_entity(hurt_trigger)
                if(
entity_get_float(breakableEV_FL_health) <= 0.0)
                    
entity_set_float(breakableEV_FL_takedamage0.0)
            }
        }
        
hasBeenFound[breakable] = true
        breakable 
find_ent_by_class(breakable"func_breakable")
    }

    new 
weapon find_ent_by_class(-1"weaponbox")
    while(
weapon != && hasBeenFound[weapon] == false){
        new 
Float:weaponOrigin[3], Float:distance
        entity_get_vector
(weaponEV_VEC_originweaponOrigin)
        
distance vector_distance(originweaponOrigin)
        if(
distance float(damageRadius)){
            new 
Float:forceFactor[3]
            
forceFactor[0] = (weaponOrigin[0] - origin[0])/distance 700.0
            forceFactor
[1] = (weaponOrigin[1] - origin[1])/distance 700.0
            forceFactor
[2] = 500.0
            entity_set_vector
(weaponEV_VEC_velocityforceFactor)
        }
        
hasBeenFound[weapon] = true
        weapon 
find_ent_by_class(weapon"weaponbox")
    }

    
hurt_monster(origin"monster_alien_controller"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_alien_grunt"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_alien_slave"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_apache"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_babycrab"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_barnacle"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_barney"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_bigmomma"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_bloater"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_bullchicken"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_cockroach"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_flyer_flock"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_gargantua"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_gman"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_headcrab"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_houndeye"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_human_assassin"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_human_grunt"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_ichthyosaur"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_leech"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_nihilanth"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_scientist"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_snark"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_tentacle"damageRadiushasBeenFound)
    
hurt_monster(origin"monster_zombie"damageRadiushasBeenFound)
    
hurt_monster(origin"hostage_entity"damageRadiushasBeenFound)
    
hurt_monster(origin"bazooka_missile_ent"damageRadiushasBeenFound)
    
hurt_monster(origin"demoman_tripmines"damageRadiushasBeenFound)



    
target[attacker] = 0
    distances
[attacker] = 1000000.0
}
//---------------------------------------------------------------------------
public guideLaser(id)
{
    new 
targets target[id]
    new 
Float:distance distances[id]
    if(
distance == 1000000.0) return
    new 
Float:lengthComponent[3]
    
lengthComponent[0] = playerPosition[targets][0] - entityPosition[id][0]
    
lengthComponent[1] = playerPosition[targets][1] - entityPosition[id][1]
    
lengthComponent[2] = playerPosition[targets][2] - entityPosition[id][2]
    new 
Float:velocity[3]
    
velocity[0] = lengthComponent[0]/distance 1000.0
    velocity
[1] = lengthComponent[1]/distance 1000.0
    velocity
[2] = lengthComponent[2]/distance 1000.0
    
//Let's change the angle of the model as well
    
lengthComponent[0] /= distance
    lengthComponent
[1] /= distance
    lengthComponent
[2] /= distance
    
new Float:angleOffset[3]
    
vector_to_angle(lengthComponentangleOffset)
    
entity_set_vector(entityCreated[id], EV_VEC_anglesangleOffset)
    
entity_set_vector(entityCreated[id], EV_VEC_velocityvelocity)
}
//----------------------------------------------------------------------------
public hurt_monster(Float:blastOrigin[3], monsterClassname[], damageRadiusbool:hasBeenFound[])
{
    new 
monster find_ent_by_class(-1monsterClassname)
    new 
Float:monsterOrigin[3], Float:distance
    
while(monster != && hasBeenFound[monster] == false){
        
entity_get_vector(monsterEV_VEC_originmonsterOrigin)
        
distance vector_distance(blastOriginmonsterOrigin)
        if(
distance float(damageRadius)){
            if(
entity_get_float(monsterEV_FL_health) > 0.0){
                if(
entity_get_float(monsterEV_FL_takedamage) < 1.0)
                    
entity_set_float(monsterEV_FL_takedamage1.0)
                new 
hurt_trigger create_entity("trigger_hurt")
                if(
equal(monsterClassname"bazooka_missile_ent")){
                    
entity_set_float(hurt_triggerEV_FL_dmg30000.0)  //Make sure it can kill the rocket
                
}
                else{
                    
entity_set_float(hurt_triggerEV_FL_dmg2000.0)
                }
                
DispatchSpawn(hurt_trigger)
                
fake_touch(hurt_triggermonster)
                
remove_entity(hurt_trigger)
                new 
Float:forceFactor[3]
                
forceFactor[0] = (monsterOrigin[0] - blastOrigin[0])/distance 700.0
                forceFactor
[1] = (monsterOrigin[1] - blastOrigin[1])/distance 700.0
                forceFactor
[2] = 700.0
                entity_set_vector
(monsterEV_VEC_velocityforceFactor)
                if(
entity_get_float(monsterEV_FL_health) <= 0.0)
                    
entity_set_float(monsterEV_FL_takedamage0.0)
            }
        }
        
hasBeenFound[monster] = true
        monster 
find_ent_by_class(monstermonsterClassname)
    }
}
//------------------------------------------------------------------------------------
/*public smartGuide(id, obstruction[3])
{
    new Float:angle[3], Float:velocity[3], Float:temp[3], Float:offset[3]
    entity_get_vector(entityCreated[id], EV_VEC_angles, angle)
    temp[0] = angle[0]
    temp[1] = angle[1]
    temp[2] = angle[2]
    for(; (temp[1] < angle[1] + 360); temp[1] += 10){
        offset[0] = floatcos(temp[1], degrees) * (200)
        offset[1] = floatsin(temp[1], degrees) * (200)
        offset[2] = floatcos(temp[0] + 90, degrees) * (200)
        trace_line(entityCreated[id], entityPosition[id], offset, obstruction)
        if(offset[2] != obstruction[2]){
            temp[0] += 10
        }
        if(vector_distance(entityPosition[id], obstruction) == 200.0){
            velocity[0] = offset[0]/200 * 1000
            velocity[1] = offset[1]/200 * 1000
            velocity[2] = offset[2]/200 * 1000
            entity_set_vector(entityCreated[id], EV_VEC_velocity, velocity)
            entity_set_vector(entityCreated[id], EV_VEC_angles, temp)
*/ 

Last edited by Kennarn; 08-22-2010 at 13:30.
Kennarn is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 08-22-2010 , 14:28   Re: Hero compile error
Reply With Quote #5

Please, please, try to use indentation. Makes it so much easier to read your code.
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
Kennarn
Junior Member
Join Date: Sep 2009
Old 08-22-2010 , 14:41   Re: Hero compile error
Reply With Quote #6

indentation? don't understand what you means. give me an example?
Kennarn is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 08-23-2010 , 10:58   Re: Hero compile error
Reply With Quote #7

Quote:
Originally Posted by Exploited View Post
Please, please, try to use indentation. Makes it so much easier to read your code.
Said the pro of scripting

Quote:
Originally Posted by Kennarn View Post
indentation? don't understand what you means. give me an example?
Use TAB
__________________
The Art of War is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 08-23-2010 , 12:17   Re: Hero compile error
Reply With Quote #8

Where did I say I was any good at scripting?
Since when can only pros give suggestions on how to make the code easier to read, especially if the suggestions is pretty basic?
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
The Art of War
Veteran Member
Join Date: Dec 2009
Location: Sweden Rock Festival
Old 08-23-2010 , 13:48   Re: Hero compile error
Reply With Quote #9

Quote:
Originally Posted by Exploited View Post
Where did I say I was any good at scripting?
Since when can only pros give suggestions on how to make the code easier to read, especially if the suggestions is pretty basic?
No no mate, I didnt wanted to offend you or something, just that the "Please, please" made it sound a bit like Jelle or Fr33

Indeed I am not a pro either but I am probably better then you (again, no offense, Ive been doing it for a longer time). So, bottom line, no offense.
__________________
The Art of War is offline
Exploited
Veteran Member
Join Date: Jul 2010
Location: Sweden
Old 08-23-2010 , 14:06   Re: Hero compile error
Reply With Quote #10

Don't worry about that, I don't really get offended when people point out that I suck on something that I actually do suck at ^^
__________________
Jelle (1): I LOVE YOU
Jelle (1): Yeah. omg you are so awesome!
--------------
Jelle (1): You know when a poo is about to exit but it is too big?
Jelle (1): God my ass still hurts
Exploited is offline
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 19:04.


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