Online Gaming Time

Simple script Online exchange Point ?
 
Code:
prontera,150,180,4      script  OnlineGamingTime        100,{        .@tick = 0;        query_sql "UPDATE `onlinetime` SET `total_sec` = `total_sec` + TIMESTAMPDIFF(SECOND, `start_time`,  NOW()), `start_time` = NOW() WHERE `account_id` = "+getcharid(3);        query_sql "SELECT `total_sec` FROM `onlinetime` WHERE `account_id` = "+getcharid(3), .@tick;        mes "Your online time is:";        mes "[ "+callfunc("Time2Str", gettimetick(2)+.@tick)+" ]";        @tick = .@tick;        if(prompt("[100t ---> 1p]", "[close]") == 1 && @tick >= 100) {                @tick -= 100;                #CASHPINTS += 1;        }        query_sql "UPDATE `onlinetime` SET `total_sec` = "+@tick+" WHERE `account_id` = "+getcharid(3);        .@tick = 0;        @tick = 0;        close;
 
Last edited by a moderator:
@@goddameit

Is it possible to capture a player's entire online time? Like it would help determine if a player has been playing for 20 hours (that could be used in a referral system where GMs need to check if the player has been active for a definite time before reward will be given to the referrer)

 
Is it possible for this to count the actual online time and not the entire online time?

 
Hello Sir,

I am getting this error when I query:

MySQL said: 

#1067 - Invalid default value for 'start_time'

 
hi.

i got this error 

[Debug]: script debug : 0 110012807 : [OnlineTime]: Auto-Backup player date.


can i know what the problem?

 
Back
Top