List all players except menu selector

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
Kill
Member
Posts: 88
Joined: Wed Aug 31, 2016 10:05 pm

List all players except menu selector

Postby Kill » Sat Oct 08, 2016 7:22 pm

Hello,

I've been trying to do so without success, how is it possible to show all the players in a menu except the player who made the menu selection?

Syntax: Select all

for player in PlayerIter("all"):
my_menu.append(player.name) # Show all the player except the player who made the selection
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: List all players except menu selector

Postby iPlayer » Sat Oct 08, 2016 7:38 pm

Given you have the index of the player who perfomed menu selection, you can do this

Syntax: Select all

for player in PlayerIter("all"):
if player.index != index:
my_menu.append(player.name)
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Kill
Member
Posts: 88
Joined: Wed Aug 31, 2016 10:05 pm

Re: List all players except menu selector

Postby Kill » Sat Oct 08, 2016 7:58 pm

iPlayer wrote:Given you have the index of the player who perfomed menu selection, you can do this

Syntax: Select all

for player in PlayerIter("all"):
if player.index != index:
my_menu.append(player.name)



Hmmm, I tried that, but was using the wrong arg... Thanks!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 39 guests