Hi ! I just need help how to lessen the points given whenever a player goes AFK or IDLE .. This is an old Hourly system , I want to just give 1 point to those Afk players . they will continue gaining points while idle but not same as active players who have 5 to 6 points ... Thankyou !
Hi ! I just need help how to lessen the points given whenever a player goes AFK or IDLE .. This is an old Hourly system , I want to just give 1 point to those Afk players . they will continue gaining points while idle but not same as active players who have 5 to 6 points ... Thankyou !
- script hourlypoints FAKE_NPC,{ OnInit: //announce "[30 Minutes Points System]: The system have been reloaded, please relog again to get more points.", bc_all; announce "[Hourly Reward System]: Hourly system has been reloaded, please relog again to get more points.", bc_all; .point_name$ = "Hourly Points"; .point_amt = 5; // Normal points gained. .dlimit = 900; // Stop points if afk greater then in seconds. 600s = 10 minutes //43200 .enable = 1; .level = 0; .online_time = 3600; // One hour = 3600 seconds bindatcmd "hourlytime", "hourlypoints::OnAtcommand", 0, 100; bindatcmd "hourlypoints", "hourlypoints::OnCheckPoints", 0, 100; end; OnPCLoginEvent: if (BaseLevel >= .level) { #idle = 0; @backup_time = 0; if (!#acctick || #acctick > .online_time) #acctick = gettimetick(2) + .online_time; else #acctick += gettimetick(2); while(.enable) { @idle_time = checkidle(); if (checkvending() >= 1 || checkchatting() == 1 || @idle_time >= .dlimit) // { #acctick += @idle_time; // Add idle time #idle = 1; dispbottom "The hourly points event haulted because you were vending, chatting, or idle."; } else { sleep2 1000; @backup_time = [email protected]_left = #acctick - gettimetick(2); if ([email protected]_left <= 0) { if (vip_status(1)) { #HOURLYPOINTS += .point_amt + 1; #acctick = gettimetick(2) + .online_time; dispbottom "[Hourly Reward System]: Gained " + .point_amt + " " + .point_name$ + " +1 " + .point_name$ + " [Vip Bonus]. Stay online and gain more points."; } else { #HOURLYPOINTS += .point_amt; #acctick = gettimetick(2) + .online_time; dispbottom "[Hourly Reward System]: Gained " + .point_amt + " " + .point_name$ + ". Total " + #HOURLYPOINTS + " Hourly Points. Stay online to gain more points."; } } else { [email protected]_left = .online_time - [email protected]_left; [email protected]$ = ""; [email protected] = [email protected]_left / 60; [email protected]_left -= ([email protected] * 60); if ([email protected] > 1) [email protected]$ += [email protected] + " minutes, "; else if ([email protected] > 0) [email protected]$ += [email protected] + " minute, "; if ([email protected]_left > 1 || [email protected]_left == 0) [email protected]$ += [email protected]_left + " seconds"; else if ([email protected]_left == 1) [email protected]$ += [email protected]_left + " second"; if ([email protected] == 15 && [email protected]_left == 0 || [email protected] == 30 && [email protected]_left == 0 || [email protected] == 45 && [email protected]_left == 0) dispbottom "[Hourly Reward System]: You spend a total of [" + [email protected]$ + "] playing."; } } if (#idle) break; } } end; OnPCLogoutEvent: // BackUP online time if (BaseLevel >= .level) { if (@backup_time) #acctick = @backup_time; } end; OnCheckPoints: dispbottom "[Hourly Reward System]: You have a total of ["+ #HOURLYPOINTS +"] Hourly Points.",0xRRGGBB; end; OnAtcommand: if (BaseLevel >= .level) { if (#idle) { [email protected]$ = ""; [email protected] = @idle_time / 60; [email protected]_left = @idle_time - ([email protected] * 60); if ([email protected] > 1) [email protected]$ += [email protected] + " minutes, "; else if ([email protected] > 0) [email protected]$ += [email protected] + " minute, "; if ([email protected]_left > 1 || [email protected]_left == 0) [email protected]$ += [email protected]_left + " seconds"; else if ([email protected]_left == 1) [email protected]$ += [email protected]_left + " second"; dispbottom "[Hourly Reward System]: You been idle for " + [email protected]$ + ". Please relog again.",0xRRGGBB; } else { [email protected]_left = @backup_time; [email protected]$ = ""; [email protected] = [email protected]_left / 60; [email protected]_left -= ([email protected] * 60); if ([email protected] > 1) [email protected]$ += [email protected] + " minutes, "; else if ([email protected] > 0) [email protected]$ += [email protected] + " minute, "; if ([email protected]_left > 1 || [email protected]_left == 0) [email protected]$ += [email protected]_left + " seconds"; else if ([email protected]_left == 1) [email protected]$ += [email protected]_left + " second"; dispbottom "[Hourly Reward System]: You have [" + [email protected]$ + "] left in able to gain a hourly points.",0xRRGGBB; } } end; }Link to comment
Share on other sites