I have created only hero, who can see how much AP and HP have target
Code:
#include <amxmodx>
#include <superheromod>
#include <fun>
new gHeroName[] = "Neji Hyuuga"
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Neji Hyuuga", "1.0", "NOmeR1")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("hyuuga_level", "0")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "See how much AP and HP have target", "You can see how much AP and HP have target", false, "solid_level")
// INIT
register_srvcmd("hyuuga_init", "hyuuga_init")
shRegHeroInit(gHeroName, "hyuuga_init")
}
//----------------------------------------------------------------------------------------------
public hyuuga_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 Solid Snake
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)
if(!is_user_connected(id) || !shModActive()) return
if(hasPowers)
{
set_task(0.1, "hyuuga_power", id, "", 0, "b")
}
else
{
remove_task(id)
}
}
//----------------------------------------------------------------------------------------------
public hyuuga_power(id)
{
if(is_user_alive(id))
{
new target, body
get_user_aiming(id, target, body)
if(target > 0 && target <= SH_MAXSLOTS)
{
new name[SH_MAXSLOTS+1]
get_user_name(target, name, SH_MAXSLOTS)
client_print(id, print_center, "%s: HP - %d, AP - %d.", name, get_user_health(target), get_user_armor(target))
}
}
}
//----------------------------------------------------------------------------------------------