You are on page 1of 6

// Arctic Predator!

- arcticpredator Hero From Outworld , Sent To Kill All Human


ity On Earth
/* CVARS - copy and paste to shconfig.cfg
//Arctic Predator
arcticpredator_level 4
arcticpredator_teamglow 0
//Glow Team Color when player skin in use (0=no
1=yes)
arcticpredator_m4a1mult 2.0
//Damage multiplyer for his M4A1
arcticpredator_health 200
//Default 100 (no extra health)
arcticpredator_armor 200
//Default 100
arcticpredator_gravity 1.0
//Default 1.0 = no extra gravity (0.50 is 50%
normal gravity, ect.)
arcticpredator_speed 600
//Default -1 = no extra speed, this cvar is for
all weapons (for faster then normal speed set to 321 or higher)
*/
#include <amxmodx>
#include <fakemeta>
#include <superheromod>
// GLOBAL VARIABLES
new gHeroName[]="Arctic Predator"
new bool:gHasArcPredPowers[SH_MAXSLOTS+1]
new bool:gmorphed[SH_MAXSLOTS+1]
#define TASKID 532221
//--------------------------------------------------------------------------------------------public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Arctic Predator", "1.2", "???")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("arcticpredator_level", "0")
register_cvar("arcticpredator_health", "200")
register_cvar("arcticpredator_armor", "200")
register_cvar("arcticpredator_gravity", "1.0")
register_cvar("arcticpredator_speed", "300")
register_cvar("arcticpredator_scoutmult", "8.0" )
register_cvar("arcticpredator_awpmult", "7.0" )
register_cvar("arcticpredator_knifemult", "15.0" )
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "Hunter", "Become Arctic Predator - Get a scout and
awp which you can use to snipe your enemies down!", false, "arcticpredator_level
")
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
// INIT
register_srvcmd("arcticpredator_init", "arcticpredator_init")
shRegHeroInit(gHeroName, "arcticpredator_init")
// EVENTS

register_event("ResetHUD", "newSpawn", "b")


register_event("CurWeapon", "weaponChange", "be", "1=1")
register_event("Damage", "arcticpredator_damage", "b", "2!0")
register_event("DeathMsg", "arcticpredator_death", "a")
// Let Server know about Arctic Predator's Variables
shSetShieldRestrict(gHeroName)
shSetMaxHealth(gHeroName, "arcticpredator_health")
shSetMaxArmor(gHeroName, "arcticpredator_armor")
shSetMinGravity(gHeroName, "arcticpredator_gravity")
shSetMaxSpeed(gHeroName, "arcticpredator_speed", "[0]")
}
//--------------------------------------------------------------------------------------------public plugin_precache()
{
precache_model("models/player/arcpred/arcpred.mdl")
precache_model("models/player/arcpredct/arcpredct.mdl")
precache_model("models/shmod/predgun/predknife.mdl")
precache_model("models/shmod/predgun/predawp.mdl")
precache_model("models/shmod/predgun/preddisc.mdl")
precache_model("models/shmod/predgun/p_predgun.mdl")
precache_model("models/shmod/predgun/v_predgun.mdl")
}
//--------------------------------------------------------------------------------------------public arcticpredator_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)
//Reset thier shield restrict status
//Shield restrict MUST be before weapons are given out
shResetShield(id)
switch(hasPowers)
{
case true:
{
gHasArcPredPowers[id] = true
if ( is_user_alive(id) )
{
arcpredator_weapons(id)
switchgun(id)
pred_Morph(id)
arcticpredator_tasks(id)
}
}
case false:
{

if ( is_user_alive(id) && gHasArcPredPowers[id] )


{
arcticpredator_unmorph(id)
engclient_cmd(id, "drop", "weapon_awp")
engclient_cmd(id, "drop", "weapon_scout")
}
gHasArcPredPowers[id] = false
}
}
}
//--------------------------------------------------------------------------------------------public newSpawn(id)
{
if ( gHasArcPredPowers[id] && is_user_alive(id) && shModActive() )
{
set_task(0.1, "arcpredator_weapons", id)
arcticpredator_tasks(id)
}
}
//--------------------------------------------------------------------------------------------public arcticpredator_tasks(id)
{
set_task(1.0, "pred_Morph", id)
}
//--------------------------------------------------------------------------------------------public arcpredator_weapons(id)
{
if ( !shModActive() || !is_user_alive(id) || !gHasArcPredPowers[id] )
return
shGiveWeapon(id, "weapon_awp")
shGiveWeapon(id, "weapon_scout")
}
//--------------------------------------------------------------------------------------------public switchgun(id)
{
if ( !is_user_alive(id) || !gHasArcPredPowers[id] ) return
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if (wpnid == CSW_AWP) {
// Weapon Model change thanks to [CCC]Taz-Devil
entity_set_string(id, EV_SZ_viewmodel, "models/shmod/predgun/predawp.mdl
")
entity_set_string(id, EV_SZ_weaponmodel, "")
}
if (wpnid == CSW_SCOUT) {
// Weapon Model change thanks to [CCC]Taz-Devil
entity_set_string(id, EV_SZ_viewmodel, "models/shmod/predgun/v_predgun.m
dl")
entity_set_string(id, EV_SZ_weaponmodel, "models/shmod/predgun/p_predgun
.mdl")
}
if (wpnid == CSW_KNIFE) {
// Weapon Model change thanks to [CCC]Taz-Devil
entity_set_string(id, EV_SZ_viewmodel, "models/shmod/predgun/predknife.m

dl")
}
}
//--------------------------------------------------------------------------------------------public weaponChange(id)
{
if ( !gHasArcPredPowers[id] || !shModActive() )
return
new wpnid = read_data(2)
if ( wpnid != CSW_AWP && wpnid != CSW_KNIFE && wpnid != CSW_SCOUT )
return
switchgun(id)
new clip = read_data(3)
// Never Run Out of Ammo!
if ( clip == 0 )
shReloadAmmo(id)
}
//--------------------------------------------------------------------------------------------public arcticpredator_damage(id)
{
if ( !shModActive() || !is_user_alive(id) ) return
new damage = read_data(2)
new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
new headshot = bodypart == 1 ? 1 : 0
if ( attacker <= 0 || attacker > SH_MAXSLOTS ) return
if ( gHasArcPredPowers[attacker] && weapon == CSW_SCOUT && is_user_alive(id)
) {
// do extra damage
new extraDamage = floatround(damage * get_cvar_float("arcticpredator_sco
utmult") - damage)
if (extraDamage > 0) shExtraDamage(id, attacker, extraDamage, "scout", h
eadshot)
}
else if(gHasArcPredPowers[attacker] && weapon == CSW_AWP && is_user_alive(id
) ){
new extraDamage = floatround(damage * get_cvar_float("arcticpredator_awp
mult") - damage)
if(extraDamage > 0) shExtraDamage(id, attacker, extraDamage, "awp", head
shot)
}
else if(gHasArcPredPowers[attacker] && weapon == CSW_KNIFE && is_user_alive(
id) ){
new extraDamage = floatround(damage * get_cvar_float("arcticpredator_kni
femult") - damage)
if(extraDamage > 0) shExtraDamage(id, attacker, extraDamage, "knife", he
adshot)
}
}

//--------------------------------------------------------------------------------------------pred_Morph(id)
{
if ( gmorphed[id] || !is_user_alive(id) || !gHasArcPredPowers[id] )
return
if ( gHasArcPredPowers[id] == true && is_user_connected(id) )
{
if ( get_user_team(id) ==
{
cs_set_user_model(id,
}
if ( get_user_team(id) ==
{
cs_set_user_model(id,
}

1 )
"arcpredct")
2 )
"arcpred")

}
// Message
set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)
show_hudmessage(id, "Arctic Predator - Are you gonna give me orders?!")
gmorphed[id] = true
}
//--------------------------------------------------------------------------------------------public arcticpredator_unmorph(id)
{
if ( gmorphed[id] && is_user_connected(id) )
{
if ( is_user_alive(id) )
{
// Message
set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)
show_hudmessage(id, "Arctic Predator - T_T")
}
cs_reset_user_model(id)
gmorphed[id] = false
}
}
//--------------------------------------------------------------------------------------------//--------------------------------------------------------------------------------------------public arcticpredator_death()
{
new id = read_data(2)
if ( !gHasArcPredPowers[id] )
return
arcticpredator_unmorph(id)
}

//--------------------------------------------------------------------------------------------public client_connect(id)
{
gmorphed[id] = false
gHasArcPredPowers[id] = false
}
//---------------------------------------------------------------------------------------------

You might also like