Getting Steam ID of each player individually?Solved
Hello everybody :)

I am currently at a plugin for Rust. It is about InfoPanel from Default. I want the plugin to save the SteamID of the current player into a variable. All other mechanics work.
So far I only managed to save the SteamID of the user who is last joined on the server into a variable, but I need the SteamID continuously as long as the player is online to count and spend his kills.

I've been trying to get around for 2 days. :) This is my latest snippet:

BasePlayer player = new BasePlayer();
ulong playus = player.userID;

With this the compilation works, but I get a 0 as SteamID of the user. :/ Is there an easy way to extract the SteamID of the player?
I am quite a novice in C#. Sorry :)

Thank you very much :)

You are making a NEW baseplayer and it will always have default value, it just cannot detect "current player". You should get player by already existing ID or from hooks. Usually hitinfo contains InitiatorPlayer, see if its null, if not, use its ID. And I would suggest using a dictionary to store kills so that the key is the ID and value is kills
foreach (BasePlayer player in BasePlayer.activePlayerList)
{
         // Would print something like August[7657611546879843]
         Puts( $"{player.displayName}[{player.UserIDString}]" );
         // UserIDString is the player's steamid as a string, userID is that as a ulong
}
Thank you very much for your answers. I've got that right now :)

I still have the following problem; I would have to make a web request within a class which would give me the following output during the compile:

webrequest.Enqueue("https://THEWEBSITE****?getvar=" + PlayerID, null, (code, response) =>
{
    if (code == 200)
    {
        pointsValue = $"{response}";
    } else {
        // ignore failed web request
    }
}, this);​

error CS1503: Argument `#4' cannot convert `Oxide.Plugins.InfoPanel.Points' expression to type `Oxide.Core.Plugins.Plugin

This would be necessary so that the number per current user is displayed and not for confusion. :)

Outside the class, the web request works, but loads the same result for all active players in the GUI.
"this" is Points I suppose and you should put an instance of your plugin instead. So make an instance static field or a usual one in points that will be assigned in ctor or wherever you want
Thank you for your quick response. Hmm, I'm not getting anywhere, is there a developer doc for WebRequest? I can hardly find anything about it on Google. Is this method still up-to-date? :)

Merged post

InfoPanel infpa = new InfoPanel();
webrequest.Enqueue("https://playrust.bojett.com/killcount/getSingle.php?playerid=" + PlayerID, null, (code, response) =>
{
    if (code == 200)
    {
        pointsValue = $"{response}";
    } else {
        pointsValue = $"{response}";
    }
}, infpa);

According to my research, I think this worked :) The next error is then the following: :/

error CS0038: Cannot access a nonstatic member of outer type `Oxide.Plugins.CSharpPlugin' via nested type `Oxide.Plugins.InfoPanel.Points'

This is a bad idea, do not do this. You should make a static variable that will be assigned in Init and set to null in Unload.
Thank you very much @misticos for your help. I fixed that and now everything works as it should! :)

Thanks a lot!
Locked automatically