PHP Code:
public client_disconnect(id)
{
if(get_pcvar_num(lives) == 1)
{
set_task(8.0, "RestKarmaLive", id)
}
}
public RestKarmaLive(id)
{
if(!is_user_connected(id)){
LoadKarma(id);
new name[32];
get_user_name(id, name, 31)
karma[id] -= 1;
client_print(0,print_chat, "%L", LANG_PLAYER, "LIVE_QUIT", name, 1)
server_print("%s lost karma! KARMA: %d", name, karma[id])
SaveKarma(id);
}
}
Hi.. i tried if the user disconnect ( with the cvar sv_live == 1 ) , and not reconnect yet in 8 seconds.., karma[id] -= 1(in nvault) .. and he's reconnect before past 8 second do nothing(duh)..
the LoadKarma ( just extrat values from nVault )
and the SaveKarma ( -.- saving nVault values).
server_print and the task work, but not decreasing 1 in the karma[id] ..
thx...