oblinez Posted July 13, 2014 Posted July 13, 2014 hi can i request an npc? a simple npc who gives hourly points with a sistem security this npc dont give points for player who stay stopped for more than 15 minutes and this npc dont give points for players under @autotradeThanks in advance Quote
Skorm Posted July 13, 2014 Posted July 13, 2014 (edited) - script hourlypoints -1,{ OnPCLoginEvent: attachnpctimer(); startnpctimer(); end; OnTimer3600000: if( checkidle() < 900 && !@autotrade ) { .@mes$ = ""; set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt; dispbottom "You received "+.point_amt+" Kafrapoints by staying in-game for 1 hour"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; set @consecutive_hour, @consecutive_hour + 1; //Check for 3 hours consecutive if(@consecutive_hour == 3) { set @consecutive_hour,0; set #KAFRAPOINTS, #KAFRAPOINTS + .cpoint_amt; dispbottom "You receive "+.cpoint_amt+" Kafrapoints for 3 consecutive hours of play."; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; } } else if( !getstrlen(.@mes$) ) { .@mes$ = "While afk for 15 minutes or more you will not receive hourly points."; dispbottom .@mes$; } attachnpctimer(); initnpctimer(); end; OnCommand: @autotrade = 1; atcommand "@autotrade"; end; OnInit: bindatcmd "autotrade","hourlypoints::OnCommand"; set .cpoint_amt, 50; //Points gained for consecutive time online. set .point_amt, 10; //Normal points gained. } Edited July 13, 2014 by Skorm Caught something I missed. 1 Quote
oblinez Posted July 18, 2014 Author Posted July 18, 2014 (edited) - script hourlypoints -1,{ OnPCLoginEvent: attachnpctimer(); startnpctimer(); end; OnTimer3600000: if( checkidle() < 900 && !@autotrade ) { .@mes$ = ""; set #KAFRAPOINTS, #KAFRAPOINTS + .point_amt; dispbottom "You received "+.point_amt+" Kafrapoints by staying in-game for 1 hour"; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; set @consecutive_hour, @consecutive_hour + 1; //Check for 3 hours consecutive if(@consecutive_hour == 3) { set @consecutive_hour,0; set #KAFRAPOINTS, #KAFRAPOINTS + .cpoint_amt; dispbottom "You receive "+.cpoint_amt+" Kafrapoints for 3 consecutive hours of play."; dispbottom "Current Balance = "+#KAFRAPOINTS+" Kafrapoints"; } } else if( !getstrlen(.@mes$) ) { .@mes$ = "While afk for 15 minutes or more you will not receive hourly points."; dispbottom .@mes$; } attachnpctimer(); initnpctimer(); end; OnCommand: @autotrade = 1; atcommand "@autotrade"; end; OnInit: bindatcmd "autotrade","hourlypoints::OnCommand"; set .cpoint_amt, 50; //Points gained for consecutive time online. set .point_amt, 10; //Normal points gained. } skorm thx alot bro but i forget one detail... coud u edit this script to work with hourlypoints table on login db? and can you disable the "//Check for 3 hours consecutive" ?? skorm, if( checkidle() < 900 && !@autotrade ) <<<this part block @at too? or any command to open shop? Edited July 18, 2014 by oblinez Quote
Question
oblinez
Thanks in advance
2 answers 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.