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 > 15 ){
- set #hour_time_total,0;
- dispbottom "Reset Accumulated Online Time ... because you logoff for 15 seconds.";
- }
- set #hour_time_online,.@gettimetick;
- addtimer ( .check_interval_minute * 60000 ),.strnpcinfo$+"::OnCheck";
- end;
- OnCheck:
- set #hour_time_online,gettimetick(1);
- deltimer .strnpcinfo$+"::OnCheck";
- 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:
- 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