Jump to content
  • 0

maybe a veteran scripter could help me


Breaker

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  35
  • Reputation:   0
  • Joined:  05/27/12
  • Last Seen:  

hi im looking for a way to grant each player who is playing on my server on each new day 10 obbs. but i dont know how to handle online characters different than offline players T_T i guess a mysql solution would be best?

one thing on the sidenote would be that a current obb amount of the player never exceeds 10. so that 10 should be always the maximum whether they use it or not.

hope anyone can help me! ^_^

thanks in advance

Breaker!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

This gives .item_amount of .item_id each new day they log in. If you want to manage offline players too, you need to use some sql queries, but I don't really like that way to get free items if not playing :P

OnPCLoginEvent:
if( (obbDay == gettime(5)) && (obbMonth == gettime(6)) )
end;

set obbMonth, gettime(6);
set obbDay, gettime(5);
getitem .item_id, .item_amount;
dispbottom "You have been rewarded with " + .item_amount + " " + getitemname(.item_id);
end;

OnInit:
set .item_id, <obb id>;
set .item_amount, <amount>;
}

Edited by Ryokem
Link to comment
Share on other sites


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

- script Sample#daily_item -1,{
OnPCLoginEvent:
if( #Date != atoi( gettimestr( "%Y%m%d", 9 ) ) ){
getitem 512,( 10 - countitem( 512 ) );
#Date = atoi( gettimestr( "%Y%m%d", 9 ) );

}
end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  205
  • Reputation:   19
  • Joined:  10/12/12
  • Last Seen:  

atoi is the worst command to be used unless it's really necessary.

Your script is good, but just use gettime() or similar.

Edited by Ryokem
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...