advanced question about player entity spawning

Discussion in 'Plugin Development' started by Zevrix_Kojote, Jul 28, 2012.

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

    Zevrix_Kojote

    ok, so as some people know the plugin 'Mobdisguise' made by Desmin88 disguises a player as another or as a mob. this plugin functions by destroying the packets displaying the disguised player and forges a new one that appears as a mob. this plugin basically makes the server lieto the client and says that there's someone else or a mob there.

    my question is: how would I be able to apply this in such a way that the packets are forged to display a skin from (Example) dropbox instead of the skin from the original character, but keep the players name (and also without the skin already existing on another player)?

    notes: I mention mob disguise because it already has functions to crate a spoofed entity, but i want a way to change the skin to a specific one, and not necessarily the the player to appear as another (this is because I don't have like 20 different accounts to change people into)

    summary:
    in short, I want a way to override a players skin when a constructor is called in my plugin

    example of what is ideal:
    Code:
    public void ChangeSkin (Player p, int skin)
    {
        url player_skin;
        switch (skin)
        {
            case 1:  player_skin = "www.example.com/skin1.png";
                    break;
            case 2:  player_skin = "www.example.com/skin2.png";
                    break;
            case 3:  player_skin = "www.example.com/skin3.png";
                    break;
            default: player_skin = "www.example.com/default.png"
                    break;
        }
     
        setskin(p, player_skin);
    }
     
    public void setSkin (Player p, int skin)
    {
        //set skin
    }
     
  2. Offline

    SirTyler

    I do not believe you can do this by spoofing the packets, how ever I know Spout allows for setting skins on entities (no idea if it can be applied to normal players as well) so I would suggest looking into that.
     
  3. Offline

    Zevrix_Kojote

    ok mill look
    ok, ill look into this. thanks! ill get back to you on it
     
  4. Offline

    MonsieurApple

    Skin code is hard coded to the name over a player's head. The only way you can change someone's skin is by changing their name over their head (which is packet 20 I believe).
     
  5. Offline

    Zevrix_Kojote

    ahh ok, perhaps a custom bukkit build is required? or is keeping the name beyond possibility without modified client too? I am willing to take this far if I need to, the plugin is intended for a private use on select servers, not wide distribution. so convenience is not much of a problem
     
  6. Offline

    MonsieurApple

    I thought you could /d p PlayerName with MobDisquise...
     
  7. Offline

    Zevrix_Kojote

    but mobdisguise requires an existing account to have the desired skin on it, in this case the skin does not exist on an account, is there a way that I can override the skin of a player without another player allready having that skin
     
  8. Offline

    ZeusAllMighty11

    You can not give a player a skin out of the blue from no where, since the skin (as apple said) is hardcoded to the name. You would have to be able to change the skin from the user directly, which is impossible unless you own the account and make a bunch of silly connections back and forth.

    But with Spout, you can easily change the skin of the player and not their name.
     
  9. Offline

    Zevrix_Kojote

    Ok, ill look into spout.. I have never touched spout before.. would using spout for this require people to have the spout client?
     
  10. Offline

    ZeusAllMighty11

    yes

    Well you can put in a spout plugin for your server that changes skins, but only people with spout client would see it. Just be careful, because if you decide to do that you can make other regular users crash
     
  11. Offline

    Zevrix_Kojote

    ah that sucks, guess ill funnel some money into accounts then.. oh well. I know you used to be able to buy accounts for 10cents on hackforums, but i know for a fact those are stolen accounts.. oh well, thanks for your help
     
Thread Status:
Not open for further replies.

Share This Page