Hi. Can I see who shoot with MLRS somehow? on our PVE someone droped MLRS and looted players at night. Can't see it in log files somehow
Can I see an MLRS logs
Why don't you just block it:
https://umod.org/plugins/no-mlrs-mount
JimDeadlock
Why don't you just block it:
https://umod.org/plugins/no-mlrs-mount
we have a raidable bases so people can use it there
theres an Undocumented Hook Called OnMlrsFired (aside from various others MLRS hooks) that lets you easily access whenever MLRS is being fired
with that in mind we can create a very basic logger like this
using System;
using System.Collections.Generic;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("MLRSlog", "Kulltero", "1.0.0")]
[Description("Logs Everytime a player shoots MLRS rockets")]
public class MLRSlog : CovalencePlugin
{
private void OnMlrsFired(MLRS launcher, BasePlayer player)
{
LogToFile("MLRS_Log", $"{DateTime.Now}: {launcher.RocketAmmoCount} Rockets fired at {GetGrid(launcher.lastSentTrueHitPos)} by {player.displayName}[{player.userID}]", this);
}
private string GetGrid(Vector3 position) // Credit: Jake_Rich
{
var roundedPos = new Vector2(World.Size / 2 + position.x, World.Size / 2 - position.z);
var grid = $"{NumberToLetter((int)(roundedPos.x / 150))}{(int)(roundedPos.y / 150)}";
return grid;
}
private string NumberToLetter(int num) // Credit: Jake_Rich
{
var num2 = Mathf.FloorToInt((float)(num / 26));
var num3 = num % 26;
var text = string.Empty;
if (num2 > 0)
{
for (var i = 0; i < num2; i++)
{
text += Convert.ToChar(65 + i);
}
}
return text + Convert.ToChar(65 + num3);
}
}
}example Output in the logfile:06/20/2022 12:49:38: 12 Rockets fired at T27 by Kulltero[7656***********]
Kulltero
theres an Undocumented Hook Called
OnMlrsFired(aside from various others MLRS hooks) that lets you easily access whenever MLRS is being firedwith that in mind we can create a very basic logger like this
using System; using System.Collections.Generic; using UnityEngine; namespace Oxide.Plugins { [Info("MLRSlog", "Kulltero", "1.0.0")] [Description("Logs Everytime a player shoots MLRS rockets")] public class MLRSlog : CovalencePlugin { private void OnMlrsFired(MLRS launcher, BasePlayer player) { LogToFile("MLRS_Log", $"{DateTime.Now}: {launcher.RocketAmmoCount} Rockets fired at {GetGrid(launcher.lastSentTrueHitPos)} by {player.displayName}[{player.userID}]", this); } private string GetGrid(Vector3 position) // Credit: Jake_Rich { var roundedPos = new Vector2(World.Size / 2 + position.x, World.Size / 2 - position.z); var grid = $"{NumberToLetter((int)(roundedPos.x / 150))}{(int)(roundedPos.y / 150)}"; return grid; } private string NumberToLetter(int num) // Credit: Jake_Rich { var num2 = Mathf.FloorToInt((float)(num / 26)); var num3 = num % 26; var text = string.Empty; if (num2 > 0) { for (var i = 0; i < num2; i++) { text += Convert.ToChar(65 + i); } } return text + Convert.ToChar(65 + num3); } } }example Output in the logfile:
06/20/2022 12:49:38: 12 Rockets fired at T27 by Kulltero[7656***********]
how to use it, I am little confused