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

Magneto


Post New Thread Reply   
 
Thread Tools Display Modes
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 02-17-2011 , 10:21   Re: Magneto
Reply With Quote #11

Should be fairly easy to make. Give me a few minutes.
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 02-17-2011 , 10:25   Re: Magneto
Reply With Quote #12

PHP Code:
// Magneto!

/* CVARS - copy and paste to shconfig.cfg

//Magneto
magneto_level 10
magneto_cooldown 45                //Time delay bewtween automatic uses
magneto_boost 125                //How much of an upward throw to give weapons
magneto_giveglock 1                //Give the poor victim a glock?

*/

#include <superheromod>

// GLOBAL VARIABLES
new gHeroID
new const gHeroName[] = "Magneto"
new bool:gHasMagneto[SH_MAXSLOTS+1]
new const 
gSoundDisarm[] = "ambience/deadsignal1.wav"
new gSpriteLightning
new pCvarCooldownpCvarBoostpCvarGiveGlock
//----------------------------------------------------------------------------------------------
public plugin_init()
{
    
// Plugin Info
    
register_plugin("SUPERHERO Magneto"SH_VERSION_STR"AssKicR / JTP10181")

    
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
    
new pcvarLevel register_cvar("magneto_level""10")
    
pCvarCooldown register_cvar("magneto_cooldown""45")
    
pCvarBoost register_cvar("magneto_boost""125")
    
pCvarGiveGlock register_cvar("magneto_giveglock""1")

    
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
    
gHeroID sh_create_hero(gHeroNamepcvarLevel)
    
sh_set_hero_info(gHeroID"Master of Magnetism""Strip and Get a players guns when they shoot you")
    
sh_set_hero_shield(gHeroIDtrue)
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
    
precache_sound(gSoundDisarm)
    
gSpriteLightning precache_model("sprites/lgtning.spr")
}
//----------------------------------------------------------------------------------------------
public sh_hero_init(idheroIDmode)
{
    if ( 
gHeroID != heroID ) return

    
gHasMagneto[id] = mode true false

    sh_debug_message
(id1"%s %s"gHeroNamemode "ADDED" "DROPPED")
}
//----------------------------------------------------------------------------------------------
public sh_client_spawn(id)
{
    
gPlayerInCooldown[id] = false
}
//----------------------------------------------------------------------------------------------
public client_damage(attackervictimdamagewpnindex)
{
    if ( !
sh_is_active() ) return
    if ( 
damage <= || victim == attacker ) return
    if ( !
is_user_alive(victim) || !is_user_alive(attacker) ) return
    if ( !
gHasMagneto[victim] || gPlayerInCooldown[victim] ) return
    if ( 
gHasMagneto[victim] && gHasMagneto[attacker] ) return

    new 
slot sh_get_weapon_slot(wpnindex)

    if ( 
slot == || slot == ) {

        new 
Float:cooldown get_pcvar_float(pCvarCooldown)
        if ( 
cooldown 0.0 sh_set_cooldown(victimcooldown)

        
// Disarm enemy and get their gun!
        
play_sound(victim)
        
play_sound(attacker)
        
magneto_disarm(victimattacker)

        
//Screen Flash
        
new alphanum clamp((damage 2), 40200)
        
sh_screen_fade(attacker1.00.5100100100alphanum)
    }
}
//----------------------------------------------------------------------------------------------
magneto_disarm(idvictim)
{
    new 
Float:velocity[3]

    
pev(victimpev_velocityvelocity)
    
velocity[2] += get_pcvar_float(pCvarBoost)

    
// Give em an upwards Jolt
    
set_pev(victimpev_velocityvelocity)

    new 
iweapons[32], inumiweaponID

    get_user_weapons
(victimiweaponsinum)

    for ( 
0inumi++ ) {
        
weaponID iweapons[i]
        
sh_drop_weapon(victimweaponIDtrue)
        
//Don't give c4, do not need more of them out there
        
if ( weaponID == CSW_C4 ) continue 
        
sh_give_weapon(idweaponID)
    }

    if ( 
get_pcvar_num(pCvarGiveGlock) ) {
        
sh_give_weapon(victimCSW_GLOCK18true)
    }
    else {
        
sh_switch_weapon(victimCSW_KNIFE)
    }

    
lightning_effect(idvictim)

    new 
name[32]
    
get_user_name(idnamecharsmax(name))

    
sh_chat_message(victimgHeroID"%s has removed your weapons"name)
}
//----------------------------------------------------------------------------------------------
lightning_effect(idvictim)
{
    
// Lightning effect
    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_BEAMENTS)        // 8
    
write_short(id)            // start entity
    
write_short(victim)        // entity
    
write_short(gSpriteLightning)    // model
    
write_byte(0)        // starting frame
    
write_byte(15)        // frame rate
    
write_byte(10)        // life
    
write_byte(10)        // line width
    
write_byte(10)        // noise amplitude
    
write_byte(255)        // r, g, b
    
write_byte(255)        // r, g, b
    
write_byte(255)        // r, g, b
    
write_byte(255)        // brightness
    
write_byte(0)        // scroll speed
    
message_end()
}
//----------------------------------------------------------------------------------------------
play_sound(id)
{
    
emit_sound(idCHAN_AUTOgSoundDisarmVOL_NORMATTN_NORM0PITCH_HIGH)
    
set_task(1.5"stop_sound"id)
}
//----------------------------------------------------------------------------------------------
public stop_sound(id)
{
    
emit_sound(idCHAN_AUTOgSoundDisarmVOL_NORMATTN_NORMSND_STOPPITCH_NORM)
}
//---------------------------------------------------------------------------------------------- 
__________________
No idea what to write here...
Jelle is offline
Send a message via MSN to Jelle
rodrigo
Senior Member
Join Date: Jul 2010
Location: Brasil
Old 02-17-2011 , 11:11   Re: Magneto
Reply With Quote #13

Thanks, I'm working now... More later I try
__________________
rodrigo is offline
rodrigo
Senior Member
Join Date: Jul 2010
Location: Brasil
Old 02-17-2011 , 15:38   Re: Magneto
Reply With Quote #14

Works
Thanks Jelle
__________________
rodrigo is offline
Jelle
[b]MOAR CANDY[/b]
Join Date: Aug 2009
Location: Denmark
Old 02-17-2011 , 15:39   Re: Magneto
Reply With Quote #15

np.
__________________
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 06:49.


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