-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAntiaim.cs
65 lines (49 loc) · 1.87 KB
/
Antiaim.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using BrokeProtocol.Utility.Networking;
using BrokeProtocolClient.settings;
using ENet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace BrokeProtocolClient.modules.combat
{
class Antiaim : Module
{
NumberSetting rotationX = new NumberSetting("Rotation x", -1, 1, 0, 0.01);
NumberSetting rotationY = new NumberSetting("Rotation y", -1, 1, 0, 0.01);
NumberSetting rotationZ = new NumberSetting("Rotation z", -1, 1, 0, 0.01);
BooleanSetting logRotation = new BooleanSetting("Log rotation", false);
Quaternion rotation;
public Antiaim() : base(Categories.Combat, "Antiaim", "Makes it harder to shoot you")
{
addSetting(rotationX);
addSetting(rotationY);
addSetting(rotationZ);
addSetting(logRotation);
}
public override void onActivate()
{
if (!getClient().ClManager.myPlayer) return;
rotation = getClient().ClManager.myPlayer.GetRotation;
}
public override void onUpdate()
{
if (!getClient().ClManager.myPlayer) return;
Vector3 eulerAngles = rotation.eulerAngles;
if (logRotation.isEnabled())
Log($"{eulerAngles.x} | {eulerAngles.y} | {eulerAngles.z}");
eulerAngles.y = eulerAngles.y - 180f;
rotation = Quaternion.Euler(eulerAngles);
getClient().ClManager.SendToServer(PacketFlags.Reliable, SvPacket.UpdateRotation, new object[]
{
rotation
});
}
public override bool onSendToServer(PacketFlags channel, SvPacket packet, params object[] args)
{
return true;
}
}
}