//Abe! - You can insert your spirit into enemies
/* CVARS - copy and paste to shconfig.cfg
//Abe
abe_level 10
*/
#include <amxmodx>
#include <superheromod>
#include <fakemeta>
#include <cstrike>
#include <fun>
new gHeroName[] = "Abe"
new bool:gHasAbePower[SH_MAXSLOTS+1]
new bool:AbePowerUsed[SH_MAXSLOTS+1]
new gMorphed[SH_MAXSLOTS+1]
new LightSprite
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Abe", "1.0", "NOmeR1")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("abe_level", "10")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "Insert your spirit into enemies", "You can insert your spirit into enemies", true, "abe_level")
// INIT
register_srvcmd("abe_init", "abe_init")
shRegHeroInit(gHeroName, "abe_init")
// EVENTS
register_event("ResetHUD", "newSpawn", "b")
// KEYDOWN
register_srvcmd("abe_kd", "abe_kd")
shRegKeyDown(gHeroName, "abe_kd")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
// Precache lighting
LightSprite = precache_model("sprites/lgtning.spr")
// Precache sound
precache_sound("shmod/abe_sound.wav")
}
//----------------------------------------------------------------------------------------------
public abe_init()
{
// First Argument is an id who has abe
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 abe
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)
gHasAbePower[id] = (hasPowers != 0)
}
//----------------------------------------------------------------------------------------------
public abe_kd()
{
// First Argument is an id who has abe
new temp[6]
read_argv(1,temp,5)
new id = str_to_num(temp)
// Use power once per round
if(!AbePowerUsed[id])
{
new origin[3], modelVictim[32], originVictim[3], weapons[32], wpname[32]
new Float:anglesVictim[3]
new body, victimID, weaponsCount
// Get target id
get_user_aiming(id, victimID, body)
if(get_user_team(id) != get_user_team(victimID) && victimID > 0 && victimID <= SH_MAXSLOTS)
{
emit_sound(id, CHAN_AUTO, "shmod/abe_sound.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
AbePowerUsed[id] = true
// Set victim's model to Abe
get_user_info(victimID, "model", modelVictim, 32)
morph_model(id, modelVictim)
// Get origin from victim and Abe
get_user_origin(id, origin, 0)
get_user_origin(victimID, originVictim, 0)
// Set origin to victim Abe
set_user_origin(id, originVictim)
set_user_origin(victimID, origin)
// Get aiming from victim
pev(victimID, pev_angles, anglesVictim)
// Set aiming of victim to Abe
set_pev(id, pev_angles, anglesVictim)
set_pev(id, pev_fixangle, 1)
// Light effects (credits to AssKicR and JTP10181)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(8)
write_short(id) // start entity
write_short(victimID) // entity
write_short(LightSprite) // model
write_byte(0) // starting frame
write_byte(15) // frame rate
write_byte(7) // life
write_byte(50) // line width
write_byte(30) // noise amplitude
write_byte(255) // r, g, b
write_byte(255) // r, g, b
write_byte(255) // r, g, b
write_byte(192) // brightness
write_byte(0) // scroll speed
message_end()
// Get armor, health, gravity and money from victim
new armor = get_user_armor(victimID)
new health = get_user_health(victimID)
new Float:gravity = get_user_gravity(victimID)
new money = cs_get_user_money(victimID)
// Get victim's weapons
get_user_weapons(victimID, weapons, weaponsCount)
// Killing victim
user_kill(victimID, 1)
// Give armor, health, gravity and money to Abe
set_user_armor(id, armor)
set_user_health(id, health)
set_user_gravity(id, gravity)
cs_set_user_money(id, money, 0)
// Give victim's weapons to Abe
for(new wpn = 0; wpn <= weaponsCount; wpn++)
{
if(!user_has_weapon(id, weapons[wpn]))
{
get_weaponname(weapons[wpn], wpname, 31)
give_item(id, wpname)
}
}
client_print(id, print_chat, "[SH](Abe) You have used your Abe power")
}
else
{
client_print(id, print_chat, "[SH](Abe) You have no target")
}
}
else
{
client_print(id, print_chat, "[SH](Abe) You cannot use your Abe power on this round again")
}
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
if(gHasAbePower[id])
{
unmorph_model(id)
AbePowerUsed[id] = false
}
}
//----------------------------------------------------------------------------------------------
public morph_model(id, model[])
{
if(!gMorphed[id])
{
cs_set_user_model(id, model)
gMorphed[id] = true
}
}
//----------------------------------------------------------------------------------------------
public unmorph_model(id)
{
if(gMorphed[id])
{
cs_reset_user_model(id)
gMorphed[id] = false
}
}
//----------------------------------------------------------------------------------------------
>> :D
//Abe! - You can insert your spirit into enemies
/* CVARS - copy and paste to shconfig.cfg
//Abe
abe_level 10
*/
#include <amxmodx>
#include <superheromod>
#include <fakemeta>
#include <cstrike>
#include <fun>
new gHeroName[] = "Abe"
new bool:gHasAbePower[SH_MAXSLOTS+1]
new bool:AbePowerUsed[SH_MAXSLOTS+1]
new gMorphed[SH_MAXSLOTS+1]
new LightSprite
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Abe", "1.0", "NOmeR1")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("abe_level", "10")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "Insert your spirit into enemies", "You can insert your spirit into enemies", true, "abe_level")
// INIT
register_srvcmd("abe_init", "abe_init")
shRegHeroInit(gHeroName, "abe_init")
// EVENTS
register_event("ResetHUD", "newSpawn", "b")
// KEYDOWN
register_srvcmd("abe_kd", "abe_kd")
shRegKeyDown(gHeroName, "abe_kd")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
// Precache lighting
LightSprite = precache_model("sprites/lgtning.spr")
// Precache sound
precache_sound("shmod/abe_sound.wav")
}
//----------------------------------------------------------------------------------------------
public abe_init()
{
// First Argument is an id who has abe
new temp[6]
read_argv(1,temp,5)
new id = str_to_num(temp)
if(!is_user_alive(id))
return PLUGIN_HANDLED
// 2nd Argument is 0 or 1 depending on whether the id has abe
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)
gHasAbePower[id] = (hasPowers != 0)
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public abe_kd()
{
// First Argument is an id who has abe
new temp[6]
read_argv(1,temp,5)
new id = str_to_num(temp)
if(!is_user_alive(id))
return PLUGIN_HANDLED
// Use power once per round
if(!AbePowerUsed[id])
{
new origin[3], modelVictim[32], originVictim[3], weapons[32], wpname[32]
new Float:anglesVictim[3]
new body, victimID, weaponsCount
// Get target id
get_user_aiming(id, victimID, body)
if(get_user_team(id) != get_user_team(victimID) && victimID > 0 && victimID <= SH_MAXSLOTS)
{
emit_sound(id, CHAN_AUTO, "shmod/abe_sound.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
AbePowerUsed[id] = true
// Set victim's model to Abe
get_user_info(victimID, "model", modelVictim, 32)
morph_model(id, modelVictim)
// Get origin from victim and Abe
get_user_origin(id, origin, 0)
get_user_origin(victimID, originVictim, 0)
// Set origin to victim Abe
set_user_origin(id, originVictim)
set_user_origin(victimID, origin)
// Get aiming from victim
pev(victimID, pev_angles, anglesVictim)
// Set aiming of victim to Abe
set_pev(id, pev_angles, anglesVictim)
set_pev(id, pev_fixangle, 1)
// Light effects (credits to AssKicR and JTP10181)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(8)
write_short(id) // start entity
write_short(victimID) // entity
write_short(LightSprite) // model
write_byte(0) // starting frame
write_byte(15) // frame rate
write_byte(7) // life
write_byte(50) // line width
write_byte(30) // noise amplitude
write_byte(255) // r, g, b
write_byte(255) // r, g, b
write_byte(255) // r, g, b
write_byte(192) // brightness
write_byte(0) // scroll speed
message_end()
// Get armor, health, gravity and money from victim
new armor = get_user_armor(victimID)
new health = get_user_health(victimID)
new Float:gravity = get_user_gravity(victimID)
new money = cs_get_user_money(victimID)
// Get victim's weapons
get_user_weapons(victimID, weapons, weaponsCount)
// Killing victim
user_kill(victimID, 1)
// Give armor, health, gravity and money to Abe
set_user_armor(id, armor)
set_user_health(id, health)
set_user_gravity(id, gravity)
cs_set_user_money(id, money, 0)
// Give victim's weapons to Abe
for(new wpn = 0; wpn <= weaponsCount; wpn++)
{
if(!user_has_weapon(id, weapons[wpn]))
{
get_weaponname(weapons[wpn], wpname, 31)
give_item(id, wpname)
}
}
client_print(id, print_chat, "[SH](Abe) You have used your Abe power")
}
else
{
client_print(id, print_chat, "[SH](Abe) You have no target")
}
}
else
{
client_print(id, print_chat, "[SH](Abe) You cannot use your Abe power on this round again")
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
if(gHasAbePower[id])
{
unmorph_model(id)
AbePowerUsed[id] = false
}
}
//----------------------------------------------------------------------------------------------
public morph_model(id, model[])
{
if(!gMorphed[id])
{
cs_set_user_model(id, model)
gMorphed[id] = true
}
}
//----------------------------------------------------------------------------------------------
public unmorph_model(id)
{
if(gMorphed[id])
{
cs_reset_user_model(id)
gMorphed[id] = false
}
}
//----------------------------------------------------------------------------------------------
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.