下面是引用 tw2twtw 于 2011-12-11 08:38 发表的 :
复制程式
public plugin_natives()
{
register_native("set_user_point", "native_set_point", 1)
}
//执行
public native_set_point(id, amount)
{
// 设定点数
point[id] = amount
//要不要回传都随便...
return point[id]
}
然后inc打
native set_user_point(id, amount)
行了..谢谢大大喔:)
另外
我储存资料和载入资料有点问题
public SaveData(id)
{
new name[32], vaultkey[64], vaultdata[256]
get_user_name(id, name, 31)
format(vaultkey, 63, "%s", name)
format(vaultdata, 255, "%i#%i#%i#", g_pret[id], g_ak4760r[id], g_ncpts[id])
nvault_set(g_vault, vaultkey, vaultdata)
client_print(id, print_chat, "保存记录成功")
}
public LoadData(id)
{
new name[32], vaultkey[64], vaultdata[256]
get_user_name(id,name,31)
format(vaultkey, 63, "%s", name)
format(vaultdata, 255, "%i#%i#%i#", g_pret[id], g_ak4760r[id], g_ncpts[id])
nvault_get(g_vault, vaultkey, vaultdata, 255)
replace_all(vaultdata, 255, "#", " ")
new pret[32], ak4760r[32], ncpts[32]
parse(vaultdata, pret, 31, ak4760r, 31, ncpts, 31)
g_pret[id] = str_to_num(pret)
g_ak4760r[id] = str_to_num(ak4760r)
g_ncpts[id] = str_to_num(ncpts)
return PLUGIN_CONTINUE
}
有什么问题呢?