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

How To: Make a Superhero Admin Only


Post New Thread Reply   
 
Thread Tools Display Modes
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-21-2011 , 02:37   Re: How To: Make a Superhero Admin Only
Reply With Quote #51

Oh so you get that error. Now I completely understand you.

You go to line 64 and add this:

I_are_idiot(me, true)
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 11-21-2011 , 07:26   Re: How To: Make a Superhero Admin Only
Reply With Quote #52

Jelle, sometimes you really need to shut up ?
sorry to be mad but this kind of things you can keep it for you and stop sharing them when they are no justified.

Someone who don't know how to code or fix a code is not an idiot...
Fr33m@n is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-21-2011 , 07:36   Re: How To: Make a Superhero Admin Only
Reply With Quote #53

Writing "this error" and "it" about stuff which he never said what could be is pretty dum to me.

This has nothing to do with the code, but the way he writes about it. I am not a mind reader, and I therefor have no idea what that error or that it thing is.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 11-21-2011 , 08:31   Re: How To: Make a Superhero Admin Only
Reply With Quote #54

Quote:
Originally Posted by killer2100 View Post
i get this error and it says undefined how do i define it?
to define a variable, simply put "new <your variable name>" within whatever scope you need it for i.e. if it's something several functions are gonna use it would be global and should be defined at the top of the script, if its local to one specific function then put that at the top of the function under the { that signifies the opening of the function. Your hero is riddled with more problems though because your mixing an old guide for making a hero admin only written for the old api when using the new api. Your finalized code should look more like this
PHP Code:
// SHADOWCAT! from the X-men, Kitty Pryde can walk thu walls.
// Hero Originally named NightCrawler, changed since powers did not fit.

/* CVARS - copy and paste to shconfig.cfg

//Shadowcat
shadowcat_level 0
shadowcat_cooldown 30        //# of seconds before Shadowcat can NoClip Again
shadowcat_cliptime 6        //# of seconds Shadowcat has in noclip mode.

*/

#include <superheromod>

// GLOBAL VARIABLES
new gHeroID
new const gHeroName[] = "Shadowcat"
new bool:gHasShadowcat[SH_MAXSLOTS+1]
new 
gShadowcatTimer[SH_MAXSLOTS+1]
new const 
gSoundShadowcat[] = "ambience/alien_zonerator.wav"
new gPcvarCooldowngPcvarClipTime
new gMsgSync
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Shadowcat"SH_VERSION_STR"{HOJ} Batman")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
new pcvarLevel register_cvar("shadowcat_level""8")
    
gPcvarCooldown register_cvar("shadowcat_cooldown""180")
    
gPcvarClipTime register_cvar("shadowcat_cliptime""4")

    
// FIRE THE EVENTS TO CREATE THIS SUPERHERO!
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_info(gHeroID"Walk Through Walls""Can Walk Through Walls for Short Time - GET STUCK AND YOU'LL BE AUTO-SLAIN!")
    
sh_set_hero_bind(gHeroID)

    
// LOOP
    
