コード例 #1
0
 public TickEvents(Client.Client client) : base(client)
 {
     client.RegisterEventHandler("baseevents:enteredVehicle", new Action <int, int, string>((veh, seat, name) => {
         DataLoader.RemoveTickState(TickUsage.OutVehicle);
         DataLoader.AddTickState(TickUsage.InVehicle);
     }));
     client.RegisterEventHandler("baseevents:leftVehicle", new Action <int, int, string>((veh, seat, name) => {
         DataLoader.RemoveTickState(TickUsage.InVehicle);
         DataLoader.AddTickState(TickUsage.OutVehicle);
     }));
     DataLoader.AddTickState(TickUsage.OutVehicle);
     DataLoader.AddTickState(TickUsage.NotAiming);
 }
コード例 #2
0
        private async Task CheckWeaponTick()
        {
            if (Cache.PlayerPed.IsAiming)
            {
                DataLoader.RemoveTickState(TickUsage.NotAiming);
                DataLoader.AddTickState(TickUsage.Aiming);
            }
            else
            {
                DataLoader.RemoveTickState(TickUsage.Aiming);
                DataLoader.AddTickState(TickUsage.NotAiming);
            }

            if (Cache.PlayerPed.IsShooting)
            {
                DataLoader.AddTickState(TickUsage.Shooting);
            }
            else
            {
                DataLoader.RemoveTickState(TickUsage.Shooting);
            }
        }