From 6cf2ee2f4be76ee0fbec9cdb60d1a5d67ae07be4 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 3 Jul 2021 23:12:00 +0200 Subject: [PATCH] safesethealth bei vendingmachines --- .../Util/vMachinesRemote.cs | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/ReallifeGamemode.Server/Util/vMachinesRemote.cs b/ReallifeGamemode.Server/Util/vMachinesRemote.cs index cff4caaf..b1d1a0c2 100644 --- a/ReallifeGamemode.Server/Util/vMachinesRemote.cs +++ b/ReallifeGamemode.Server/Util/vMachinesRemote.cs @@ -1,19 +1,20 @@ -using GTANetworkAPI; +using GTANetworkAPI; +using ReallifeGamemode.Server.Extensions; public class vMachnesRemote : Script { - //IMPORTANT: THIS EVENT IS REQUIRED! - [RemoteEvent("vendingMachine.Remote.SharedData")] - public void UpdatePlayerData(Player player, string key, object data) - { - player.SetSharedData(key, data); - } + //IMPORTANT: THIS EVENT IS REQUIRED! + [RemoteEvent("vendingMachine.Remote.SharedData")] + public void UpdatePlayerData(Player player, string key, object data) + { + player.SetSharedData(key, data); + } - //This event gets fired once the Animation finished playing. You can for example use it, to give a Player Health etc. - [RemoteEvent("vendingMachines.Remote.Finish")] - public void OnVendingMachineInteractionFinish(Player player) - { - var health = (player.Health + 25 < 100 ? player.Health + 25 : 100); - NAPI.Player.SetPlayerHealth(player, health); - } -} \ No newline at end of file + //This event gets fired once the Animation finished playing. You can for example use it, to give a Player Health etc. + [RemoteEvent("vendingMachines.Remote.Finish")] + public void OnVendingMachineInteractionFinish(Player player) + { + var health = (player.Health + 25 < 100 ? player.Health + 25 : 100); + player.SafeSetHealth(health); + } +}