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 = .@time_left = #acctick - gettimetick(2);
if (.@time_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
{
.@time_left = .online_time - .@time_left;
.@Time$ = "";
.@Minutes = .@time_left / 60;
.@time_left -= (.@Minutes * 60);
if (.@Minutes > 1)
.@Time$ += .@Minutes + " minutes, ";
else if (.@Minutes > 0)
.@Time$ += .@Minutes + " minute, ";
if (.@time_left > 1 || .@time_left == 0)
.@Time$ += .@time_left + " seconds";
else if (.@time_left == 1)
.@Time$ += .@time_left + " second";
if (.@Minutes == 15 && .@time_left == 0 || .@Minutes == 30 && .@time_left == 0 || .@Minutes == 45 && .@time_left == 0)
dispbottom "[Hourly Reward System]: You spend a total of [" + .@Time$ + "] 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)
{
.@Time$ = "";
.@Minutes = @idle_time / 60;
.@time_left = @idle_time - (.@Minutes * 60);
if (.@Minutes > 1)
.@Time$ += .@Minutes + " minutes, ";
else if (.@Minutes > 0)
.@Time$ += .@Minutes + " minute, ";
if (.@time_left > 1 || .@time_left == 0)
.@Time$ += .@time_left + " seconds";
else if (.@time_left == 1)
.@Time$ += .@time_left + " second";
dispbottom "[Hourly Reward System]: You been idle for " + .@Time$ + ". Please relog again.",0xRRGGBB;
}
else
{
.@time_left = @backup_time;
.@Time$ = "";
.@Minutes = .@time_left / 60;
.@time_left -= (.@Minutes * 60);
if (.@Minutes > 1)
.@Time$ += .@Minutes + " minutes, ";
else if (.@Minutes > 0)
.@Time$ += .@Minutes + " minute, ";
if (.@time_left > 1 || .@time_left == 0)
.@Time$ += .@time_left + " seconds";
else if (.@time_left == 1)
.@Time$ += .@time_left + " second";
dispbottom "[Hourly Reward System]: You have [" + .@Time$ + "] left in able to gain a hourly points.",0xRRGGBB;
}
}
end;
}
Question
Eross
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 = .@time_left = #acctick - gettimetick(2); if (.@time_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 { .@time_left = .online_time - .@time_left; .@Time$ = ""; .@Minutes = .@time_left / 60; .@time_left -= (.@Minutes * 60); if (.@Minutes > 1) .@Time$ += .@Minutes + " minutes, "; else if (.@Minutes > 0) .@Time$ += .@Minutes + " minute, "; if (.@time_left > 1 || .@time_left == 0) .@Time$ += .@time_left + " seconds"; else if (.@time_left == 1) .@Time$ += .@time_left + " second"; if (.@Minutes == 15 && .@time_left == 0 || .@Minutes == 30 && .@time_left == 0 || .@Minutes == 45 && .@time_left == 0) dispbottom "[Hourly Reward System]: You spend a total of [" + .@Time$ + "] 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) { .@Time$ = ""; .@Minutes = @idle_time / 60; .@time_left = @idle_time - (.@Minutes * 60); if (.@Minutes > 1) .@Time$ += .@Minutes + " minutes, "; else if (.@Minutes > 0) .@Time$ += .@Minutes + " minute, "; if (.@time_left > 1 || .@time_left == 0) .@Time$ += .@time_left + " seconds"; else if (.@time_left == 1) .@Time$ += .@time_left + " second"; dispbottom "[Hourly Reward System]: You been idle for " + .@Time$ + ". Please relog again.",0xRRGGBB; } else { .@time_left = @backup_time; .@Time$ = ""; .@Minutes = .@time_left / 60; .@time_left -= (.@Minutes * 60); if (.@Minutes > 1) .@Time$ += .@Minutes + " minutes, "; else if (.@Minutes > 0) .@Time$ += .@Minutes + " minute, "; if (.@time_left > 1 || .@time_left == 0) .@Time$ += .@time_left + " seconds"; else if (.@time_left == 1) .@Time$ += .@time_left + " second"; dispbottom "[Hourly Reward System]: You have [" + .@Time$ + "] left in able to gain a hourly points.",0xRRGGBB; } } end; }
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.