Creating BasePlayer from SteamID?
Discussion in 'Rust Development' started by Spicy, Apr 1, 2016.
-
Wulf Community Admin
You can lookup the BasePlayer from their Steam ID, but I don't think you'd need to create one.
-
Alright, thanks for the swift reply.
-
Wulf Community Admin
-
BasePlayer.FindByID(ulong steamID)
-
Code:
using System;var p = BasePlayer.FindByID(Convert.ToUInt64(player.UserIDString));
-
Wulf Community Admin
You don't need to convert a player's User ID to a long, it already exists as a ulong, just don't use the string variable.
You won't have the player if you are looking for it though.Code:player.userID
-
Didn't I say that already?
I do not think
he has a 'player' variable, as thats what he tried to get. He just has a SteamID. Also why would you take the UserIDString and then convert it back to ULong? Why
don't you just use userID instead?
Last edited by a moderator: Apr 3, 2016 -
Ok, I understood
