yuhsing

Untitled

Jul 4th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. - script hourlypoints -1,{
  2.  
  3. //--Start of the Script
  4. OnPCLoginEvent:
  5. attachnpctimer ""+strcharinfo(0)+"";
  6. initnpctimer;
  7. end;
  8.  
  9. OnTimer30000:
  10. //Check if Vending (normal or @at)
  11. query_sql( "SELECT`account_id` FROM `char` WHERE `online` > 0 AND `account_id` IN ( SELECT `account_id` FROM `login` WHERE `last_ip` IN ( SELECT `last_ip` FROM `login` WHERE `account_id` = '"+getcharid(3)+"' ) ) LIMIT 128",.@count );
  12. if( getarraysize( .@count ) >= 2 ){
  13. dispbottom "The hourly points event stopped because same ip has login more than once. Please relog if you wish to start again.";
  14. stopnpctimer;
  15. end;
  16. }
  17. if(checkvending() >= 1 || checkchatting() == 1) {
  18. dispbottom "The hourly points event stopped because you were vending / chatting. Please relog if you wish to start again.";
  19. stopnpctimer;
  20. end;
  21. }
  22. //Check if Idle
  23. getmapxy( .@map$, .@x, .@y, 0 );
  24. if(@map$ == .@map$ && @x == .@x && @y == .@y) {
  25. set @afk, @afk + 1;
  26. }
  27. //If move timer resets
  28. else {
  29. set @afk, 0;
  30. }
  31. set @map$, .@map$; set @x, .@x; set @y, .@y;
  32. //Idle Check for 15 Minutes
  33. if(@afk == 15) {
  34. dispbottom "The hourly points event stopped because you were idle for 15 minutes. Please relog if you wish to start again.";
  35. stopnpctimer;
  36. end;
  37. }
  38. end;
  39.  
  40. OnTimer60000:
  41. set @minute, @minute + 1;
  42. //Check for 1 Minute
  43. if(@minute == 60){
  44. set @minute,0;
  45. set .@point_amt, 5; //Points to get every hour (default: 5)
  46. set #CASHPOINTS, #CASHPOINTS + .@point_amt;
  47. dispbottom "You received "+.@point_amt+" Cash Points by staying ingame for 1 hour";
  48. dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
  49. set @consecutive_hour, @consecutive_hour + 1;
  50. }
  51. //Check for 12 hours consecutive
  52. if(@consecutive_hour == 12) {
  53. set @consecutive_hour,0;
  54. set .@cpoint_amt, 50; //Points to get for 12 Consecutive hours (default: 50)
  55. set #CASHPOINTS, #CASHPOINTS + .@cpoint_amt;
  56. dispbottom "You receive "+.@cpoint_amt+" Cash Points in playing for 12 consecutive hours";
  57. dispbottom "Current Balance = "+#CASHPOINTS+" Cash Points";
  58. }
  59. stopnpctimer;
  60. initnpctimer;
  61. end;
  62.  
  63. }
Advertisement
Add Comment
Please, Sign In to add comment