mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-01 13:59:22 +00:00
89 lines
2.7 KiB
C#
89 lines
2.7 KiB
C#
using ml_prm;
|
|
|
|
namespace NAK.ChatBoxExtensions.Integrations;
|
|
|
|
internal class PlayerRagdollModCommands : CommandBase
|
|
{
|
|
public static void RegisterCommands()
|
|
{
|
|
Commands.RegisterCommand("unragdoll",
|
|
onCommandSent: (message, sound, displayMsg) =>
|
|
{
|
|
LocalCommandIgnoreOthers(message, (args) =>
|
|
{
|
|
if (RagdollController.Instance.IsRagdolled())
|
|
{
|
|
RagdollController.Instance.SwitchRagdoll();
|
|
}
|
|
});
|
|
},
|
|
onCommandReceived: (sender, message, sound, displayMsg) =>
|
|
{
|
|
RemoteCommandListenForAll(message, (args) =>
|
|
{
|
|
if (RagdollController.Instance.IsRagdolled())
|
|
{
|
|
RagdollController.Instance.SwitchRagdoll();
|
|
}
|
|
});
|
|
});
|
|
|
|
Commands.RegisterCommand("ragdoll",
|
|
onCommandSent: (message, sound, displayMsg) =>
|
|
{
|
|
LocalCommandIgnoreOthers(message, (args) =>
|
|
{
|
|
bool switchRagdoll = true;
|
|
|
|
if (args.Length > 0 && bool.TryParse(args[0], out bool state))
|
|
{
|
|
switchRagdoll = state != RagdollController.Instance.IsRagdolled();
|
|
}
|
|
|
|
if (switchRagdoll)
|
|
{
|
|
RagdollController.Instance.SwitchRagdoll();
|
|
}
|
|
});
|
|
},
|
|
onCommandReceived: (sender, message, sound, displayMsg) =>
|
|
{
|
|
RemoteCommandListenForAll(message, (args) =>
|
|
{
|
|
bool switchRagdoll = true;
|
|
|
|
if (args.Length > 1 && bool.TryParse(args[1], out bool state))
|
|
{
|
|
switchRagdoll = state != RagdollController.Instance.IsRagdolled();
|
|
}
|
|
|
|
if (switchRagdoll)
|
|
{
|
|
RagdollController.Instance.SwitchRagdoll();
|
|
}
|
|
});
|
|
});
|
|
|
|
Commands.RegisterCommand("kill",
|
|
onCommandSent: (message, sound, displayMsg) =>
|
|
{
|
|
LocalCommandIgnoreOthers(message, (args) =>
|
|
{
|
|
if (!RagdollController.Instance.IsRagdolled())
|
|
{
|
|
RagdollController.Instance.SwitchRagdoll();
|
|
}
|
|
});
|
|
},
|
|
onCommandReceived: (sender, message, sound, displayMsg) =>
|
|
{
|
|
RemoteCommandListenForAll(message, (args) =>
|
|
{
|
|
if (!RagdollController.Instance.IsRagdolled())
|
|
{
|
|
RagdollController.Instance.SwitchRagdoll();
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|