Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - script login_rewards_system -1,{
- end;
- OnInit:
- // Items that will be reward and respective quantities
- // Always leave the last field 0, maximum fields 127
- setarray .item_reward[0],ID1,ID2,0;
- setarray .item_reward_qt[0],QT_ID1,QT_ID2,0;
- // Time lapse between prizes in seconds
- set .time_lapse,60*60*2;
- end;
- OnPCLoginEvent:
- set lrs_passed,0;
- set lrs_passed_total, 0;
- set lrs_prize,0;
- // Timer loop
- attachnpctimer; // Attach player to timer
- initnpctimer;
- end;
- OnTimer1000: // 1 second
- set lrs_passed, lrs_passed+1;
- set lrs_passed_total, lrs_passed_total+lrs_passed;
- if( lrs_passed >= .time_lapse )
- {
- set lrs_passed,0;
- if( .item_reward[lrs_prize] == 0 && lrs_prize > 0 )
- set lrs_prize,lrs_prize-1;
- getitem .item_reward[lrs_prize], .item_reward_qt[lrs_prize];
- dispbottom "Congratulations you are online for "+lrs_passed_total+" consecutive seconds!";
- set lrs_prize, lrs_prize+1;
- }
- initnpctimer; // Reset npc timer
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement