You should make it as simply it can be and to don't waste resources and here we go:
use it only 1 time for each user.How we do this?Simply,introduce it in a stored procedure(WZ_DISCONNECT_MEMB) or use it as a trigger(ex: onlinehours).
here is an example of trigger that do a similar thing:
PHP Code:
USE [MuOnline]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[MembStat_RecordOnlineHours] ON [dbo].[MEMB_STAT]
AFTER UPDATE
AS
declare @memb___id varchar(10)
declare @connectstat tinyint
SELECT @memb___id=memb___id,@connectstat=connectstat FROM INSERTED
IF (@connectstat = 0)
BEGIN
UPDATE [dbo].[MEMB_STAT]
SET OnlineHours = OnlineHours + datediff(hour, ConnectTM, getdate())
WHERE memb___id = @memb___id
END
it update the online hours and you can modify it to add the points too,just need to debug it a little.