Posts by yahwho

    It is a tough one. I'm wondering if there is some way to grab the steam user name or something, or, possibly have some means to determine if, and when a username was changed. Something like, "username was changed 64 days ago" or "username was changed 5 hours ago".


    Going to require quite a bit of thought before implementation.

    OK, so I've got a database running that stores a players "friends" list. Using the chat command /add friend PlayerName this gets the players UID with;


    Player p = getServer.getPlayer("playername");


    String friendUID = (String)p.getUID();


    (or something like that!)


    Here comes the perplexing part!


    Now say the players "friend" goes off and destroys their stuff whilst they are not online. When they next login they want to remove the player with something like /remove friend PlayerName now clearly this is only going to be possible *if* the "bad" player is logged in at the same time to enable the server to work out the UID.


    Now, I could execute this with a command such as /remove friend PlayerNameUID (like 28372728294828282) but that's going to be very difficult for a user to do.


    Can anyone think of any magic way to make this easier?


    (I'm half way thinking a GUI is going to be the only way. . .)

    Code
    GuiImage testImg = new GuiImage(0.83F, 0.02F, true, 55.0F, 55.0F, false);
    testImg.setImage(info);
    testImg.setVisible(true);
    testImg.setAlpha(0.5f);
    player.addGuiElement(testImg);

    That's what I've done. I'm trying to add an image to left of the "knife and fork" icon. With those settings looks perfect for 1024x786 soon as I go up to my native 1920x1080 the icon shifts much further to the left away from the food/water icons.



    (trying to make my GUI as unobtrusive as possible)

    hehe I think we both got there are the same time!


    Don't suppose Minotorious you know how to either keep an GuiImage to bottom right of the screen? I've tried but when I change resolutions to test it the image shifts to the left or the right. I'm guessing I need to somehow get the players screen resolution somehow and then move the GuiImage accordingly.



    ( I'm sure others will find my relentless questions useful too ;) )

    Perfect thanks Minotorious! :thumbsup: Hmm actually still struggling.


    Player p = getPlayer(String player); //doesnt work
    Player p = getPlayer(player); //doesnt work


    Player p = getServer().getPlayer(player); // i think this works!

    Hi!


    Here is my method I'm playing with at the moment.


    Code
    @EventMethod
    public void onPlayerCommand(PlayerCommandEvent event) {
    String[] cmd;
    cmd = event.getCommand().split(" ");
    if (cmd.length == 3 && cmd[0].equals("/add") && cmd[1].equals("friend")) {
    String player = cmd[2];
    System.out.println("" + cmd[2]);
    }

    I need to get the players UID from their textual name ( it will then go to a SQL statement ).


    I'm really quite stuck on how to do this? ?(

    I'm still having problems getting server to show after update. X/ I see this at the end of the startup script log



    properties file




    OK this is weird. I had to do this a few times to check I wasn't going mad. I checked that the properties file had the line "server_query_ip=-1" in it, when the server runs, you look back at this file and the line has been removed. :|

    Hi guys!


    Now, before when the username was the ID of a player, a player could say type in a command such as /addfriend [playername] but now it's not unique and can change, so the UID has to be used. Can anyone think of a way to simplify this for users? Asking a user to type in a UID seems like its not going to work in practice. /addfriend [9129138053209236023093] just seems too "unfriendly".


    Any thoughts, ideas guys? I'm a little stumped at the moment. 8|