Actually i have made some progress , But the issue is when i install this plugin , The server crashes
PHP Code:
public plugin_natives()
{
// Player natives //
register_native("get_user_point", "native_get_user_point", 1);
register_native("set_user_point", "native_set_user_point", 1);
}
public My_Point(id)
{
if(!is_user_alive(id) && is_user_connected(id))
return PLUGIN_HANDLED;
client_print_color(id, print_chat, "^4[%s] you have %d points.", TAG, g_iPoints[id])
return PLUGIN_HANDLED
}
Load(id)
{
new szAuthId[32]; get_user_authid(id, szAuthId, charsmax(szAuthId));
new szData[200], iTimeStamp;
if(nvault_lookup(g_iVault, szAuthId, szData, charsmax(szData), iTimeStamp))
{
new szSavedname[32], szPoint[16];
parse(szData, szSavedname, charsmax(szSavedname), szPoint, charsmax(szPoint))
remove_quotes(szSavedname)
remove_quotes(szPoint)
set_user_info(id, "name", szSavedname)
g_iPoints[id] = str_to_num(szPoint)
}
}
// Native: get_user_point
public native_get_user_point(id)
{
return g_iPoints[id];
}
// Native: set_user_point
public native_set_user_point(id, amount)
{
g_iPoints[id] = amount;
}