Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
public plugin_init()
{
register_plugin("AMX Health","1.0","Sonic") //this is easier then your defines
register_concmd("amx_health", "change_health", ADMIN_KICK, "<target> <health> - admin changes a users health ") //Needed args
}
public change_health(id,level,cid)
{
if (!cmd_access(id,level,cid, 3))//Thisautomatically prints a "no access" message
return PLUGIN_HANDLED
new arg[32], arg2[32]
read_argv(1,arg,31)//read_argv reads the arguments or the "target and health"
read_argv(2,arg2,31)
new target=cmd_target(id,arg,4)//4 means they must be alive
if(!target)
{
client_print(id,print_console,"[AMXX] Invalid target!")//if there is no one that matches the target, it prints the message
return PLUGIN_HANDLED
}
set_user_health(target,arg2)//target is the person your setting heatlh, arg2 is the second argument "<health>"
return PLUGIN_HANDLED
}