1. Dashboard
  2. Forum
    1. Unerledigte Themen
  3. Downloads
  4. Galerie
    1. Alben
  5. Toolbox
    1. Passwort Generator
    2. Portchecker
  6. Mitglieder
    1. Mitgliedersuche
    2. Benutzer online
    3. Trophäen
    4. Team
Mi: 21 Mai 2025
  • Anmelden oder registrieren
  • Suche
Dieses Thema
  • Alles
  • Dieses Thema
  • Dieses Forum
  • Artikel
  • Forum
  • Dateien
  • Seiten
  • Bilder
  • Erweiterte Suche

Schön, dass du den Weg zu NodeZone.net gefunden hast! Aktuell bist du nicht angemeldet und kannst deshalb nur eingeschränkt auf unsere Community zugreifen. Um alle Funktionen freizuschalten, spannende Inhalte zu entdecken und dich aktiv einzubringen, registriere dich jetzt kostenlos oder melde dich mit deinem Account an.

Anmelden oder registrieren
    1. Nodezone.net Community
    2. Forum
    3. Gameserver & Hosting
    4. ArmA Series - ArmA 3 / Reforger
    5. Hilfeforum

    Seatbelt problem.

      • Altis Life
    • Frenzy
    • 5. Mai 2021 um 19:33
    • Erledigt
    1. offizieller Beitrag
    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 5. Mai 2021 um 19:33
      • #1

      Hello, I did everything as shown in the tutorial. But HP always regenerates itself when I put on the seat belt, when I crash.

    • nox
      Administrator
      Reaktionen
      1.861
      Trophäen
      11
      Artikel
      2
      Beiträge
      1.866
      Dateien
      36
      Bilder
      11
      • 6. Mai 2021 um 00:55
      • Offizieller Beitrag
      • #2

      What exactly do you want to do and what tutorial is it exactly about? Without details and without logs no one will be able to help you :/

      Wichtige Links:

      [Erklärung|Leitfaden] Arma 3 Logs - Client, Server & extDB Log
      [Tutorial] ArmA 3 Altis Life RPG & Tanoa Life RPG Server einrichten unter Windows (mit extDB & BEC)
      BattlEye Filter - Guide und Erklärungen

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 6. Mai 2021 um 01:04
      • #3
      Zitat von nox

      What exactly do you want to do and what tutorial is it exactly about? Without details and without logs no one will be able to help you :/I 

      I mean. HP goes up When I wear seat belts, when ı have an accident. I think the problem is caused by this script. Even though I did everything from scratch, my dear suddenly becomes 100%.

      Code
      if ((vehicle _unit) isKindOf "Car" && (isNull _source || _source isEqualTo _unit)) then
      {
          _damage = if (life_seatbelt) then { _damage / 2 } else { _damage};
      };

      Einmal editiert, zuletzt von Frenzy (8. Mai 2021 um 00:30)

    • TaktischerSpeck
      Profi
      Reaktionen
      292
      Trophäen
      9
      Beiträge
      1.211
      Dateien
      6
      Bilder
      35
      • 8. Mai 2021 um 10:49
      • #4
      Zitat von Frenzy

      I mean. HP goes up When I wear seat belts, when ı have an accident. I think the problem is caused by this script. Even though I did everything from scratch, my dear suddenly becomes 100%.

      Code
      if ((vehicle _unit) isKindOf "Car" && (isNull _source || _source isEqualTo _unit)) then
      {
          _damage = if (life_seatbelt) then { _damage / 2 } else { _damage};
      };

      can you upload / show us your complete fn_handleDamage.sqf

      there is actuall no way that the HP go up with this code, so maybe there is an error in other lines of the file

      Mit freundlichen Grüßen

      TaktischerSpeck - Vincent

      2945262602.gif

      Leidenschaftlicher Analphabet mit leichtem Drang zum Sabbern.

      2945262602.gif
      Welcome to Arma, a game where Physics don't give a f*ck.

      2945262602.gif
      If (ArmA == Bullshit) exitWith {[] call f*uckThisShit};

      2945262602.gif

      Kontaktmöglichkeiten

      Twitch

      Youtube

      Steam

      TLG (Einfach nur TLG ins IP Feld (trust me its gonna work))

      --alternativ--

      Ts.TheLastGamer.de

      Website

      Forum

      E-Mail: [email protected]

      Twitch

      Youtube

      Steam

      TLG (Einfach nur TLG ins IP Feld (trust me its gonna work))

      --alternativ--

      Ts.TheLastGamer.de

      Website

      Forum

      E-Mail: [email protected]

    • blackfisch
      Legende
      Reaktionen
      2.944
      Trophäen
      9
      Beiträge
      5.966
      Dateien
      6
      Bilder
      63
      • 8. Mai 2021 um 11:41
      • #5
      Zitat von TaktischerSpeck

      can you upload / show us your complete fn_handleDamage.sqf

      there is actuall no way that the HP go up with this code, so maybe there is an error in other lines of the file

      wrong TaktischerSpeck

      The code itself is flawed.

      Return value of Damage EH is total new damage. Lower means less damage, so if you divide damage in half that doesn't mean "player gets half the damage" but "player gains 50% of his current HP value"

      if you want the player to receive half the damage you need to adapt your code like this (broken down to sub-statements for better understanding):

      C
      private _oldHP = damage _unit;
      private _damageTaken = _damage - _oldHP;
      
      // new HP value = old HP - 50% of damage taken
      _damage = _oldHP - (_damageTaken / 2);

      #MakeArmaNotWar

      Kein Support via PN & Steam! / No Support via DM & Steam!


      Mit freundlichen Grüßen
      blackfisch
      ______________________

      Web: blackfisch.me

      GitHub: GitHub.com/blackfisch

      Mail: [email protected]

      ______________________
      Wichtige Links:
      [Erklärung|Leitfaden] Code Optimierung

      [Tutorial] life_fnc_MP zu remoteExec

      Ohne Logs & entsprechende Dateien kein Support!

      ______________________

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 8. Mai 2021 um 19:09
      • #6
      Zitat von blackfisch

      wrong TaktischerSpeck

      The code itself is flawed.

      Return value of Damage EH is total new damage. Lower means less damage, so if you divide damage in half that doesn't mean "player gets half the damage" but "player gains 50% of his current HP value"

      if you want the player to receive half the damage you need to adapt your code like this (broken down to sub-statements for better understanding):

      C
      private _oldHP = damage _unit;
      private _damageTaken = _damage - _oldHP;
      
      // new HP value = old HP - 50% of damage taken

      This problem still persists did not fix. It was working very well before , :(

    • blackfisch
      Legende
      Reaktionen
      2.944
      Trophäen
      9
      Beiträge
      5.966
      Dateien
      6
      Bilder
      63
      • 9. Mai 2021 um 10:36
      • #7

      could you provide server & client logfiles of this issue?

      #MakeArmaNotWar

      Kein Support via PN & Steam! / No Support via DM & Steam!


      Mit freundlichen Grüßen
      blackfisch
      ______________________

      Web: blackfisch.me

      GitHub: GitHub.com/blackfisch

      Mail: [email protected]

      ______________________
      Wichtige Links:
      [Erklärung|Leitfaden] Code Optimierung

      [Tutorial] life_fnc_MP zu remoteExec

      Ohne Logs & entsprechende Dateien kein Support!

      ______________________

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 10. Mai 2021 um 00:52
      • #8
      Zitat von blackfisch

      could you provide server & client logfiles of this issue?

      I guess this is the file you said

      Dateien

      arma3server_2021-05-10_01-44-06.rpt 70,13 kB – 113 Downloads
    • TaktischerSpeck
      Profi
      Reaktionen
      292
      Trophäen
      9
      Beiträge
      1.211
      Dateien
      6
      Bilder
      35
      • 10. Mai 2021 um 11:03
      • #9
      Zitat von Frenzy

      I guess this is the file you said

      thats the server log, we would need your client log aswell

      keep in mind that you should try to trigger the error so that we maybe can spot something wrong

      Mit freundlichen Grüßen

      TaktischerSpeck - Vincent

      2945262602.gif

      Leidenschaftlicher Analphabet mit leichtem Drang zum Sabbern.

      2945262602.gif
      Welcome to Arma, a game where Physics don't give a f*ck.

      2945262602.gif
      If (ArmA == Bullshit) exitWith {[] call f*uckThisShit};

      2945262602.gif

      Kontaktmöglichkeiten

      Twitch

      Youtube

      Steam

      TLG (Einfach nur TLG ins IP Feld (trust me its gonna work))

      --alternativ--

      Ts.TheLastGamer.de

      Website

      Forum

      E-Mail: [email protected]

      Twitch

      Youtube

      Steam

      TLG (Einfach nur TLG ins IP Feld (trust me its gonna work))

      --alternativ--

      Ts.TheLastGamer.de

      Website

      Forum

      E-Mail: [email protected]

    • Henne
      Nerd
      Reaktionen
      155
      Trophäen
      7
      Beiträge
      840
      Bilder
      7
      • 10. Mai 2021 um 11:42
      • #10

      The code from Blackfisch ist not correct.

      The - must change to +.

      This is the correct code:

      Code
      private _oldHP = damage _unit;
      private _damageTaken = _damage - _oldHP;
      
      // new HP value = old HP + 50% of damage taken
      _damage = _oldHP + (_damageTaken / 2);
    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 10. Mai 2021 um 11:52
      • #11
      Zitat von Henne

      The code from Blackfisch ist not correct.

      The - must change to +.

      This is the correct code:

      Code
      private _oldHP = damage _unit;
      private _damageTaken = _damage - _oldHP;
      
      // new HP value = old HP + 50% of damage taken
      _damage = _oldHP + (_damageTaken / 2);

      how so?

    • blackfisch
      Legende
      Reaktionen
      2.944
      Trophäen
      9
      Beiträge
      5.966
      Dateien
      6
      Bilder
      63
      • 10. Mai 2021 um 16:38
      • #12
      Zitat von Frenzy

      how so?

      more damage -> less hp

      HP = 1 - Damage

      #MakeArmaNotWar

      Kein Support via PN & Steam! / No Support via DM & Steam!


      Mit freundlichen Grüßen
      blackfisch
      ______________________

      Web: blackfisch.me

      GitHub: GitHub.com/blackfisch

      Mail: [email protected]

      ______________________
      Wichtige Links:
      [Erklärung|Leitfaden] Code Optimierung

      [Tutorial] life_fnc_MP zu remoteExec

      Ohne Logs & entsprechende Dateien kein Support!

      ______________________

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 10. Mai 2021 um 17:02
      • #13
      Zitat von blackfisch

      more damage -> less hp

      HP = 1 - Damage

      _damage = _oldHP + (1 - Damage / 2);

      };

      will it be like this?

    • blackfisch
      Legende
      Reaktionen
      2.944
      Trophäen
      9
      Beiträge
      5.966
      Dateien
      6
      Bilder
      63
      • 11. Mai 2021 um 09:13
      • #14

      Henne already sent you the correct code.

      as I already said - the function needs the damage as return value, not the hp...

      #MakeArmaNotWar

      Kein Support via PN & Steam! / No Support via DM & Steam!


      Mit freundlichen Grüßen
      blackfisch
      ______________________

      Web: blackfisch.me

      GitHub: GitHub.com/blackfisch

      Mail: [email protected]

      ______________________
      Wichtige Links:
      [Erklärung|Leitfaden] Code Optimierung

      [Tutorial] life_fnc_MP zu remoteExec

      Ohne Logs & entsprechende Dateien kein Support!

      ______________________

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 11. Mai 2021 um 11:19
      • #15
      Zitat von blackfisch

      Henne already sent you the correct code.

      as I already said - the function needs the damage as return value, not the hp...

      Yes I know. But I want to know how to add. It will still be an error if I add it wrong. Can you check? If I added it wrong, can you fix it?

      Code
      #include "..\..\script_macros.hpp"
      /*
          File: fn_handleDamage.sqf
          Author: Bryan "Tonic" Boardwine
      
          Description:
          Handles damage, specifically for handling the 'tazer' pistol and nothing else.
      */
      params [
          ["_unit",objNull,[objNull]],
          ["_part","",[""]],
          ["_damage",0,[0]],
          ["_source",objNull,[objNull]],
          ["_projectile","",[""]],
          ["_index",0,[0]]
      ];
      
      //Handle the tazer first (Top-Priority).
      if (!isNull _source) then {
          if (_source != _unit) then {
              if (currentWeapon _source in ["hgun_P07_snds_F","arifle_SDAR_F"] && _projectile in ["B_9x21_Ball","B_556x45_dual"]) then {
                  if (side _source isEqualTo west && playerSide isEqualTo civilian) then {
                      _damage = 0;
                      if (alive player && !life_istazed && !life_isknocked && !(_unit getVariable ["restrained",false])) then {
                          private ["_distance"];
                          _distance = 35;
                          if (_projectile == "B_556x45_dual") then {_distance = 100;};
                          if (_unit distance _source < _distance) then {
                              if !(isNull objectParent player) then {
                                  if (typeOf (vehicle player) == "B_Quadbike_01_F") then {
                                      player action ["Eject",vehicle player];
                                      [_unit,_source] spawn life_fnc_tazed;
                                  };
                              } else {
                                  [_unit,_source] spawn life_fnc_tazed;
                              };
                          };
                      };
                  };
      
                  //Temp fix for super tasers on cops.
                  if (side _source isEqualTo west && (playerSide isEqualTo west || playerSide isEqualTo independent)) then {
                      _damage = 0;
                  };
              };
          };
      };
      
      if(!isNull _source) then {
         _isVehicle = if(vehicle _source != _source) then {true} else {false};
         if (_isVehicle) then {
              //_damage = false;
              _unit setDamage 0.0001;
         };
      };
      
      if ((vehicle _unit) isKindOf "Car" && (isNull _source || _source isEqualTo _unit)) then
      {
          _damage = if (life_seatbelt) then {_damage = _oldHP + (_damageTaken / 2); else { _damage};
      }
      
      [] spawn life_fnc_hudUpdate;
      _damage;
      Alles anzeigen
    • blackfisch
      Legende
      Reaktionen
      2.944
      Trophäen
      9
      Beiträge
      5.966
      Dateien
      6
      Bilder
      63
      • 11. Mai 2021 um 11:45
      • #16

      you didn't use the whole code... where did you define _oldHP? where _damageTaken?

      If you don't define variables you can't use them

      #MakeArmaNotWar

      Kein Support via PN & Steam! / No Support via DM & Steam!


      Mit freundlichen Grüßen
      blackfisch
      ______________________

      Web: blackfisch.me

      GitHub: GitHub.com/blackfisch

      Mail: [email protected]

      ______________________
      Wichtige Links:
      [Erklärung|Leitfaden] Code Optimierung

      [Tutorial] life_fnc_MP zu remoteExec

      Ohne Logs & entsprechende Dateien kein Support!

      ______________________

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 11. Mai 2021 um 12:02
      • #17
      Zitat von blackfisch

      you didn't use the whole code... where did you define _oldHP? where _damageTaken?

      If you don't define variables you can't use them

      Won't it be that way?

      Code
      if ((vehicle _unit) isKindOf "Car" && (isNull _source || _source isEqualTo _unit)) then
      {
          _damage = if (life_seatbelt) then {_damage = _oldHP + (_damageTaken / 2); else { _damage};
      }
    • blackfisch
      Legende
      Reaktionen
      2.944
      Trophäen
      9
      Beiträge
      5.966
      Dateien
      6
      Bilder
      63
      • 11. Mai 2021 um 12:50
      • #18
      Zitat von Henne

      The code from Blackfisch ist not correct.

      The - must change to +.

      This is the correct code:

      Code
      private _oldHP = damage _unit;
      private _damageTaken = _damage - _oldHP;
      
      // new HP value = old HP + 50% of damage taken
      _damage = _oldHP + (_damageTaken / 2);

      look at that code. There are variables defined you're missing!

      #MakeArmaNotWar

      Kein Support via PN & Steam! / No Support via DM & Steam!


      Mit freundlichen Grüßen
      blackfisch
      ______________________

      Web: blackfisch.me

      GitHub: GitHub.com/blackfisch

      Mail: [email protected]

      ______________________
      Wichtige Links:
      [Erklärung|Leitfaden] Code Optimierung

      [Tutorial] life_fnc_MP zu remoteExec

      Ohne Logs & entsprechende Dateien kein Support!

      ______________________

    • Frenzy
      Schüler
      Reaktionen
      1
      Trophäen
      5
      Beiträge
      124
      • 11. Mai 2021 um 14:03
      • #19
      Zitat von blackfisch

      look at that code. There are variables defined you're missing!

      Code
      if ((vehicle _unit) isKindOf "Car" && (isNull _source || _source isEqualTo _unit)) then
      {
          _damage = if (life_seatbelt) then {_damage = _oldHP + (_damageTaken / 2); else { _damage};
      }

      Can you help me organize this? I'm so confused. I don't know where to add what.

    • Marius1773
      Profi
      Reaktionen
      369
      Trophäen
      9
      Beiträge
      962
      • 11. Mai 2021 um 15:53
      • #20

      bro.. just search for some easy tutorials and instructions how SQF works.
      They gave you a complete code and you just have to define the variables and dont just copy and paste
      Take a looK. https://community.bistudio.com/wiki/Variables

      Windows Server :love:

      Das Heilige Buch der Arma 3 Scripter, die Arma 3 Scripter Bibel: https://community.bistudio.com/wiki/Category:Scripting_Commands

    Registrieren oder Einloggen

    Du bist noch kein Mitglied von NodeZone.net? Registriere dich kostenlos und werde Teil einer großartigen Community!

    Registrieren

    Benutzer online in diesem Thema

    • 1 Besucher

    Wichtige Links & Informationen

    Server & Hosting-Ressourcen

      Server Administration & Hosting Basics

      Windows Server Support & Guides

      Linux Server Configuration & Help

      Setting up TeamSpeak 3 & VoIP Servers

      Domains & Web Hosting for Beginners & Professionals

      Cloud Hosting, Docker & Kubernetes Tutorials

    Gameserver & Modding-Ressourcen

      ArmA 3 Tutorials & Script Collection

      Renting & Operating Gameservers

      DayZ Server Management & Help

      FiveM (GTA V) Server & Script Development

      Rust Server Modding & Administration

      Setting up & Optimizing ARK Survival Servers

    NodeZone.net – Deine Community für Gameserver, Server-Hosting & Modding

      NodeZone.net ist dein Forum für Gameserver-Hosting, Rootserver, vServer, Webhosting und Modding. Seit 2015 bietet unsere Community eine zentrale Anlaufstelle für Server-Admins, Gamer und Technikbegeisterte, die sich über Server-Management, Hosting-Lösungen und Spielemodding austauschen möchten.


      Ob Anleitungen für eigene Gameserver, Hilfe bei Root- und vServer-Konfigurationen oder Tipps zu Modding & Scripting – bei uns findest du fundiertes Wissen und praxisnahe Tutorials. Mit einer stetig wachsenden Community findest du hier Antworten auf deine Fragen, Projektpartner und Gleichgesinnte für deine Gaming- und Serverprojekte. Schließe dich NodeZone.net an und werde Teil einer aktiven Community rund um Server-Hosting, Gameserver-Management und Modding-Ressourcen.

    Wer jetzt nicht teilt ist selber Schuld:
    1. Nutzungsbestimmungen
    2. Datenschutzerklärung
    3. Impressum
    4. Urheberrechts- oder Lizenzverstoß melden
  • Trimax Design coded & layout by Gino Zantarelli 2023-2025©
    Community-Software: WoltLab Suite™