Change player opacity only for team. Please Help!

Discussion in 'Plugin Development' started by Tomass, Feb 8, 2014.

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

    Tomass

    Hello,

    Is it possible to change team opacity without setting invisible? I want, that, for example, zombie team will see our friends 50% invisible, but, for example, humans team, will see zombies as normal players? If its possible, then, can you tell me how?
     
  2. Offline

    Munnzeh

  3. Offline

    Tomass

    Yes, I known it, but I want, that another team see another team players as normal players (100%).

    Munnzeh, are you understand me? Sorry but my english is so bad :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  4. Offline

    Monkey_Swag

    Hey! Your English is good enough to be able to help on these forums, so don't get sad if your English isn't that good, be happy that unlike many people near you, you can communicate with other English speakers!

    Sorry for the off-topic comment, just really wanted to point this out!
     
    Tomass likes this.
  5. Offline

    Tomass

    Thank you, you're the first who said it to me :)
     
  6. Offline

    Gater12

    Tomass You would have to set every player to a team. Then have a List of players on another team (Let's say humans). Loop through the list (humans) and give each player the invisibility effect.
     
  7. Offline

    Tomass

    Okay, but another team will see humans as normal players or not?
     
  8. Offline

    Gater12

    Tomass
    It will make the humans see the zombies as normal players, it'll the the human team team mates look 50% visible! the zombies will see the human team 50% visible, and the zombie will see their team mates like normal players.
     
  9. Offline

    Tomass

    Noo, you don't understand me :) I want, that only team mates see their 50% visible. (Zombies will see zombies as 50% visible, and humans will see humans as 50% visible. But zombies will see humans as normal players and humans will se zombies as normal players too). I think now, I have correctly explained: D
     
  10. Offline

    Gater12

    Tomass Oh, then scoreboard teams can't do the job...
    Perhaps packets?
     
  11. Offline

    Desle

    Tomass
    Only loop through the friendly team and do player.hidePlayer(anotherplayer), then use the teams to make them 50 % visible. The opposite team didint get looped through, therefore the opposite team appears normal.

    Actually.. not sure if this works, try it
     
  12. Offline

    Tomass

    I have tested with hidePlayer its wouldn't work :(
    }
     
    Desle likes this.
  13. Offline

    i4evercode

    What won't work? The hiding of the player? Tomass
     
  14. Offline

    Tomass

    i4evercode
    Use setCanSeeFriendlyInvisibles(true) for hided players by hidePlayer(player);
     
  15. Offline

    Garris0n

    It's perfectly possible. First put each team on a scoreboard team and turn on seeFriendlyInvisibles. Then you have to send out potion effect packets (perhaps with ProtocolLib) in such a way that only teammates see each other with the effect.
     
  16. Offline

    i4evercode

    Oh, well you can't use that when you hide the player. It only works with invisibility potion. Although, you might be able to do what Garris0n said. But, of course, if you do not know how, then using a potion effect would be much easier.
    Garris0n
    Tomass
     
  17. Offline

    Tomass

    i4evercode thank you for your trying to help me, but I can't use potion effect for players in this situation.
    Garris0n, can you explain me, what packets i need to use and how? Thanks :3
     
  18. Offline

    Garris0n

    I'm not sure what the packet is, probably PacketPlayOutEntityEffect or something like that.

    Why can't you use potion effects, though? That's essentially what you'd be doing, but you would have to use the effects via packets so only one team sees them.
     
  19. Offline

    Tomass

    Garris0n, I want, that only teammates will be invisible for 50% (no object). But enemy will see they like normal players.
     
  20. Offline

    Garris0n

    Okay. So what you have to do is make it so that the people on the team have .seeFriendlyInvisibles(true) on AND think the player has an invisibility potion, however the other team can NOT think they have an invisibility potion. This involves sending the potion effect packets per-player to only their team and not the other team so that only their own team thinks they have the invisibility potion.
     
  21. Offline

    Tomass

  22. Offline

    Garris0n

    Tomass likes this.
  23. Offline

    Tomass

    Ok, thank you Garris0n for your ideas and helping :)

    BUMP. Who can help me with ProtocolLib Packets?

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

    Garris0n

    I suppose post what you've tried and I could attempt to help fix it.
     
  25. Offline

    Tomass

    Right now, I didn't tried way with ProtocolLib packets, because I don't known how they works :(
     
  26. Offline

    Garris0n

  27. Offline

    Tomass

    Last edited by a moderator: Jun 6, 2016
  28. Offline

    Garris0n

    First you have to turn on seeFriendlyInvisibles. Then, you have to send only that player's team packets that say that player is invisible. This way, the other team won't see any invisibility, but that player's team will think the player has an invisibility potion effect. And, because you've turned on seeFriendlyInvisibles, they will see the player as transparent instead. Understand?
     
  29. Offline

    Tomass

    Yes, I understand. I known the "setCanSeeFriendlyInvisibles(true)" feature in bukkit teams. But I don't understand how to set only for teammates, also, that enemy will see they as normal players. Sorry for my stupidity...
     
  30. Offline

    Garris0n

    By only telling that player's team the player is invisible and not telling the other team.
     
Thread Status:
Not open for further replies.

Share This Page