只要儲存一個數據這樣更快吧...
複製程式
new name[33][32], point[33]
public client_putinserver(id)
{
get_user_name(id, name[id], charsmax(name[]))
get_point(id)
}
public get_point(id)
{
if(nvault_get(vault, name[id]))
{
point[id] = nvault_get(vault, name[id])
}
else
{
point[id] = 0
nvault_touch(vault, name[id])
}
}
public save_point(id)
{
new point_num[11]
formatex(point_num, charsmax(point_num) , "%d", point[id])
nvault_set(vault, name[id], point_num)
}
開頭我還以為要講 register_native
不過文中似乎完全沒有教到...