Jump to content
  • 0

H> Hourly Points


GM Winter

Question


  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

how to modify this that the autotrade players cant have an points but the online players that idle can also get points

 

Quote

-    script hourly_point_main -1,{
 
    OnInit:
        .npc_name$ = strnpcinfo(3);
        bindatcmd "check",.npc_name$+"::OnAtcommand";
        end;
 
    OnAtcommand:
        dispbottom "Accumulated "+#daily_minute_count;
        end;
 
    OnUpdate:
        #daily_minute_count++;
        deltimer .npc_name$+"::OnUpdate";
        switch ( #daily_minute_count ) {
            default:
                break;
            case 60: // 60 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 120: // 120 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 180: // 180 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 240: // 240 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 300: // 300 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 360: // 360 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 420: // 420 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                break;
            case 480: // 480 minutes
                #CASHPOINT += 1;
                getitem 677,1;
                #daily_minute_count = 0; // reset.
                break;
        }
 
    OnPCLoginEvent:
        addtimer ( 60 * 1000 ), .npc_name$+"::OnUpdate";
        end;
}

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2351
  • Joined:  10/28/11
  • Last Seen:  

OnUpdate:
	if (checkvending() & 2) end;   // <--- add this line

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

9 hours ago, Emistry said:
OnUpdate:
	if (checkvending() & 2) end;   // <--- add this line

 

just like this?

    OnUpdate:
        if (checkvending() & 2) end;
        #daily_minute_count++;
        deltimer .npc_name$+"::OnUpdate";
        switch ( #daily_minute_count ) {

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  51
  • Topics Per Day:  0.01
  • Content Count:  177
  • Reputation:   10
  • Joined:  04/02/12
  • Last Seen:  

4 hours ago, GM Winter said:

just like this?

    OnUpdate:
        if (checkvending() & 2) end;
        #daily_minute_count++;
        deltimer .npc_name$+"::OnUpdate";
        switch ( #daily_minute_count ) {

Yes, it should stop the code in that line if it satisfies the condition.

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...