Teleport

Discussion in 'Plugin Development' started by Tomass, Feb 7, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Tomass

    Yes canncelled ant takes some 2 hp (But players not fighting!!!) !

    dead4y,

    Can you help me?

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

    Sorroko

    Oh so you want the player to wait after being hit before he can use the commands
     
  3. Offline

    Tomass

    Look, I want if the player try to write "/f home" (When take hit) the teleportation will canceled and removed two hearts.
    I think you played in Factions server, and server have safe zone, when player hited by "Seratted Strike" (mcMMO) he comes to safe zone and write /f home , i want when player hit he in safe zona (but not have damage when hit him) the teleportation will canceled and removed two hearts. I think you understand me :)
     
    ArcheCane likes this.
  4. Offline

    ArcheCane

    Finally a good explanation with the little grammar you know. <3
     
  5. Offline

    Tomass

    ArcheCane
    And i think, you want help me ? :D
     
  6. Offline

    ArcheCane

    I'm too busy, sorry.
     
  7. Offline

    Tomass

    Hm, and who can help me ? :D
     
  8. Offline

    Sorroko

    Ah hello, yes I shall add the on player hit thing now. (Fixing :p)

    EDIT: Tomass What would you like the delay to be? I.e. They get hit then x seconds pass, then allow use of command
     
  9. Offline

    Tomass

    I want only when he hit.
    Wait i'm making video :D
    Now, uploading in youtube.

    ryan7745
    Look this movie, and i think you understand me!


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

    Sorroko

    Thats a bit more difficult, are you using factions for safe zone? I have to see if they have an api

    For now though I have made a plugin which disables commands being used 10 seconds after being hit/hitting someone

    EDIT: forgot download: http://dl.dropbox.com/u/53730212/DenyTeleport.jar

    Does this work with the factions plugin? it might work.. but I am not sure if it will as I am listening to entity damage event

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

    Tomass

    ryan7745
    But you can't make when player only take hit (Like i movie)?
     
  12. Offline

    Sorroko

    I would have to use the factions api... it would require alot of effort. Another option is to use WorldGuard and define a region with teleport: deny
     
  13. Offline

    Tomass

    ryan7745
    And where is there to change that ?
    Can you give me configuarated file, comfig.yml please!?
     
  14. Offline

    Sorroko

  15. Offline

    Tomass

    I have this plugin, but can't make deny teleport...
    Can you give me configuarated file, comfig.yml please, and i put this config.yml in WorldGuard folder.
     
  16. Offline

    Sorroko

    Ah this explains why:
    teleport NOT YET IMPLEMENTED unset
    Vector

    Well if you still want that plugin I will look into factions api.. might take some time though
     
  17. Offline

    Tomass

    ryan7745
    Oh, thank you very much, when would you finished?
     
  18. Offline

    Sorroko

  19. Offline

    Tomass

  20. Offline

    Sorroko

    Tomass could you give me the error? also it only stops people teleporting in a safe zone...
     
  21. Offline

    Tomass

    ryan7745 It's not work in SafeZone and Willderness, please add and Willderness stops. Wait a minute i check logs. ;)
     
  22. Offline

    Sorroko

    Sorry not understanding :p, Ok so this is what I understand your plugin has to do:
    Stop teleport in safe zone
     
  23. Offline

    Tomass

    ryan7745 Look my error!
    Code:
    2012-02-29 18:39:44 [INFO] [DenyTeleport] Loading DenyTeleport v1.0.0.
    2012-02-29 18:39:44 [INFO] [DenyTeleport] Has enabled successfully.
    2012-02-29 18:39:44 [SEVERE] Error occurred while enabling DenyTeleport v1.0.0 (Is it up to date?): com.massivecraft.factions.P cannot be cast to com.massivecraft.factions.Factions
    java.lang.ClassCastException: com.massivecraft.factions.P cannot be cast to com.massivecraft.factions.Factions
        at me.ryan7745.DenyTeleport.DenyTeleport.onEnable(DenyTeleport.java:33)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:230)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:1057)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:380)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:199)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:182)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:357)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:344)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:175)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    I want not only in the safezone but everywhere .

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

    Sorroko

  25. Offline

    Tomass

    I test it now :p

    ryan7745 i think not 100% fixed... because teleportation not stoped or canceled, only removed 2 hp... please fix :D

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

    Sorroko

    Whuuut! Are you sure? Ill change the event priority, what plugins do you have installed?

    ^.^ Hopefully its fixed now: http://dl.dropbox.com/u/53730212/DenyTeleport.jar

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

    Tomass

    Ok, i test it now, and say for bugs :DDD

    Srry, but now play a more players and don't want restart :D

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

    Sorroko

  29. Offline

    Tomass

    ryan7745 No, only removed 2 hp, teleportation no cancelled...
     
  30. Offline

    Sorroko

    :/
    If anyone can suggest why this is not working, please do! :p :
    Code:
    @EventHandler(priority = EventPriority.HIGHEST)
        public void CommandProcess(PlayerCommandPreprocessEvent event)
        {
            Player player = event.getPlayer();
            String cmd = event.getMessage();
            if ((cmd.equalsIgnoreCase("/f home")) ||
                (cmd.equalsIgnoreCase("/home")) ||
                (cmd.equalsIgnoreCase("/spawn"))) {
                   
                FLocation loc = new FLocation(player.getLocation());
                Faction f = Board.getFactionAt(loc);
                if(f.isSafeZone() || pvp.containsKey(player.getName())){
                    player.setHealth(player.getHealth() - 4);
                    event.setMessage("");
                    event.setCancelled(true);
                }
                   
            }
     
        }
    
     
Thread Status:
Not open for further replies.

Share This Page