/give for offline players.

Discussion in 'Archived: Plugin Requests' started by Gunnerrrrr, Aug 7, 2012.

  1. Offline

    Gunnerrrrr

    I understand bukkits APi does not allow inventories of offline players, but then how does openinv work?
    Anyways, i need a plugin for giving offline players items, im using this for a script for votifier, if that would change anything..
     
  2. Offline

    izak12345678910

    Bukkit Doesn't Support Offline Mode.
     
  3. Offline

    np98765

    You should remove those tags. I believe they want you to report posts instead of tagging individual staff members.

    Oh, and he didn't say offline MODE. He said offline PLAYERS... You know, players who aren't online? :p

    So definitely remove those tags. :3

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
    izak12345678910 likes this.
  4. Offline

    one4me

    I looked at editing offline player data a while and the ways I found were to spawn an entity and load the player (which I think is what openinv does) or you could load the player.dat file and edit the data, but that was a while I ago so I'm not sure if anything has changed since then. I'll look into this again and see if I can come up with anything.

    You could also just listen to onPlayerJoin and give the player the item as soon as they join, this would probably be a little bit easier.
     
  5. Offline

    BenjamiinNoR

    Ok, I probably didnt get the point, but do you mean voting multiple times with offline players so you can get loads of votes?
     
  6. Offline

    Edge209

    Are you looking to give different players the same thing(s) while they are offline? If so, I may have a solution for you.

    I suggest that you explain a little bit more exactly what you are looking to accomplish, and then you may get some other suggestions. What I mean is that since you have this need to tie into votifier, your 'request' is really something different and an 'offline give command' is really a solution to that underlying request. There may be other solutions already out there.
     
  7. Offline

    Gunnerrrrr

    Basiclly, when users vote they get diamonds, exp blah blah, but the essentials /give command does not support offline players, and some users log off mc because its faster to load the vote pages or because they didnt read the signs or whatever, hopefully thats what you need.
     
  8. Offline

    Edge209

    Yes that helps, and I do have a solution for you although it may be more than what you want .... then again you may find some other features of the plugin useful for your server. I'm talking about OnTime: http://dev.bukkit.org/server-mods/ontime/

    To do what you want:
    1. create an OnTime Reward for the thing you want to give, for example 10 diamonds
    /ontime rewards add item 0 0 0 10 diamonds​

    (This creates a reward of 10 diamonds to be issued to a player. The playtime required is 0 min, but this will become a 'don't care' with the next command you execute.)​

    2. Make that reward an 'individual' reward, so it is NOT issued automatically at 0 minutes.
    /ontime rewards indi 1​

    (If you don't execute this command every player will get 10 diamonds the first time they log into your server. The "1" above is the RewardID, which is '1' since there is only one reward defined. This number can be found by using the command '/ontime rewards list'. )​

    3. Ok, now your votifier function would need to execute the following command:
    /ontime rewards set <playername> delta 1 0 0 0 ​

    (The sequence 'delta 1 0 0 0' means the player does not need any more playtime (0,0,0) to receive the reward with RewardID=1. So, if they are online they will get the reward almost immediately, and if they are offline they will get the reward right after they next login. This information will be retained through a server restart, and the next login could be the same day or a month later and they will still get the reward.)​

    With OnTime Rewards you can give any number of different things such as MC items (like Diamonds), XP, economy cash, a group change, or even a new permission.

    OnTime uses Vault so almost any permission or econ plugin you are currently using will be compatible.
     
  9. Offline

    Gunnerrrrr

    Ok thank you very much, i tested it out but heres the thing, i give users 2 diamonds, 1 emerald, and 130 XP everytime they vote. I added the diamonds, it worked fine, then i added emeralds, and it was giving the emeralds and not the diamonds, not sure what i was doing wrong, and this plugin doesn't have much of a tutorial, so if you could help me it would be greatly appreciated. :)
     
  10. Offline

    Edge209

    Right now I am working on adding the ability to reward 'kits' so what you want to do could be done with a single reward, but until I get out an update, are looking at three different rewards.

    1. create OnTime Rewards for the things you want to give:
    /ontime rewards add item 0 0 0 2 diamonds
    /ontime rewards add item 0 0 0 1 emerald
    /ontime rewards add xp 0 0 0 130
    2. Make these rewards 'individual' rewards, so it is NOT issued automatically at 0 minutes.
    /ontime rewards indi 1
    /ontime rewards indi 2
    /ontime rewards indi 3
    (If you don't execute this command every player will get these rewards the first time they log into your server. The numbers above (1- 3) is the RewardID. This number can be found by using the command '/ontime rewards list'. )
    3. Ok, now your votifier function would need to execute the following commands:
    /ontime rewards set <playername> delta 1 0 0 0
    /ontime rewards set <playername> delta 2 0 0 0
    /ontime rewards set <playername> delta 3 0 0 0
    Again the numbers 1-3 are the RewardIDs. And the '0 0 0' tells the plugin to provide the reward immediately if they are on online, or right after they next login if they are offline.
     
  11. Offline

    Gunnerrrrr

    Oh i didn't notice you were the owner of the plugin :p
    And it works perfect! Thank so you much!
    One question, is there a way i can make it so it doesnt say the message when they get the reward, or at least the you have been on for...
    I did set this to false but it still shows:
    #Enable if Reward Notification Messages to players should be displayed
    rewardNotifyEnable: false
     
  12. Offline

    Edge209

    ok good to hear its working now for you.

    Yes, you can modify the output. You need to edit the /ontime/output.yml file. As example for the item (diamond/emerald) reward you can just remove the 'on for' line.

    item:
    lines: 3
    line-1: '&a Congratulations [player] !'
    line-2: '&a You have been on for [total]'
    line-3: '&a You have been rewarded ( [quantity] ) [reward]'

    could be changed to:

    item:
    lines: 2
    line-1: '&a Congratulations [player] !'
    line-2: '&a You have been rewarded ( [quantity] ) [reward]'


    You would need to make a similar change to the output generated for XP rewards.

    I will have to take a look to see why the messages are not being suppressed when you change that configuration. (I'll assume you reloaded the plugin after you made that change.)

    Also, FYI I've opened up an enhancement ticket to also add in a votifier listener such that this can be made to work and you would not have to write your own listener. (Not so much for you since you have this working already, but to make it easier for others in the future.)
     
  13. Offline

    Gunnerrrrr

    Ok thank you, and i had 1 person say she kept getting emeralds, and it would say you have played for "blah blah blah"
     
  14. Offline

    Edge209

    I'm not sure if you are telling me that you have another problem.

    If someone is getting rewards that you don't expect them to receive then read on:
    If you don't run the 'exclusive' command for each reward you create it is possible that people will get the reward without having to go through the votifier. You may want to run the 'ontime rewards list' command and make sure that you only have the three rewards you need, and that there aren't some old ones hanging around from when you were trying to get this to work.​

    But please let me know if you are having issues.

    And I tested the rewardNotifyEnable and it is working as expected (at least on my test server).
     
  15. Offline

    Gunnerrrrr

    ah, i thought it was a bug but i somehow added another one without the exclusive command, my bad xD!
     
  16. Offline

    ImToRich

    Still work?
     

Share This Page