Offline gamemode changer

Discussion in 'Archived: Plugin Requests' started by xpopy, Sep 30, 2012.

  1. Offline

    xpopy

    Plugin category: Admin

    Suggested name: ProMode

    What I want: An easy way to change gamemode of yourself, other players AND offline players.

    Ideas for commands:
    /gm [0, 1 or 2] - sets gamemode on self.
    Message on command: Your gamemode have been changed into [gamemode]

    /gm [playername] - gets the current gamemode on a player.
    Message on command: [Playername]'s gamemode is [gamemode]

    /gm [playername] [0, 1 or 2] - sets the given players gamemode to 0, 1 or 2.
    Message on command: [playername]'s gamemode have been changed to [gamemode]
    Message for the other player: Your gamemode have been changed to [gamemode]

    Ideas for permissions:
    promode.set - For setting your own gamemode
    promode.get - For getting someones gamemode
    promode.setother - For setting others gamemode

    When I'd like it by: As soon as possible.

    Additional note: I know there is loads of gamemode changers out there, but i've never found one for offline players, which is something I really want. So please? :D
     
  2. Offline

    CTRL

    I'll try...

    To trudniejsze niż myślałem...
     
  3. Offline

    one4me

    xpopy likes this.
  4. Offline

    Woobie

    Why is there a "message for the other player" if this is for offline mode players? :D
     
  5. Offline

    RingOfStorms

    It's for both, so if the player is online it would msg them in that format, and if a player logs in, I'm guessing he would want that for the player who was changed while offline.
     
  6. Offline

    xpopy

    Wow, Thank you so very much!
    So far it works great :D

    Only "error" I've found so far is, when changing a gamemode, it gives two messages, first the "Your gamemode have been changed into [gamemode]", which should display, but then also another message saying "Your gamemode has been changed".
    I would guess that second one is a vanilla minecraft message. It would be really nice if you could fix it and remove the second message, but is totally not needed if you dont want to :)
    This however isnt important at all, its still working perfectly. :D

    Thx again ;D
     
  7. Offline

    one4me

    As far as I know, the "You gamemode has been changed." message is client-sided. So I don't think I can stop that from showing up.
     
  8. Offline

    xpopy

    Oh, I did not know that ^^

    Well, thanks anyway :)
     
  9. Offline

    xpopy

    one4me
    Hmm, seems like an update broke a feature if the plugin.
    When doing "/gm [name]" to check an offline players gamemode, i get this error message:

    Code:
    2013-01-13 13:06:40 [WARNING] Unexpected exception while parsing console command "gm xpopy"
    org.bukkit.command.CommandException: Unhandled exception executing command 'gm' in plugin ProMode v1.0.0
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:186)
        at org.bukkit.craftbukkit.v1_4_6.CraftServer.dispatchCommand(CraftServer.java:514)
        at org.bukkit.craftbukkit.v1_4_6.CraftServer.dispatchServerCommand(CraftServer.java:506)
        at net.minecraft.server.v1_4_6.DedicatedServer.al(DedicatedServer.java:260)
        at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:225)
        at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:494)
        at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:427)
        at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849)
    Caused by: java.lang.NoClassDefFoundError: net/minecraft/server/NBTBase
        at com.github.one4me.ProMode.ProMode.onCommand(ProMode.java:44)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
        ... 8 more
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.NBTBase
        at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:70)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 10 more

    EDIT: Same when setting an offline players gamemode. Seems like the offline is gone for now.. :/
     
  10. Offline

    Necrodoom

    looks like plugin needs to be updated to 1.4.6.
     
  11. Offline

    xpopy

    Yeah, unfortunately I am not a programmer. So if anyone would update it for me, I would be extremely happy :)
     
  12. Offline

    xpopy

    Come on, I really need this. Anybody? :(
     
  13. Offline

    McAvarice

    Looking at VanillaExtracts code. he is using a "Special" way of getting offline players. since bukkits sucks. hes grabbing the player.yml in the world file and changing values in that. But it needs nbttags. And now in bukkit 1.4 NBTTags have to be manually updated every bukkit update.(Im pretty sure). I got no experience with nbt or how to manually update them to work. So.. yeah
     
  14. Offline

    xpopy

    With other words, it is very unlikely that it will be updated. And if it would be, it would break on next bukkit update?
    That sucks D:

    Is there any other way of doing it, without having to manually update it every time? And how come bukkits way sucks...?
     
  15. Offline

    stuntguy3000

    Or you could store the names into a config

    eg:

    gamemode:
    stuntguy3000: creative

    When i login it sets me to creative
     
  16. Offline

    xpopy

    Yeah, I though that might have been possible aswell. But still, I am no programmer, so I don't know how to :/
     
  17. Offline

    MrFancyPants

    I just used nbt explorer and searched through all my users for those with gamemode and manually changed it in nbt and uploaded the player files again :D
     
  18. Offline

    xpopy

    Lol. Well I prefer having a way to do it ingame. I am a bit lazy sometimes... >_>

    Come on.. Second time somebody says he will do it, but then just remoces his post an hour afterwards.. -.-

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  19. Offline

    McAvarice

    I will work on it. But you will have to wait until tomorrow. Got about 40% of the plugin done.
     
  20. Offline

    xpopy

    Oh, cool :D
    I don't care waiting another day, the plugin has been broken for over a month already, haha...
     
  21. Offline

    xpopy

    Seems like McAvarice got banned for copying others code... Anyone else up for updating this? :s
     
  22. Offline

    JjPwN1

    Hello, xpopy
    PwnCraft PvP.png
    pwnmode.png
    Download: Here
    Source Code: Here
    Permissions:
    - pwnmode.setself
    - pwnmode.get
    - pwnmode.setother
    Commands:
    - /gm <0-2> (Set your gamemode)
    - /gm <player> (Get a player's current gamemode)
    - /gm <player> <0-2> (Set a player's gamemode)
     
  23. Offline

    xpopy

    Ah, finally! Thank you so much :)

    However, it seems like console commands are not working, and it doesn't keep your gamemode if you relog.
    (Btw, its 0-2, not 1-3 xD )
     

Share This Page