give_point <名称> <给予的数量>
复制程式
public plugin_init()
register_concmd("give_point", "cmd_give_point", ADMIN_KICK, "- give_point <name> <amount> : Give Point")
复制程式
public cmd_give_point(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new arg_name[4], arg_amount
read_argv(1, arg_name, 3)
read_argv(2, arg_amount, 3)
new target = cmd_target(id, arg_name, 2)
if (!target)
{
client_print(id, print_console, "Player not found")
return PLUGIN_HANDLED
}
g_point[target] += str_to_num(arg_amount)
return PLUGIN_HANDLED
}
如何把point储存纪录于
config资料夹里的save_point.ini内
一个比较简单的方法
但将会记录在addons\amxmodx\logs\中的.log档
复制程式
public cmd_give_point(id, level, cid)
{
if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED
new arg_name[4], arg_amount
read_argv(1, arg_name, 3)
read_argv(2, arg_amount, 3)
new target = cmd_target(id, arg_name, 2)
if (!target)
{
client_print(id, print_console, "Player not found")
return PLUGIN_HANDLED
}
g_point[target] += str_to_num(arg_amount)
new name[32], name2[32]
get_user_name(id, name, 31)
get_user_name(target, name2, 31)
log_amx("[Give Point] Admin ^"%s^" gives %i point to ^"%s^""
, name, str_to_num(arg_amount), name2)
return PLUGIN_HANDLED
}