Désactiver l'utilisation de F3 dans vos projets

1 Replies • 855 Views

Eurons

Mappeur

Bonjour,

voici un petit plugin permettant de désactiver l'utilisation du "speed hack" sur vos jeux :
module Graphics
  class FPSBalancer
    # Update the metrics of the FPSBalancer
    def update
      update_intervals if @last_frame_rate != Graphics.frame_rate
      current_index = (Graphics.current_time.usec / @frame_delta).floor
      if current_index == @last_interval_index
        @frame_to_execute = 0
      elsif current_index > @last_interval_index
        @frame_to_execute = current_index - @last_interval_index
      else
        @frame_to_execute = Graphics.frame_rate - @last_interval_index + current_index
      end
      @last_interval_index = current_index
      return unless debug?

      if Sf::Keyboard.press?(Sf::Keyboard::F3)
        FPSBalancer.last_f3_up = Graphics.current_time
      elsif FPSBalancer.last_f3_up == Graphics.last_time
        FPSBalancer.globally_enabled = !FPSBalancer.globally_enabled
        FPSBalancer.last_f3_up -= 1
      end
    end
  end
end

Amicalement,

« Last Edit: 31 March 2022, 14:21:27 by Eurons »

Script Patch Tuto Script PSDK

Eurons

Mappeur

Bonjour,

le plugin a été mit à jour (merci à Rey), il empêche le "speed hack" via F3 en jeu.

Hello,

the plugin has been updated (thanks to Rey), it prevents the "speed hack" via F3 in game.

There was an error while thanking
Thanking...