Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - script Sample -1,{
- OnInit:
- // item ID + amount
- set .item_id,512;
- set .item_amount,10;
- // online for how many hour
- set .online_hours,12;
- // check player status every 15 minute.
- set .check_interval_minute,15;
- set .strnpcinfo$,strnpcinfo(0);
- end;
- OnPCLoginEvent:
- set .@gettimetick,gettimetick(1);
- set .@time_gap,( .@gettimetick - #hour_time_online );
- if( .@time_gap > 60 ){
- set #hour_time_total,0;
- dispbottom "Reset Accumulated Online Time ... because you logoff for 1 minutes.";
- }
- set #hour_time_online,.@gettimetick;
- end;
- OnCheck:
- set #hour_time_online,gettimetick(1);
- if( checkvending() || checkchatting() ){
- set @chat_vending_user,1;
- deltimer .strnpcinfo$+"::OnCheck";
- dispbottom "Timer Stopped...user opened Public Chat / Vending...Please relog to re-enable it again.";
- }else{
- addtimer ( .check_interval_minute * 60000 ),.strnpcinfo$+"::OnCheck";
- set #hour_time_total,#hour_time_total + ( .check_interval_minute * 60 );
- if( #hour_time_total >= ( .online_hours * 3600 ) ){
- mes "You have gained Items for online "+.online_hours+" hours non-stop.";
- close2;
- set #hour_time_total,#hour_time_total - ( .online_hours * 3600 );
- getitem .item_id,.item_amount;
- }
- }
- end;
- OnPCLogoutEvent:
- if( !@chat_vending_user ){
- set .@gettimetick,gettimetick(1);
- set .@time_gap,( .@gettimetick - #hour_time_online );
- set #hour_time_total,#hour_time_total + .@time_gap;
- set #hour_time_online,.@gettimetick;
- deltimer .strnpcinfo$+"::OnCheck";
- }
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment