Jump to content
  • 0

Hourly points


Dev Blaze

Question


  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  212
  • Reputation:   5
  • Joined:  01/24/12
  • Last Seen:  

Hello  can i ask how to add hourly points (will not work for people vending/auto-trading) script link https://pastebin.com/ry0JJp6U  credit Emistry

  1.  
  2. -   script  hourly_point_main   -1,{
  3.    
  4.     OnInit:
  5.         .npc_name$ = strnpcinfo(3);
  6.         bindatcmd "check",.npc_name$+"::OnAtcommand";
  7.         end;
  8.        
  9.     OnAtcommand:
  10.         dispbottom "Accumulated "+#daily_minute_count;
  11.         end;
  12.        
  13.     OnUpdate:
  14.         #daily_minute_count++;
  15.         deltimer .npc_name$+"::OnUpdate";
  16.         dispbottom "Accumulated "+#daily_minute_count+" minute(s)";
  17.         switch ( #daily_minute_count ) {
  18.             default:
  19.                 break;
  20.             case 60: // 60 minutes
  21.                 #CASHPOINT += 1;
  22.                 getitem 512,1;
  23.                 break;
  24.             case 120: // 120 minutes
  25.                 #CASHPOINT += 2;
  26.                 getitem 512,2;
  27.                 break;
  28.             case 180: // 180 minutes
  29.                 #CASHPOINT += 3;
  30.                 getitem 512,3;
  31.                 break;
  32.             case 240: // 240 minutes
  33.                 #CASHPOINT += 4;
  34.                 getitem 512,4;
  35.                 break;
  36.             case 300: // 300 minutes
  37.                 #CASHPOINT += 5;
  38.                 getitem 512,6;
  39.                 break;
  40.             case 360: // 360 minutes
  41.                 #CASHPOINT += 6;
  42.                 getitem 512,7;
  43.                 break;
  44.             case 420: // 420 minutes
  45.                 #CASHPOINT += 7;
  46.                 getitem 512,8;
  47.                 break;
  48.             case 480: // 480 minutes
  49.                 #CASHPOINT += 8;
  50.                 getitem 512,9;
  51.                 #daily_minute_count = 0; // reset.
  52.                 break;
  53.         }
  54.        
  55.     OnPCLoginEvent:
  56.         addtimer ( 60 * 1000 ), .npc_name$+"::OnUpdate";
  57.         end;
  58. }

 

Edited by Dev Blaze
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  281
  • Reputation:   14
  • Joined:  10/14/13
  • Last Seen:  

@Dev Blaze Add this below 'OnUpate' label

if(checkvending() >= 1) {
	dispbottom "Vending is not allowed.";
	deltimer .npc_name$+"::OnUpdate";
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  68
  • Topics Per Day:  0.02
  • Content Count:  212
  • Reputation:   5
  • Joined:  01/24/12
  • Last Seen:  

thanks Aureon

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...