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

Problem with admin only in swat hero


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-16-2009 , 12:38   Problem with admin only in swat hero
Reply With Quote #1

I just added admin only on the swat hero, but I get these errors:
error: undefined symbol "gSwatSelected" on line 592
warning: expression has no effect on line 592
error: expected token: ";" but found "]" on line 592

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)
            
swat_admincheck(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)
    
gSwatSelected[id] = gHasSwatPower[id]
}
//----------------------------------------------------------------------------------------------
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 
swat_admincheck (id)
{
    new 
acceslevel[10] = "a"
    
    
if (gSwatSelected[id] && !(get_user_flags(id) & read_flags(acceslevel)))
    {
        
client_print(idprint_chat"[SH](%s) **Admin Only** You are not authorized to use this hero"gHeroName)
        
gHasSwatPower[id] = false
        client_cmd
(id"say drop %s"gHeroName)
    }
}
//------------------------------------------------------------------------------------
/*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)
*/ 
I checked if it all were the same case, but it is. I followed the tutorial the rolnaaba made.

Any idea, anyone?
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 09-17-2009 , 03:17   Re: Problem with admin only in swat hero
Reply With Quote #2

new gSwatSelected[33]
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 09-17-2009 , 15:29   Re: Problem with admin only in swat hero
Reply With Quote #3

lol I do not know what I was thinking. Thanks allot!
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
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 16:09.


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