Back to Index

2 - Accessing User Data

One of the most simplest things to achieve is to access User Data via CTK. Here is a simple list of things of what you can access and the code on how to access it.

All code requires you to add a using Eco.CTK in claystk-base.dll.

Users

Gets the list of all users

List<Eco.Gameplay.Players.User> Base.Users

Online Users

Gets the list of all online users

List<Eco.Gameplay.Players.User> Base.OnlineUsers

Admins

Gets the list of all admins for this server

List<Eco.Gameplay.Players.User> Base.Admins

Online Admins

Gets the list of all online admins for this server

List<Eco.Gameplay.Players.User> Base.OnlineAdmins

Get A Player By Name

Get player by a username, case-insensitive

Eco.Gameplay.Players.Player Base.GetPlayerByName ( string )

Get A User By Name

Get user by a username, case-insensitive

Eco.Gameplay.Players.User Base.GetPlayerByName ( string )

Query Users

Filter the list of users.

IEnumerable<Eco.Gameplay.Players.User> Base.QueryUsers( string )

Who Am I

Gets the same value as if you run /whoami in game, but in code.

string Base.OnlineAdmins( Eco.Gameplay.Players.User )
;