Français Erreur de paiement soins hôpital

Teravince

User
29/12/19
81
4
10
450
36
Pinon 02320
Salut a tous je viens vous voir car je tente de faire en sort que les soins a l’hôpital soit reversé sur les compte des sapeurs pompiers, actuellement l'argent va bien sur le compte mais le joueur est pas débité en argent sa fait des soin a 0€

Voici le code du fichier : fn_healHospital.sqf
Code:
#include "..\..\script_macros.hpp"
/*
    File: fn_healHospital.sqf
    Author: Bryan "Tonic" Boardwine
    Reworked: Jesse "TKCJesse" Schultz

    Description:
    Prompts user with a confirmation dialog to heal themselves.
    Used at the hospitals to restore health to full.
    Note: Dialog helps stop a few issues regarding money loss.
*/
private ["_healCost","_action"];
if (life_action_inUse) exitWith {};
if ((damage player) < 0.01) exitWith {hint localize "STR_NOTF_HS_FullHealth"};
_healCost = LIFE_SETTINGS(getNumber,"hospital_heal_fee");
if (CASH < _healCost) exitWith {hint format [localize "STR_NOTF_HS_NoCash",[_healCost] call life_fnc_numberText];};

life_action_inUse = true;
_action = [
    format [localize "STR_NOTF_HS_PopUp",[_healCost] call life_fnc_numberText],
    localize "STR_NOTF_HS_TITLE",
    localize "STR_Global_Yes",
    localize "STR_Global_No"
] call BIS_fnc_guiMessage;

if (_action) then {
    titleText[localize "STR_NOTF_HS_Healing","PLAIN"];
    closeDialog 0;
    uiSleep 8;
    if (player distance (_this select 0) > 5) exitWith {life_action_inUse = false; titleText[localize "STR_NOTF_HS_ToFar","PLAIN"]};
    titleText[localize "STR_NOTF_HS_Healed","PLAIN"];
    player setDamage 0;
    /*CASH = CASH - _healCost;*/
    maxence_compte_med = maxence_compte_med + _healCost;
    publicVariable "maxence_compte_med";
    [maxence_compte_gouv,maxence_compte_cop,maxence_compte_med,maxence_compte_east,(name player),(name player),(["STR_MED_ACCOUNT","Max_Settings_Gouvernement","Gouvernement_Localization"] call theprogrammer_core_fnc_localize),_value,0] remoteExec ["max_gouvernement_fnc_updateAccounts",2];

    life_action_inUse = false;
} else {
    hint localize "STR_NOTF_ActionCancel";
    closeDialog 0;
    life_action_inUse = false;
};
 
Il faut que le joueur qui doit être débité soit ciblé et que son compte soit débité dans le code.

Je vois bien que l'argent arrive bien sur le compte des sapeurs pompiers :
C++:
maxence_compte_med = maxence_compte_med + _healCost;

Par contre, à quel moment le compte de la cible est débité ?

Plusieurs possibilités mais au plus simple, le joueur cible est récupéré dans une variable (potentiellement : private _target = cursorTarget;) puis tu peux remoteExec un hint ou autre à ta cible pour qu'elle sache qu'elle ait été débitée.
 
Upvote 0