Jump to content

getOnlinePlayers -SOLVED!


Nucleus

Recommended Posts

hey guys i looked around for some admin mods that would let me teleport to users but so far i had no luck.

so i plan creating a nice ui that can be toggled on and off and allow eaze of teleporting to your server's player's. but so far i have no luck with getting other player information.

 

for example i have tried using getSpecificPlayer(int player) as so

local player = getSpecificPlayer(1); --returns a nil valuelocal x = player:getX(); --of course nothing 

but  getSpecificPlayer returns a nil/null for every playerid except for mine.

 

i was wondering if anyone know's a way to get player coord's before i go diving head first into .class files?

i did poke around alittle and found a function called getOnlinePlayers(); and was wondering if someone could give me an example of the use, i messed around with it a little and got it to fill an array. i'am not sure how i would iterate through that array and get information.

thanks you

 

Link to comment
Share on other sites

this has been solved you can use getOnlinePlayers(); the following way ( i was sooooo close) 

local players 		= getOnlinePlayers();local array_size 	= players:size();for i=0, array_size-1, 1 do	local player = players:get(i);	if player:getUsername() == "TurboTuTone" then		player:Say("Hi it is I, turbo");	endend	

o ya and thank you turbotutone

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...