Civi Wiederbeleben

  • Frage
  • Quellcode: fn_revivePlayer.sqf

    1. //Fetch their name so we can shout it.
    2. _targetName = _target getVariable ["name","Unknown"];
    3. _title = format[localize "STR_Medic_Progress",_targetName];
    4. life_action_inUse = true; //Lockout the controls.
    5. _target setVariable ["Reviving",player,TRUE];
    6. //Setup our progress bar
    7. disableSerialization;
    8. 5 cutRsc ["life_progress","PLAIN"];
    9. _ui = uiNamespace getVariable ["life_progress",displayNull];
    10. _progressBar = _ui displayCtrl 38201;
    11. _titleText = _ui displayCtrl 38202;
    12. _titleText ctrlSetText format["%2 (1%1)...","%",_title];
    13. _progressBar progressSetPosition 0.01;
    14. _cP = 0.01;
    15. //Lets reuse the same thing!
    16. for "_i" from 0 to 1 step 0 do {
    17. if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
    18. [player,"AinvPknlMstpSnonWnonDnon_medic_1"] remoteExecCall ["life_fnc_animSync",RCLIENT];
    19. player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
    20. _medicmull = "MedicalGarbage_01_3x3_v1_F" createVehicle (getPos player);
    21. _medicmull setPos (getPos player);
    22. _medicitem = "Land_FirstAidKit_01_open_F" createVehicle (getPos player);
    23. _medicitem setPos (getPos player);
    24. };
    25. sleep .15;
    26. _cP = _cP + .01;
    27. _progressBar progressSetPosition _cP;
    28. _titleText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_title];
    29. if (_cP >= 1 || !alive player) exitWith {};
    30. if (life_istazed) exitWith {}; //Tazed
    31. if (life_isknocked) exitWith {}; //Knocked
    32. if (life_interrupted) exitWith {};
    33. if (player getVariable["restrained",false]) exitWith {};
    34. if (player distance _target > 4) exitWith {_badDistance = true;};
    35. if (_target getVariable ["Revive",FALSE]) exitWith {};
    36. if (_target getVariable ["Reviving",ObjNull] != player) exitWith {};
    37. };
    38. //Kill the UI display and check for various states
    39. 5 cutText ["","PLAIN"];
    40. player playActionNow "stop";
    41. if (_target getVariable ["Reviving",ObjNull] != player) exitWith {hint localize "STR_Medic_AlreadyReviving"};
    42. _target setVariable ["Reviving",NIL,TRUE];
    43. if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;};
    44. if (_target getVariable ["Revive",FALSE]) exitWith {hint localize "STR_Medic_RevivedRespawned"};
    45. if (player getVariable ["restrained",false]) exitWith {life_action_inUse = false;};
    46. if (!isNil "_badDistance") exitWith {titleText[localize "STR_Medic_TooFar","PLAIN"]; life_action_inUse = false;};
    47. if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
    48. BANK = BANK + _reviveCost;
    49. life_action_inUse = false;
    50. _target setVariable ["Revive",TRUE,TRUE];
    51. [profileName] remoteExecCall ["life_fnc_revived",_target];
    52. titleText[format[localize "STR_Medic_RevivePayReceive",_targetName,[_reviveCost] call life_fnc_numberText],"PLAIN"];
    53. sleep .6;
    54. player reveal _target;
    55. sleep 60;
    56. deleteVehicle _medicmull;
    57. deleteVehicle _medicitem;
    Alles anzeigen
    Zeile 22 - 25
    Zeile 65 - 67
    Forum: terrantitans.net/
    TS3: tt.terrantitans.net
    Altis Life Server IP: 217.79.178.7:2302


  • So funktioniert es jetzt
    Aber problem jetzt das Item "Land_FirstAidKit_01_open_F" spawnt jetzt genau unter mir wo bei die 2 setPos muss ich die Koordinaten eintragen?

    Quellcode

    1. #include "..\..\script_macros.hpp"
    2. /*
    3. File: fn_revivePlayer.sqf
    4. Author: Bryan "Tonic" Boardwine
    5. Description:
    6. Starts the revive process on the player.
    7. */
    8. private["_target","_revivable","_targetName","_ui","_progressBar","_titleText","_cP","_title","_reviveCost","_medicmull","_medicitem"];
    9. _target = param [0,ObjNull,[ObjNull]];
    10. if (isNull _target) exitWith {};
    11. _reviveCost = LIFE_SETTINGS(getNumber,"revive_fee");
    12. _revivable = _target getVariable ["Revive",FALSE];
    13. if (_revivable) exitWith {};
    14. if (_target getVariable ["Reviving",ObjNull] == player) exitWith {hint localize "STR_Medic_AlreadyReviving";};
    15. if (player distance _target > 5) exitWith {}; //Not close enough.
    16. //Fetch their name so we can shout it.
    17. _targetName = _target getVariable ["name","Unknown"];
    18. _title = format[localize "STR_Medic_Progress",_targetName];
    19. life_action_inUse = true; //Lockout the controls.
    20. _target setVariable ["Reviving",player,TRUE];
    21. //Setup our progress bar
    22. disableSerialization;
    23. 5 cutRsc ["life_progress","PLAIN"];
    24. _ui = uiNamespace getVariable ["life_progress",displayNull];
    25. _progressBar = _ui displayCtrl 38201;
    26. _titleText = _ui displayCtrl 38202;
    27. _titleText ctrlSetText format["%2 (1%1)...","%",_title];
    28. _progressBar progressSetPosition 0.01;
    29. _cP = 0.01;
    30. _medicmull = "MedicalGarbage_01_3x3_v1_F" createVehicle (getPos player);
    31. _medicmull setPos (getPos player);
    32. _medicitem = "Land_FirstAidKit_01_open_F" createVehicle (getPos player);
    33. _medicitem setPos (getPos player);
    34. //Lets reuse the same thing!
    35. for "_i" from 0 to 1 step 0 do {
    36. if (animationState player != "AinvPknlMstpSnonWnonDnon_medic_1") then {
    37. [player,"AinvPknlMstpSnonWnonDnon_medic_1"] remoteExecCall ["life_fnc_animSync",RCLIENT];
    38. player playMoveNow "AinvPknlMstpSnonWnonDnon_medic_1";
    39. };
    40. sleep .15;
    41. _cP = _cP + .01;
    42. _progressBar progressSetPosition _cP;
    43. _titleText ctrlSetText format["%3 (%1%2)...",round(_cP * 100),"%",_title];
    44. if (_cP >= 1 || !alive player) exitWith {};
    45. if (life_istazed) exitWith {}; //Tazed
    46. if (life_isknocked) exitWith {}; //Knocked
    47. if (life_interrupted) exitWith {};
    48. if (player getVariable["restrained",false]) exitWith {};
    49. if (player distance _target > 4) exitWith {_badDistance = true;};
    50. if (_target getVariable ["Revive",FALSE]) exitWith {};
    51. if (_target getVariable ["Reviving",ObjNull] != player) exitWith {};
    52. };
    53. //Kill the UI display and check for various states
    54. 5 cutText ["","PLAIN"];
    55. player playActionNow "stop";
    56. if (_target getVariable ["Reviving",ObjNull] != player) exitWith {hint localize "STR_Medic_AlreadyReviving"};
    57. _target setVariable ["Reviving",NIL,TRUE];
    58. if (!alive player || life_istazed || life_isknocked) exitWith {life_action_inUse = false;};
    59. if (_target getVariable ["Revive",FALSE]) exitWith {hint localize "STR_Medic_RevivedRespawned"};
    60. if (player getVariable ["restrained",false]) exitWith {life_action_inUse = false;};
    61. if (!isNil "_badDistance") exitWith {titleText[localize "STR_Medic_TooFar","PLAIN"]; life_action_inUse = false;};
    62. if (life_interrupted) exitWith {life_interrupted = false; titleText[localize "STR_NOTF_ActionCancel","PLAIN"]; life_action_inUse = false;};
    63. BANK = BANK + _reviveCost;
    64. life_action_inUse = false;
    65. _target setVariable ["Revive",TRUE,TRUE];
    66. [profileName] remoteExecCall ["life_fnc_revived",_target];
    67. titleText[format[localize "STR_Medic_RevivePayReceive",_targetName,[_reviveCost] call life_fnc_numberText],"PLAIN"];
    68. sleep .6;
    69. player reveal _target;
    70. sleep 60;
    71. deleteVehicle _medicmull;
    72. deleteVehicle _medicitem;
    Alles anzeigen
    Forum: terrantitans.net/
    TS3: tt.terrantitans.net
    Altis Life Server IP: 217.79.178.7:2302


  • Noch net getestet, aber versuch es mal damit:


    C-Quellcode: fn_revivePlayer.sqf

    1. _muellSpawnPosition = player modelToWorld[0,0.5,0];
    2. _muellSpawnPosition set [0.5,0];
    3. _muellSpawnPosition1 = player modelToWorld[0.5,0.5,0];
    4. _muellSpawnPosition1 set [0.8,0];
    5. _medicmull = "MedicalGarbage_01_3x3_v1_F" createVehicle ([0,0,0]);
    6. _medicmull setPos (_muellSpawnPosition);
    7. _medicitem = "Land_FirstAidKit_01_open_F" createVehicle ([0,0,0]);
    8. _medicitem setPos (_muellSpawnPosition1);
    Witzig wäre es auch, wenn man dem wiederbelebten Heini dann einen Kopfverband verpassen könnte und sein Helm halt weg ist :)


    Forum:
    outlawisland.de
    TS3: 89.163.140.167:9987

    Altis-Life-Server: 89.163.140.167:2302
    Wasteland-Server: 89.163.140.167:2502