Jump to content
  • 0

How to enable this command after 1 hour?


Meister

Question


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

OnInit: bindatcmd("dailyreward",strnpcinfo(0)+"::OnAtCmd"); end;
OnAtCmd:
if (#dailyreward > gettimetick(2)) {
     message strcharinfo(0),"You must wait 24 hours before receiving more items.";
     end;
}
// getitem x,y;
set #dailyreward, gettimetick(2)+86400;
end;

 

Player must be online first for 1 hour before he/she can use this command.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  280
  • Topics Per Day:  0.06
  • Content Count:  841
  • Reputation:   17
  • Joined:  04/16/12
  • Last Seen:  

 

I'll try this thank you.

 

Error:

[Error]:  Loading NPC file: npc/custom/gamestat.txt
script error on npc/custom/gamestat.txt line 24
    parse_callfunc: not enough arguments, expected ','
    19 :        set .@m,.@time / 60 % 60;
    20 :        set .@s,.@time % 60;
    21 :        dispbottom "You have played "+.@d+"d "+.@h+"h "+.@m+"m and "+.@s
+"s total.";
    22 :        end;
    23 : OnDaily:
*   24 :        .@day = atoi( gettimestr("%Y%m%d"')' );
    25 :        if( #dailyreward <= .@day ){
    26 :                message strcharinfo(0),"You have take the item for today
.";
    27 :        }else if( @online > gettimetick(2) ){
    28 :                message strcharinfo(0),"You must wait 24 hours before re
ceiving more items.";
    29 :        }else{
Edited by Gnome
Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   616
  • Joined:  07/05/12
  • Last Seen:  


- script Sample -1,{

OnInit:

bindatcmd "dailyreward",strnpcinfo(3)+"::OnAtCommand";

end;

OnAtCommand:

.@day = atoi( gettimestr("%Y%m%d",19) );

if( #dailyreward == .@day ){

message strcharinfo(0),"You have take the item for today.";

}else if( @online > gettimetick(2) ){

message strcharinfo(0),"You must wait 24 hours before receiving more items.";

}else{

#dailyreward = .@day;

getitem 607,1;

message strcharinfo(0),"You gained the item for today.";

}

end;

OnPCLoginEvent:

@online = 3600 + gettimetick(2);

end;

}

  • Upvote 1
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...