PDA

View Full Version : Hero: Abe


NOmeR1
03-28-2008, 07:41
Abe

Description
Abe can insert his spirit into enemies

http://img206.**************/img206/1153/abedk2.gif
http://en.wikipedia.org/wiki/Abe_(Oddworld)

shconfig.cfg CVARS
//Abe
abe_level 10
Required file is a sound from game Abe's Oddysee.
Credits to AssKicR and JTP10181 for lighting effects (from magneto) :up:

micke1101
03-28-2008, 08:17
can you discribe it littel more?
is it like see through enemys eyes or something?:|

NOmeR1
03-28-2008, 08:41
Sorry for my bad English..
On key down you took over body of your target.

micke1101
03-28-2008, 10:50
ok sounds cool i will try it (when someone come in)

Emp`
03-28-2008, 23:02
Very nicely done. Good to see a new hero, though I find it a little "cheap" that it instant kills the victim. Nice job though.

kendra
07-07-2012, 04:11
//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
}
}
//----------------------------------------------------------------------------------------------

Jelle
07-07-2012, 08:31
If you are going to edit it then at least write it using 1.2 ways.

kendra
07-07-2012, 14:56
If you are going to edit it then at least write it using 1.2 ways.


I was just fixing a bug

Jelle
07-07-2012, 21:42
I was just fixing a bug

It still won't stand a chance to be approved when it is written using 1.18.

Bladell
11-02-2012, 05:06
Can you add a cvar for inserting your spirit several times?
I mean that you can insert your spirit only once/round.Can you add a cvar for cooldown or max inserts?
Thanks :D