How to get a player's Nexgen ID via UScript?

Discussions about Coding and Scripting

How to get a player's Nexgen ID via UScript?

Postby nullbyte » Tue May 01, 2018 8:58 pm

Hi all

I use Nexgen on my server and I would like to get the Nexgen ID of a PlayerPawn in UScript.

I tried many things including accessing Nexgen class directly but I can't figure it out.

Does anyone know how to get this, please?
nullbyte
Novice
 
Posts: 27
Joined: Sat Sep 03, 2016 3:40 am

Re: How to get a player's Nexgen ID via UScript?

Postby Barbie » Wed May 02, 2018 2:30 am

I always wanted to do the same but have not tested it yet. So the following is only an assumption.

Have a look at NexgenPlayerInfo (version 112 here):
Code: Select all
class NexgenPlayerInfo extends Info;

var NexgenPlayerInfo nextPlayer;                  // Next player in the linked list.

var int playerNum;                                // Player num.
var string playerName;                            // Name used by the player.
var string playerTitle;                           // Title of the players account.
var string ipAddress;                             // IP Address.
var string clientID;                              // Client identification code.
...
This record connects the playerNum with the clientID. You can iterate over all Class'NexgenPlayerInfo' to get the clientID for a specific playerNum.

Another approach is to use the function getClientByNum of NexgenController:
Code: Select all
class NexgenController extends Mutator config(Nexgen);
...
/***************************************************************************************************
*  $DESCRIPTION  Locates the NexgenClient instance for the given player code.
*  $PARAM        playerNum  The player code of the client handler instance that is to be found.
*  $REQUIRE      playerNum >= 0
*  $RETURN       The client handler for the given player code.
*  $ENSURE       (result != none ? result.playerNum == playerNum : true)
**************************************************************************************************/
function NexgenClient getClientByNum(int playerNum) {
...
NexgenClient also has the playerID.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
Barbie
Godlike
 
Posts: 1578
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing


Return to Coding, Scripting

Who is online

Users browsing this forum: No registered users and 1 guest