Forgive me if there is something little I'm missing but I'm very new to Oxide and writing in C# as a whole. I'm trying to create a plugin using the Web Requests from CovalencePlugin but the player.Nickname does not work, I also tried player.userId and player.displayName but they seem to only be available in a Base Player but I'm not sure what that means.
I would greatly appreciate any help in getting my code to receive the nickname or steam ID.
The example I'm trying to use that seems to be broken can be found here: Oxide API for RustCode:// Reference: Rust.Global using System.Collections.Generic; using Oxide.Core.Plugins; using UnityEngine; using Rust; using Oxide.Core.Libraries.Covalence;namespace Oxide.Plugins { [Info("DoomTownAPI", "wski", 1.0)] [Description("Interface with the DoomTownAPI from within Rust.")] class DoomTownAPI : CovalencePlugin { [Command("sync")] void GetRequest(IPlayer player, string command, string[] args) { Puts(player.userID.ToString()); if (args.Length == 1) { switch (args[0]) { case "help": player.Reply("Use the following to sync your account with DoomTown"); player.Reply("/redeem"); break; default: player.Reply("Attempting to sync account, standby..."); player.Reply(player.Object.displayName); break; } } else { player.Reply("Use the following to sync your account with DoomTown"); player.Reply("/sync"); } } void GetCallback(int code, string response, IPlayer player) { if (response == null) { player.Reply("Something went wrong redeeming the code, try again in a minute or two."); return; } player.Reply($"Successfully redeemed code! {response}"); } } };
Or here
Docs/web_requests.md at master · OxideMod/Docs · GitHub
Solved Unable to get Nickname to work using example in Web Requests
Discussion in 'Rust Development' started by 8Bit_Trip, Dec 23, 2016.