im a noob that started learning AMXX and i made a new plugin (yes i aslo used info from the tutorial and stuff) and i got a problem..
here is the script:
Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
new plugin[]="Health Plugin"
new autor[]="Haim"
new version[]="1.00"
public plugin_init()
{
register_plugin(plugin,version,autor)
register_concmd("addhp", "func_hp", ADMIN_LEVEL_A, "<target> <hp>")
register_cvar("togglehp", "1")
}
public func_hp(id, level, cid)
//--------------------------------------------------------[GENERAL STUFF]
{
if (!get_cvar_num("togglehp"))
{
console_print(id, "this function is off.. plz change togglehp to 1")
return PLUGIN_HANDLED
}
if (!cmd_access(id, level, cid, 3))
{
console_print(id, "sorry, ur too noob to use that command")
return PLUGIN_HANDLED
}
new arg[32]
new hp[3]
read_argv(1, arg, 31)
read_argv(2, hp, 2)
new hpf = str_to_num(hp)
//------------------------------------------------------[TEAM]
if (equali(arg[0],"@"))
{
new team = 0
if (equali(arg[1], "T"))
{
team = 1
} else
if (equali(arg[1], "C"))
{
team = 2
} else
if (equali(arg[1], "A"))
{
team = 3
} else
{
console_print(id, "No such team")
return PLUGIN_HANDLED
}
new team_players[32], nb, i
get_players(team_players, nb, "a")
for(i=0;i<nb;i++)
{
if(get_user_team(team_players[i])== team)
{
set_user_health(team_players[i], get_user_health(team_players[i])+hpf)
}
if(team == 3)
{
set_user_health(team_players[i], get_user_health(team_players[i])+hpf)
}
}
}
//------------------------------------------------------[SINGLE PLAYER]
if(!equali(arg[0], "@"))
{
new player = cmd_target(id, arg, 4)
if (!player)
{
console_print(id, "no such player")
return PLUGIN_HANDLED
} else {
set_user_health(player, get_user_health(player)+hpf)
}
}
return PLUGIN_HANDLED
}
everything is beeing compiled well.. but ingame when i try to add HP to a spacifc team the console says says:
"
-Client with that name or userid not found
-no such play
"