Advertisement
Innos

Daily Online User Roulette

Sep 29th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.99 KB | None | 0 0
  1. //=============================================================//
  2. // Daily Online User Roulette                                  //
  3. //==== Copyright ==============================================//
  4. // Innos '2010 for www.ex-RO.de                                //
  5. //==== Version ================================================//
  6. // V.1.0 - Final **** Tested & Worked ****                     //
  7. //==== Infos ==================================================//
  8. // Special daily Event from 10a.m. to 10p.m.                   //
  9. // Set Random Hour an pick a Online User                       //
  10. // The Winner take a random price with message & Broadcast     //
  11. //=============================================================//
  12.  
  13. -       script  roulette        -1,{
  14.  
  15. OnClock1000:
  16. OnClock1100:
  17. OnClock1200:
  18. OnClock1300:
  19. OnClock1400:
  20. OnClock1500:
  21. OnClock1600:
  22. OnClock1700:
  23. OnClock1800:
  24. OnClock1900:
  25. OnClock2000:
  26. OnClock2100:
  27. OnClock2200:
  28.         if(gettime(3) == .rand)
  29.         {
  30.                 query_sql "SELECT `account_id` FROM `char` WHERE `online` = '1' ORDER BY `account_id` ASC",.@aid;
  31.                 if(!.@aid){ end; }
  32.                 for(set .@i,0; .@i < getarraysize(.@aid); set .@i,.@i+1)
  33.                 {
  34.                         set .@total,.@i;
  35.                 }
  36.                 set .rand2,(4);
  37.                 set .rand3,rand(.@total);
  38.                 for(set .@i,0; .@i < getarraysize(.@aid); set .@i,.@i+1)
  39.                 {
  40.                         if (attachrid(.@aid[.rand3])) {
  41.                                 getitem .items[.rand2],1;
  42.                         }
  43.                 }
  44.                 announce "The Winner of the Daily User Roulette is "+rid2name(.@aid[.rand3])+"! Gratulations!",bc_all;
  45.         }
  46. OnClock0955:
  47.         set .rand,rand(13);
  48.         end;
  49.  
  50. OnInit:
  51.         set .rand,rand(13);
  52.         setarray .items[0],616,12103,30000,12106;
  53.         end;
  54. }
  55.  
  56. /*
  57. #616 - Old Card Album
  58. #12103 - Bloddy Branch
  59. #30000 - exCoin
  60. #12106 -  Jewelry Box
  61. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement