I would like to make that when the player leaves the game, time stops counting, and when it returns, the time goes back to where it stopped. For example, if the point is received every 1 hour, if the player leaves after 20 minutes, when he enters again, the time continues at 20 minutes, this way the player does not waste time if he needs to change char or disconnected .
query_sql("SELECT `last_unique_id` FROM `login` WHERE `account_id` = '"+getcharid(3)+"'", .@s_last_unique_id$);
query_logsql("SELECT value FROM `sader_variables_log` WHERE unique_id = '"+.@s_last_unique_id$+"' AND `variable` = '#Hourly_Rewads_Check'", .@s_GePard);
if(.@s_GePard >= #Hourly_Rewads_Check){
message strcharinfo(0),"[Hourly Rewards]: You already got the Hourly Rewards from this PC";
query_logsql("Update `sader_variables_log` SET `value` = '"+#Hourly_Rewads_Check+"' WHERE `unique_id`= '"+.@s_last_unique_id$+"' AND `variable` = '#Hourly_Rewads_Check'");
}else if(.s_GePard_ip == 2){
query_logsql("SELECT value FROM `sader_variables_log` WHERE ip = '"+getcharip()+"' AND `variable` = '#Hourly_Rewads_Check'", .@s_ip);
if(.@s_ip >= #Hourly_Rewads_Check){
message strcharinfo(0),"[Hourly Rewards]: You already got the Hourly Rewards from this IP";
query_logsql("Update `sader_variables_log` SET `value` = '"+#Hourly_Rewads_Check+"' WHERE `ip`= '"+getcharip()+"' AND `variable` = '#Hourly_Rewads_Check'");
}
message strcharinfo(0),"[Hourly Rewards]: you Gain your Reward.";
.s_hourly_level = 0; // Minimam level to get the Houerly rewards / 0 = no minimem level , DEFAULT 0
.s_GePard_ip = 0; // 0 = no Gepard / 1 = Gepard / 2 = IP , DEFAULT 0
.s_vinding = 7; // DEFAULT 7 / 0 = will give the reward even if vending / 1 = no normal vending / 2 = no @autotrade / 4 = no buyingstore | Example: if you want to ban normal vend and buying store you add the numbers 1+4=5
query_logsql("CREATE TABLE IF NOT EXISTS `sader_variables_log` (`unique_id` INT( 11 ) UNSIGNED NOT NULL DEFAULT '0',`ip` VARCHAR(100) NOT NULL,`variable` VARCHAR(32) NOT NULL, `index` INT NOT NULL, `value` INT NOT NULL,`account_id` INT NOT NULL,`char_id` INT NOT NULL,`char_name` VARCHAR(30) NOT NULL) ENGINE=MyISAM");
//getitem 905,1; // if you want to add items as reward you can add them here like that
//getexp 10000,5000; // if you wanna add exp as reward add them here like that
//if(#Hourly_Rewads_Check == 5){getitem 905,1;} // like this you can add reward for Xhr and this reward will be given for that X in this example 5 mean that the player did pass 5hr
//if(#Hourly_Rewads_Check >= 5){getitem 905,1;} // like this you can add reward for Xhr and this reward will be given for that X in this example 5 mean that the player did pass 5hr or more
I would like to make that when the player leaves the game, time stops counting, and when it returns, the time goes back to where it stopped. For example, if the point is received every 1 hour, if the player leaves after 20 minutes, when he enters again, the time continues at 20 minutes, this way the player does not waste time if he needs to change char or disconnected .
Is it possible?
Share this post
Link to post
Share on other sites