if made a plugin to calculate playtime per wipe what happens is apon player disconnect this code fires witch places connected time to datafile
float count = 0;
if (playFile[player.UserIDString,player.displayName] == null)
{
count = 0;
}
else
{
count = float.Parse(playFile[player.UserIDString,player.displayName].ToString());
}
float result = (count + player.net.connection.GetSecondsConnected() - CheckIdleTime(player));
playFile[player.UserIDString , player.displayName] = result;
playFile.Save();
and idle time gets calcutlated with this function
float CheckIdleTime(BasePlayer player)
{
float time = 0;
if (player.IdleTime >= 240)
{
time = player.IdleTime;
}
return time;
}
but i need a way to get that deducted when player gets out of ille aswell not just if he disconnects while in idle
if someone can help maybe im doing this wrong all input would help
thanks
NooBlet
float count = 0;
if (playFile[player.UserIDString,player.displayName] == null)
{
count = 0;
}
else
{
count = float.Parse(playFile[player.UserIDString,player.displayName].ToString());
}
float result = (count + player.net.connection.GetSecondsConnected() - CheckIdleTime(player));
playFile[player.UserIDString , player.displayName] = result;
playFile.Save();
and idle time gets calcutlated with this function
float CheckIdleTime(BasePlayer player)
{
float time = 0;
if (player.IdleTime >= 240)
{
time = player.IdleTime;
}
return time;
}
but i need a way to get that deducted when player gets out of ille aswell not just if he disconnects while in idle
if someone can help maybe im doing this wrong all input would help
thanks
NooBlet