set_task(1.0"shadowcat_loop"___"b")

    
gMsgSync CreateHudSyncObj()
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
precache_sound(gSoundShadowcat)
}
//----------------------------------------------------------------------------------------------
public sh_hero_init(idheroIDmode)
{
    if ( 
gHeroID != heroID ) return

    switch(
mode) {
        case 
SH_HERO_ADD: {
            
gHasShadowcat[id] = true

            
// Make sure looop doesn't fire for them
            
gShadowcatTimer[id] = -1
            shadowcat_admincheck
(id)
        }

        case 
SH_HERO_DROP: {
            
gHasShadowcat[id] = false

            
if ( gShadowcatTimer[id] >= shadowcat_endnoclip(id)
        }
    }

    
sh_debug_message(id1"%s %s"gHeroNamemode "ADDED" "DROPPED")
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
    
gPlayerInCooldown[id] = false

    gShadowcatTimer
[id]= -1

    
if ( gHasShadowcat[id] ) {
        
shadowcat_endnoclip(id)
        
shadowcat_admincheck(id)
    }
}
//----------------------------------------------------------------------------------------------
public sh_hero_key(idheroIDkey)
{
    if ( 
gHeroID != heroID || sh_is_freezetime() || !is_user_alive(id) ) return

    if ( 
key == SH_KEYDOWN ) {
        
// Make sure they're not in the middle of clip already
        // Let them know they already used their ultimate if they have
        
if ( gPlayerInCooldown[id] || gShadowcatTimer[id] >= ) {
            
sh_sound_deny(id)
            return
        }

        
//If the user already has noclip (prob from another hero) cancel this keydown
        
if ( get_user_noclip(id) ) {
            
sh_chat_message(idgHeroID"You are already using noclip")
            
sh_sound_deny(id)
            return
        }

        
gShadowcatTimer[id] = get_pcvar_num(gPcvarClipTime)

        
set_user_noclip(id1)

        
// Shadowcat Messsage
        
set_hudmessage(25500, -1.00.300.251.20.00.0, -1)
        
ShowSyncHudMsg(idgMsgSync"Entered %s Mode^nDon't get Stuck or you will die"gHeroName)

        
emit_sound(idCHAN_STATICgSoundShadowcat0.2ATTN_NORM0PITCH_LOW)
    }
}
//----------------------------------------------------------------------------------------------
public shadowcat_loop()
{
    static 
players[SH_MAXSLOTS], playerCountplayeri
    
static Float:cooldownnoclipTime
    cooldown 
get_pcvar_float(gPcvarCooldown)
    
get_players(playersplayerCount"ah")

    for ( 
0playerCounti++ ) {
        
player players[i]

        if ( 
gHasShadowcat[player] ) {
            
noclipTime gShadowcatTimer[player]
            if ( 
noclipTime ) {
                
set_hudmessage(25500, -1.00.301.01.20.00.0, -1)
                
ShowSyncHudMsg(playergMsgSync"%d second%s left of %s Mode^nDon't get Stuck or you will Die"noclipTimenoclipTime == "" "s"gHeroName)

                
gShadowcatTimer[player]--
            }
            else if ( 
noclipTime == ) {
                if ( 
cooldown 0.0 sh_set_cooldown(playercooldown)

                
gShadowcatTimer[player]--

                
shadowcat_endnoclip(player)
            }
        }
    }
}
//----------------------------------------------------------------------------------------------
shadowcat_endnoclip(id)
{
    if ( !
is_user_connected(id) ) return

    
gShadowcatTimer[id] = -1

    
// Stop noclip sound
    
emit_sound(idCHAN_STATICgSoundShadowcat0.0ATTN_NORMSND_STOPPITCH_LOW)

    if ( !
is_user_alive(id) ) return

    if ( 
get_user_noclip(id) ) {
        
// Turn off no-clipping and kill user if stuck
        
set_user_noclip(id0)

        
// If player is stuck kill them
        
new Float:origin[3], hulltype
        pev
(idpev_originorigin)
        
hulltype = (pev(idpev_flags) & FL_DUCKING) ? HULL_HEAD HULL_HUMAN
        
if ( !sh_hull_vacant(idoriginhulltype) ) {
            
user_kill(id)
        }
    }
}
//----------------------------------------------------------------------------------------------
public sh_client_death(victim)
{
    
gPlayerInCooldown[victim] = false

    gShadowcatTimer
[victim]= -1

    
if ( gHasShadowcat[victim] ) {
        
shadowcat_endnoclip(victim)
    }
}
//----------------------------------------------------------------------------------------------
shadowcat_admincheck(id) { //admin check function
    
new accessLevel[10] = "a" //set you admin check level to what you want
    /* or make it a cvar:
    get_cvar_string("shadowcat_adminflag", accessLevel, 9)
    */
 
    
if ( gHasShadowcat[id] &&  !(get_user_flags(id)&read_flags(accessLevel)) ) {
          
sh_chat_message(idgHeroID"**VIP Only** Get Vip To Use This Hero.")
          
client_cmd(id"say drop %s"gHeroName)
    }

__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
killer2100
Member
Join Date: Apr 2010
Location: Ireland (Not Irish)
Old 11-22-2011 , 09:38   Re: How To: Make a Superhero Admin Only
Reply With Quote #55

thanks you are much better than this douche Jelle
__________________
Im New To Cs Zombie Mode, Making My Own Server, Always Accept Help
killer2100 is offline
Send a message via Skype™ to killer2100
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 11-22-2011 , 09:44   Re: How To: Make a Superhero Admin Only
Reply With Quote #56

Quote:
Originally Posted by killer2100 View Post
thanks you are much better than this douche Jelle
<33
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Lunaman1
Junior Member
Join Date: Jun 2011
Old 01-31-2012 , 23:00   Re: How To: Make a Superhero Admin Only
Reply With Quote #57

PHP Code:
// T-1600- Robot powers

/* CVARS - copy and paste to shconfig.cfg

//T-1600
t1600_level 8
t1600_time 5                //How long is T-1600 mode
t1600_cooldown 30        //Whats the cooldown of T-1600 mode
t1600_paramult 5            //how strong is the para
t1600_adminflag a        // Admin flag required to use this hero (Default a = ADMIN_IMMUNITY)

*/

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

// VARIABLES
new gHeroName[]="T-1600"
new gT1600Timer[SH_MAXSLOTS+1]
new 
bool:gMorphed[SH_MAXSLOTS+1]
new 
gLastWeapon[SH_MAXSLOTS+1]
new 
gKillsgmsgScreenFade
new bool:gHasT1600Power[SH_MAXSLOTS+1]
new 
bool:gHEROSelected[SH_MAXSLOTS+1]


//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO T-1600","2.0","Bum_Boy16")
 
    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
register_cvar("t1600_level""8" )
        
register_cvar("t1600_time""5" )
        
register_cvar("t1600_cooldown""30" )
        
register_cvar("t1600_paramult""5" )
    
register_cvar("t1600_admins_immune""a")
  
    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
shCreateHero(gHeroName"Change into a T-1600""Get a giant mini gun and you are indistructable"true"t1600_level")
  
    
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    
register_srvcmd("t1600_init""t1600_init")
    
shRegHeroInit(gHeroName"t1600_init")

        
// New Round
        
register_event("ResetHUD","t1600_newround","b")

    
// DEATH
    
register_event("DeathMsg""t1600_death""a")

        
// Model Change
    
register_event("CurWeapon","weaponChange","be","1=1")

        
// Extra Damage
    
register_event("Damage""t1600_damage""b""2!0")

    
// LOOP
    
set_task(1.0,"t1600_loop",0,"",0,"b")

    
// KEY DOWN
    
register_srvcmd("t1600_kd""t1600_kd")
    
shRegKeyDown(gHeroName"t1600_kd")

    
gmsgScreenFade get_user_msgid("ScreenFade")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
precache_model("models/shmod/t1600_m249.mdl")
    
precache_model("models/shmod/t1600_minigun.mdl")
        
precache_model("models/player/t1600/t1600.mdl")
}
//----------------------------------------------------------------------------------------------
public t1600_init()
{
    
// First Argument is an id
    
new temp[128]
    
read_argv(1,temp,5)
    new 
id=str_to_num(temp)
  
    
// 2nd Argument is 0 or 1 depending on whether the id has iron man powers
    
read_argv(2,temp,5)
    new 
hasPowers=str_to_num(temp)
  
    
gHasT1600Power[id]=(hasPowers!=0)

    if ( !
hasPowers ) {
        if ( 
is_user_alive(id) && gT1600Timer[id] >= ) {
            
t1600_endmode(id)
        }
    }
    else {
        
gT1600Timer[id] = -1
                
if ( is_user_connected(id) ) switchmodel(id)
    }
}
//----------------------------------------------------------------------------------------------
public t1600_newround(id)
{
    if ( 
gHasT1600Power[id] && is_user_alive(id) && shModActive() ) {
              
t1600_endmode(id

          new 
wpnid read_data(2)
          if (
wpnid != CSW_M249 && wpnid 0) {
            new 
wpn[32]
            
get_weaponname(wpnid,wpn,31)
            
engclient_cmd(id,wpn)
          } 
    }

    
gPlayerUltimateUsed[id] = false
    gT1600Timer
[id] = -1
}
//----------------------------------------------------------------------------------------------
public t1600_death()
{
    new 
id read_data(2)

    
gPlayerUltimateUsed[id] = false
    gT1600Timer
[id]= -1
    
if (gHasT1600Power[id]) {
        
t1600_endmode(id)
    }
}
//----------------------------------------------------------------------------------------------
public t1600_loop()
{
    if (!
shModActive()) return

    for ( new 
id 1id <= SH_MAXSLOTSid++ ) {
        if ( 
gHasT1600Power[id] && is_user_alive(id)  )  {
            if ( 
gT1600Timer[id] > ) {
                
gT1600Timer[id]--
                new 
message[128]
                
format(message127"%d seconds left of being a T-1600 hurry up"gT1600Timer[id])
                
set_hudmessage(255,0,0,-1.0,0.3,0,1.0,1.0,0.0,0.0,87)
                
show_hudmessage(idmessage)

                            
// Make sure still on para
                            
new clip,ammo,weaponID get_user_weapon(id,clip,ammo)
                            if ( 
weaponID != CSW_M249 ) {
                                 
shGiveWeapon(id,"weapon_m249",true)
                             }

                    
message_begin(MSG_ONE,gmsgScreenFade,{0,0,0},id)
                    
write_short(15)
                    
write_short(15)
                    
write_short(12)
                    
write_byte(255)
                    
write_byte(0)
                    
write_byte(0)
                    
write_byte(50)
                    
message_end()
            }
            else if ( 
gT1600Timer[id] == ) {
                   
t1600_endmode(id)
            }

                        if ( 
gT1600Timer[id] == -) {
                   
drop_para(id)
            }
        }
    }
}
//----------------------------------------------------------------------------------------------
public switchmodel(id)
{
    if ( !
is_user_alive(id) || !gHasT1600Power[id] ) return

    
//If user is holding a shield do not change model, since we don't have one with a shield
    
new v_mdl[32]
    
Entvars_Get_String(idEV_SZ_viewmodelv_mdl31)
    if ( 
containi(v_mdl"v_shield_") != -1) return

    new 
wpnid read_data(2)
    if (
wpnid == CSW_M249) {
        
// Weapon Model change thanks to [CCC]Taz-Devil
        
Entvars_Set_String(idEV_SZ_viewmodel"models/shmod/t1600_m249.mdl")
                
Entvars_Set_String(idEV_SZ_weaponmodel"models/shmod/t1600_minigun.mdl")
    }
}
//----------------------------------------------------------------------------------------------
public weaponChange(id)
{
    if ( !
gHasT1600Power[id] || !shModActive() ) return

    new 
wpnid read_data(2)

    if ( 
wpnid == CSW_M249 switchmodel(id)
}
//----------------------------------------------------------------------------------------------
public t1600_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 ( 
gHasT1600Power[attacker] && weapon == CSW_M249 && is_user_alive(id) ) {
        
// do extra damage
        
new extraDamage floatround(damage get_cvar_float("t1600_paramult") - damage)
        if (
extraDamage 0shExtraDamageidattackerextraDamage"m249"headshot )
    }
}
//----------------------------------------------------------------------------------------------
// RESPOND TO KEYDOWN
public t1600_kd()
{
    if ( !
hasRoundStarted() ) return PLUGIN_HANDLED

    
// First Argument is an id with NightCrawler Powers!
    
new temp[6]
    
read_argv(1,temp,5)
    new 
id=str_to_num(temp)

    if ( !
is_user_alive(id) || !is_user_connected(id) ) return PLUGIN_HANDLED

    
// Let them know they already used their ultimate if they have
    
if ( gPlayerUltimateUsed[id] || gT1600Timer[id] > ) {
        
playSoundDenySelect(id)
        return 
PLUGIN_HANDLED
    
}

        if ( 
is_user_connected(id) && get_user_godmode(id) == ) {
              
playSoundDenySelect(id)
          
client_print(id,print_chat,"[SH](T-1600) Error loading you are already in godmode")
              return 
PLUGIN_HANDLED
        
}

    
gT1600Timer[id] = get_cvar_num("t1600_time")+1
        shGiveWeapon
(id,"weapon_m249",true
    
set_user_godmode(id,1)
        
t1600_morph(id)
        
gKills get_user_frags(id)
    
ultimateTimer(idget_cvar_num("t1600_cooldown") * 1.0)

    new 
message[128]
    
format(message127"You have become a T-1600 KILL!")
    
set_hudmessage(255,0,0,-1.0,0.3,0,0.25,1.0,0.0,0.0,87)
    
show_hudmessage(idmessage)

    return 
PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public t1600_morph(id)
{
    if ( !
is_user_alive(id) || gMorphed[id] ) return

    
#if defined AMXX_VERSION
    
cs_set_user_model(id"t1600")
    
#else
    
CS_SetModel(id"t1600")
    
#endif

    
gMorphed[id] = true
}
//----------------------------------------------------------------------------------------------
public t1600_endmode(id)
{
    
gT1600Timer[id] = -1
    setScreenFlash
(id00010)

    
// Switch back to previous weapon...
    
if ( gLastWeapon[id] != CSW_M249 shSwitchWeaponIDidgLastWeapon[id] )

        if ( 
gMorphed[id] && is_user_connected(id) ) t1600_unmorph(id)

    if ( 
gHasT1600Power[id] && is_user_alive(id) ) {
          
set_user_godmode(id)
              
drop_para(id)  
    }
}
//----------------------------------------------------------------------------------------------
public t1600_unmorph(id)
{
        new 
totalkill get_user_frags(id) - gKills

    
if ( gMorphed[id] ) {
        
set_hudmessage(25500, -1.00.4520.024.00.010.186)
                if (
totalkill == 1) {
             
show_hudmessage(id,"T-1600 Mode has ended, you have killed 1 person")
                } 
                else {
             
show_hudmessage(id,"T-1600 Mode has ended, you have killed %d people",totalkill)
                }
                 

        
#if defined AMXX_VERSION
        
cs_reset_user_model(id)
        
#else
        
CS_ClearModel(id)
        
#endif

        
gMorphed[id] = false
    
}
}
//----------------------------------------------------------------------------------------------
public drop_para(id)
{
        
engclient_cmd(id,"drop","weapon_m249")   

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

    while ( (
iCurrent FindEntity(iCurrent"weaponbox")) > ) {

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

        
Entvars_Get_Vector(iCurrentEV_VEC_velocityweapvel)

        
//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 T1600_admincheck(id) { //admin check function
    
new accessLevel[10] = "a" //set you admin check level to what you want
    /* or make it a cvar:
    get_cvar_string("T1600_adminflag", accessLevel, 9)
    */
 
    
if(gHasT1600Power[id] && is_user_connected(id)) { //if they have your power and are connected do admin check
        
T1600_admincheck(id)
        
client_print(idprint_chat"[SH](%s) **Admin Only** You are not authorized to use this hero"gT1600Timer)
        
gHasT1600Power[id] = false
        client_cmd
(id"say drop %s"gT1600Timer)
    }
}
//---------------------------------------------------------------------------------------------- 
PHP Code:
/tmp/text7jJct1.sma(332) : warning 217loose indentation
/tmp/text7jJct1.sma(338) : warning 204symbol is assigned a value that is never used"accessLevel"
/tmp/text7jJct1.sma(340) : warning 203symbol is never used"gHEROSelected" 
can you guy's explain that.?
Lunaman1 is offline
Hackerx_psp
Junior Member
Join Date: Sep 2011
Old 09-21-2012 , 09:55   Re: How To: Make a Superhero Admin Only
Reply With Quote #58

did not work for me i need help then
PHP Code:
// THOR! from Marvel Comics. Asgardian god, son of Odin, wielder of the enchanted uru hammer Mjolnir.

/* CVARS - copy and paste to shconfig.cfg

//Thor
thor_level 8
thor_pctofdmg 75        //Percent of Damage Taken that is dealt back at your attacker (def 75%)
thor_cooldown 45        //Amount of time before next available use (def 45)

*/

/*
* v1.2 - vittu - 12/31/05
*      - Cleaned up code.
*      - Changed damage cvar to a percent of damage taken.
*      - Changed sounds.
*      - Changed look of effects.
*
*/

#include <amxmod>
#include <superheromod>

// GLOBAL VARIABLES
new g_heroName[]="Thor"
new bool:g_hasThor[SH_MAXSLOTS+1]
new 
g_spriteLightning
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Thor""1.1""TreDizzle")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
register_cvar("thor_level""8")
    
register_cvar("thor_pctofdmg""75")
    
register_cvar("thor_cooldown""45")
    
register_cvar("thor_adminflag""m")

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
shCreateHero(g_heroName"Thunder Bolt""Strike Attackers with a Mighty Lightning Bolt from Thor's uru hammer Mjolnir."false"thor_level")

    
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
    // INIT
    
register_srvcmd("thor_init""thor_init")
    
shRegHeroInit(g_heroName"thor_init")

    
// EVENTS
    
register_event("ResetHUD""newSpawn""b")
    
register_event("Damage""thor_damage""b""2!0")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
precache_sound("ambience/thunder_clap.wav")
    
precache_sound("buttons/spark5.wav")
    
g_spriteLightning precache_model("sprites/lgtning.spr")
}
//----------------------------------------------------------------------------------------------
public thor_init() {
    new 
temp[6];
    
read_argv(1,temp,5);
    new 
id str_to_num(temp); //get players index
   
    
read_argv(2,temp,5);
    new 
hasPowers str_to_num(temp); //check if they have your power
   
    
gHasThorPower[id] = (hasPowers != 0); //set have power
    
gThorSelected[id] = gHasThorPower[id];
  
    if(
gHasThorPower[id] && is_user_connected(id)) { //if they have your power and are connected do admin check
          
thor_admincheck(id);
    }
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
    
gPlayerUltimateUsed[id] = false
}
//----------------------------------------------------------------------------------------------
public thor_damage(id)
{
    if ( !
shModActive() || !is_user_connected(id) ) return
    if ( !
g_hasThor[id] || gPlayerUltimateUsed[id] ) return

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

    if ( 
attacker <= || attacker SH_MAXSLOTS ) return

    
// Thor still attacks if Thor user dies from attackers damage
    
if ( is_user_alive(attacker) && !get_user_godmode(attacker) && id != attacker ) {
        
emit_sound(idCHAN_STATIC"ambience/thunder_clap.wav"0.6ATTN_NORM0PITCH_NORM)
        
emit_sound(attackerCHAN_STATIC"buttons/spark5.wav"0.4ATTN_NORM0PITCH_NORM)

        
// Deal a % of the damage back at them
        
new extraDamage floatround(damage get_cvar_num("thor_pctofdmg") * 0.01 )
        if (
extraDamage == 0extraDamage 1
        shExtraDamage
(attackeridextraDamage"thunder bolt")

        
// create some effects
        
if ( extraDamage 70 extraDamage 70
        
else if ( extraDamage 20 extraDamage 20
        lightning_effect
(idattackerextraDamage)

        
// make attacker feel it
        
new alphanum damage 2
        
if ( alphanum 200 alphanum 200
        
else if ( alphanum 40 alphanum 40
        setScreenFlash
(attacker25525522410alphanum)
        
sh_screenShake(attacker121014)

        if ( 
is_user_alive(id) ) {
            
// Set cooldown if Thor is still alive
            
new thorCooldown get_cvar_num("thor_cooldown")
            if (
thorCooldown 0ultimateTimer(idthorCooldown 1.0)
        }
    }
}
//----------------------------------------------------------------------------------------------
public lightning_effect(idtargetidlineWidth)
{
    
// Main Lightning
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(8)                //TE_BEAMENTS
    
write_short(id)            // start entity
    
write_short(targetid)        // entity
    
write_short(g_spriteLightning)    // model
    
write_byte(0)            // starting frame
    
write_byte(200)        // frame rate
    
write_byte(15)            // life
    
write_byte(lineWidth)    // line width
    
write_byte(6)            // noise amplitude
    
write_byte(255)        // r, g, b
    
write_byte(255)        // r, g, b
    
write_byte(224)        // r, g, b
    
write_byte(125)        // brightness
    
write_byte(0)            // scroll speed
    
message_end()

    
// Extra Lightning
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(8)                //TE_BEAMENTS
    
write_short(id)            // start entity
    
write_short(targetid)        // entity
    
write_short(g_spriteLightning)    // model
    
write_byte(10)            // starting frame
    
write_byte(200)        // frame rate
    
write_byte(15)            // life
    
write_byte(floatround(lineWidth/2.5))    // line width
    
write_byte(18)            // noise amplitude
    
write_byte(255)        // r, g, b
    
write_byte(255)        // r, g, b
    
write_byte(224)        // r, g, b
    
write_byte(125)        // brightness
    
write_byte(0)            // scroll speed
    
message_end()
}
//----------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------
public thor_admincheck(id) { //admin check function
    
new accessLevel[10] = "m" //set you admin check level to what you want
    /* or make it a cvar:
    get_cvar_string("thor_adminflag", accessLevel, 9)
    */
 
    
if ( gThorSelected[id] &&  !(get_user_flags(id)&read_flags(accessLevel)) ) {
          
client_print(idprint_chat"[SH](%s) **Admin Only** You are not authorized to use this hero"gThorName)
          
gHasThorPower[id] = false
          client_cmd
(id"say drop %s"gThorName)
    }
}
//---------------------------------------------------------------------------------------------- 
__________________

Last edited by Hackerx_psp; 09-21-2012 at 10:28. Reason: Error
Hackerx_psp is offline
Send a message via Skype™ to Hackerx_psp
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 09:45.


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