Location [Replaced]

Discussion in 'Plugin Support' started by Loborl, Dec 14, 2015.

  1. Loborl submitted a new resource:

    Location - Provide player's coordinates on command

    Read more about this resource...
     
  2. now we just need a map that we can plug the cords into
     
  3. xero-hurtworld.com/map
     
  4. Wulf

    Wulf Community Admin

    Congrats on your first plugin @Loborl! I noticed you have a bit of unnecessary code in your plugin though, so I've provided you a simpler example below.
    Code:
    namespace Oxide.Plugins
    {
    [Info("Location", "loborl", "1.0")]
    class Location : HurtworldPlugin
    {
        void Init()
        {
            cmd.AddChatCommand("loc", this, "PlayerPos");
            cmd.AddChatCommand("pos", this, "PlayerPos");
        }        void PlayerPos(PlayerIdentity identity, uLink.NetworkMessageInfo info)
        {
            var entity = identity.WorldPlayerEntity;
            hurt.SendChatMessage(info.sender, "<color=#ff8000>Position</color>", entity.transform.position.ToString());
        }
    }
    }
     
  5. Loborl updated Location with a new update entry:

    1.1

     
  6. Wulf

    Wulf Community Admin

    @Loborl, I'm seeing a lot of code duplication with each update. You may want to take a look at the suggestions I posted above.

    Also, if providing messages, you should be using the Lang API from Oxide (will be required soon). I'd also recommend Oxide's API for sending the messages, and you should also be using the datafile API, not the config API for storing player info. Your version number in your latest update was also not changed, which it should be updated each time a release is made.

    Please reply once able. Your plugin has been removed from view for now until I hear back regarding the mentioned changes in this and the post post.
     
  7. Hi Wulf,

    Thanks for it. First blood. :)

    Sorry for that i didn't see this conversation before.
    I appreciate any advice if you found something feel free to write me.
    I edit my last update i just need to update it again with correct content.

    Reqards,
    Loborl,
    Have a nice rest of day
     
  8. Wulf

    Wulf Community Admin

    No worries! I'd recommend watching your thread if you already aren't, and to make sure to keep an eye on the alerts in the top right corner.
     
  9. Loborl updated Location with a new update entry:

    1.2

     
  10. Wulf

    Wulf Community Admin

    You missed the part about the entity already being provided. ;)

    Also, hurt.SendChatMessage (example in my first reply) available with the same functionality as using it directly, without the excess code and reference.
     
  11. Little spam :)
    Right now i look onto it.
    Fix is on the way

    Thanks Again

    Reqars,
    Loborl
     
  12. when I do /posall I see nothing special?
     
  13. Hi Bouke Jan

    look at HurtworldDedicatedServer\oxide\config\Location.Json

    You can find all players and his location, in short future i have plan to connect this with MySQL or any other DataStore and after that you can do online map or anything else and anywhere you want.

    Reqards,
    loborl
     
  14. Loborl updated Location with a new update entry:

    1.3

     
  15. I really love your plugin, seeing forward to get the sql support =D
     
  16. Please update it.
     
  17. Wulf

    Wulf Community Admin

    Here ya go. Removed a bit of unnecessary code as well. @Loborl, feel free to use it. I'd recommend using the Lang API for the messages soon too, and make sure you increment the version at the top of the file when doing updates.
     
  18. 9:29 AM [Error] Location plugin failed to compile!
    9:29 AM [Error] Location.cs(58,29): error CS1061: Type `PlayerIdentity' does not contain a definition for `WorldPlayerEntity' and no extension method `WorldPlayerEntity' of type `PlayerIdentity' could be found. Are you missing an assembly reference?

    I got the error....what problem?...Should I change source code?
     
  19. I am not sure why, but this plugin does not work for me .. it just keeps saying unknown command.


    Just like Gunbyul - The log file says: "11:02 PM [Error] Error while compiling Location.cs(58,29): error CS1061: Type `PlayerIdentity' does not contain a definition for `WorldPlayerEntity' and no extension method `WorldPlayerEntity' of type `PlayerIdentity' could be found. Are you missing an assembly reference?"
     
  20. Wulf

    Wulf Community Admin

    See Location | Oxide.