mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 14:29:25 +00:00
push broken mod
This commit is contained in:
parent
742f816d3d
commit
344e3bb6d6
12 changed files with 500 additions and 0 deletions
90
ChatBoxExtensions/Integrations/PlayerRagdollMod.cs
Normal file
90
ChatBoxExtensions/Integrations/PlayerRagdollMod.cs
Normal file
|
@ -0,0 +1,90 @@
|
|||
using Kafe.ChatBox;
|
||||
using ml_prm;
|
||||
|
||||
namespace NAK.Melons.ChatBoxExtensions.Integrations;
|
||||
|
||||
internal class PlayerRagdollModCommands : CommandBase
|
||||
{
|
||||
public static void RegisterCommands()
|
||||
{
|
||||
Commands.RegisterCommand("unragdoll",
|
||||
onCommandSent: (message, sound) =>
|
||||
{
|
||||
LocalCommandIgnoreOthers(message, (args) =>
|
||||
{
|
||||
if (RagdollController.Instance.IsRagdolled())
|
||||
{
|
||||
RagdollController.Instance.SwitchRagdoll();
|
||||
}
|
||||
});
|
||||
},
|
||||
onCommandReceived: (sender, message, sound) =>
|
||||
{
|
||||
RemoteCommandListenForAll(message, (args) =>
|
||||
{
|
||||
if (RagdollController.Instance.IsRagdolled())
|
||||
{
|
||||
RagdollController.Instance.SwitchRagdoll();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Commands.RegisterCommand("ragdoll",
|
||||
onCommandSent: (message, sound) =>
|
||||
{
|
||||
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) =>
|
||||
{
|
||||
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) =>
|
||||
{
|
||||
LocalCommandIgnoreOthers(message, (args) =>
|
||||
{
|
||||
if (!RagdollController.Instance.IsRagdolled())
|
||||
{
|
||||
RagdollController.Instance.SwitchRagdoll();
|
||||
}
|
||||
});
|
||||
},
|
||||
onCommandReceived: (sender, message, sound) =>
|
||||
{
|
||||
RemoteCommandListenForAll(message, (args) =>
|
||||
{
|
||||
if (!RagdollController.Instance.IsRagdolled())
|
||||
{
|
||||
RagdollController.Instance.SwitchRagdoll();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue