Get the error:
Error while compiling AntiOfflineRaid: Argument 1: cannot convert from 'Facepunch.StringView' to 'string' | Line: 353, Pos: 39
Get the error:
Error while compiling AntiOfflineRaid: Argument 1: cannot convert from 'Facepunch.StringView' to 'string' | Line: 353, Pos: 39
replace
SendReply(arg, SendStatus(arg.Args[0]));to
SendReply(arg, SendStatus(arg.Args[0].ToString()));also, a small fix:
public Dictionary<string, object> AbsoluteTimeScale = new();to
public Dictionary<string, object> AbsoluteTimeScale = new Dictionary<string, object>();public Dictionary<string, object> DamageScale = new();to
public Dictionary<string, object> DamageScale = new Dictionary<string, object>();private readonly Dictionary<ulong, ScaleCacheItem> _cachedScales = new();to
private readonly Dictionary<ulong, ScaleCacheItem> _cachedScales = new Dictionary<ulong, ScaleCacheItem>();[ConsoleCommand("ao")]
void CheckOfflineStatus(ConsoleSystem.Arg arg)
{
if (arg.Connection == null) return;
if (arg.Connection.player is not BasePlayer player) return;
if (!HasPerm(player, PluginPermissions.Check) && arg.Connection.authLevel < 1)
{
SendReply(arg, GetMsg("Denied: Permission", arg.Connection.userid));
return;
}
SendReply(arg, SendStatus(arg.Args[0]));
}to
[ConsoleCommand("ao")]
void CheckOfflineStatus(ConsoleSystem.Arg arg)
{
if (arg.Connection == null) return;
BasePlayer player = arg.Connection.player as BasePlayer;
if (player == null) return;
if (!HasPerm(player, PluginPermissions.Check) && arg.Connection.authLevel < 1)
{
SendReply(arg, GetMsg("Denied: Permission", arg.Connection.userid));
return;
}
if (arg.Args == null || arg.Args.Length < 1)
{
SendReply(arg, "Invalid Syntax. ao <PlayerName>");
return;
}
SendReply(arg, SendStatus(arg.Args[0].ToString()));
}
return player is not {IsConnected: true};to
return player == null || !player.IsConnected;