après la mise à jour Arma Serve(L'arme sert), le script que j'ai modifié a cessé de fonctionner.
le script d'origine était très pollué et il n'a pas fonctionné dans ma mission c'est celui-ci, mais il a fonctionné dans la mission par défaut de tonic
[CODE lang="csharp" title="Original"]#include "..\..\script_macros.hpp"
/*
File: fn_medico.sqf
Author: GhostsBR
Description: script de maca para o samu.
*/
_ambulancia = nearestObject [player, "C_Van_02_medevac_F"];
_heli = nearestObject [player, "B_Heli_Light_01_F"];
if (side player isEqualto civilian) exitWith {hint "";};
if (side player isEqualto west) exitWith {hint "";};
if (vehicle player != player) exitWith {hint "Você não pode usar a maca dentro do veiculo.";};
if (player distance _ambulancia < 5) then {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
if (player distance _obj < 5) exitWith {hint "Já existe uma maca proxima de você";};
_maca = "Land_Stretcher_01_F" createVehicle position player;
action_carregar = {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
_obj attachTo [player, [0, 1.10, 0.60] ];
_ambulancia = nearestObject [player, "C_Van_02_medevac_F"];
soltar = player addAction ["Soltar Maca", {call action_soltar;}];
_obj removeAction pegar;
_ambulancia removeAction veiculo;
veiculo = _ambulancia addAction ["Colocar na Ambulancia", {call action_colocar;}];
player removeAction levar;
};
action_levar = {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
_fe = nearestObjects [player, ["C_man_1"], 5];
_ferido = _fe select 0;
_ferido attachTo [_obj, [0, 0.20, 0.25] ];
};
action_soltar = {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
_ambulancia = nearestObject [player, "C_Van_02_medevac_F"];
_obj = nearestObject [player, "Land_Stretcher_01_F"];
detach _obj;
ativo = false;
pegar = _obj addAction ["Pegar Maca", {call action_carregar;}];
levar = player addAction ["Colocar Jogador", {call action_levar;}];
_ambulancia removeAction veiculo;
player removeAction soltar;
};
action_colocar = {
_fe = nearestObjects [player, ["C_man_1"], 5];
_ferido = _fe select 0;
_obj = nearestObject [player, "Land_Stretcher_01_F"];
_ambulancia = nearestObject [player, "C_Van_02_medevac_F"];
_nearestVehicle = nearestObject [player, "C_Van_02_medevac_F"];
player removeAction soltar;
_obj removeAction pegar;
_ambulancia removeAction veiculo;
deleteVehicle _obj;
[_nearestVehicle] remoteExecCall ["life_fnc_moveIn",_ferido];
};
call action_carregar;
};
if (player distance _heli < 5) then {
if (player distance _ambulancia > 3) then {
_obj2 = nearestObject [player, "Land_Stretcher_01_olive_F"];
if (player distance _obj2 < 5) exitWith {hint "Já existe uma maca proxima de você";};
_maca = "Land_Stretcher_01_olive_F" createVehicle position player;
action_carregar = {
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
_obj attachTo [player, [0, 1.10, 0.60] ];
_ambulancia = nearestObject [player, "B_Heli_Light_01_F"];
soltar = player addAction ["Soltar Maca", {call action_soltar;}];
_obj removeAction pegar;
_ambulancia removeAction veiculo;
veiculo = _ambulancia addAction ["Colocar na Ambulancia", {call action_colocar;}];
player removeAction levar;
};
action_levar = {
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
_fe = nearestObjects [player, ["C_man_1"], 5];
_ferido = _fe select 0;
_ferido attachTo [_obj, [0, 0.20, 0.25] ];
};
action_soltar = {
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
_ambulancia = nearestObject [player, "B_Heli_Light_01_F"];
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
detach _obj;
ativo = false;
pegar = _obj addAction ["Pegar Maca", {call action_carregar;}];
levar = player addAction ["Colocar Jogador", {call action_levar;}];
_ambulancia removeAction veiculo;
player removeAction soltar;
};
action_colocar = {
_fe = nearestObjects [player, ["C_man_1"], 5];
_ferido = _fe select 0;
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
_ambulancia = nearestObject [player, "B_Heli_Light_01_F"];
_nearestVehicle = nearestObject [player, "B_Heli_Light_01_F"];
player removeAction soltar;
_obj removeAction pegar;
_ambulancia removeAction veiculo;
deleteVehicle _obj;
[_nearestVehicle] remoteExecCall ["life_fnc_moveIn",_ferido];
};
call action_carregar;
};
};[/CODE]
Je l'ai changé en ceci, cela a fonctionné jusqu'à la mise à jour.
[CODE lang="csharp" title="modificado"]#include "..\..\script_macros.hpp"
/*
File: fn_medico.sqf
Description: script de maca para o samu.
*/
if (PlayerSide in [west,civilian,east]) exitWith {};
if (vehicle player != player) exitWith {hint "Você não pode usar a maca dentro do veiculo."};
ambulanciasClass = ["MM_Ducato_cube_vsav_sp","MM_Duster_vlhr_sp","MM_Ranger17_vlhr_sp","MM_FC_sp","MM_Renault_ccgc_sp","MM_BEA_sp","MM_Renault_fpt_sp","B_Heli_Light_01_F"];
Private _ambulancia = (nearestObjects [player, ambulanciasClass, 5]) Select 0;
Private _obj4 = (nearestObjects [player, ["Land_Stretcher_01_F"], 15]) Select 0;
if (player distance _obj4 < 30) exitWith {hint "Já existe uma maca proxima de você"};
if (player distance _ambulancia < 10) then {
_maca = "Land_Stretcher_01_F" createVehicle position player;
call action_carregar
};
action_carregar = {
_obj3 = (nearestObjects [player, ["Land_Stretcher_01_F"], 15]) Select 0;
_obj3 attachTo [player, [0, 1.10, 0.60] ];
RJ_CarregandoMaca = true;
};
action_levar = {
_fe2 = (nearestObjects [player, ["C_man_1"], 15]) Select 0;
_obj2 = (nearestObjects [player, ["Land_Stretcher_01_F"], 15]) Select 0;
_fe2 attachTo [_obj2, [0, 0.20, 0.25] ];
};
action_soltar = {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
detach _obj;
RJ_CarregandoMaca = false;
};
action_colocar = {
_fe1 = (nearestObjects [player, ["C_man_1"], 15]) Select 0;
_obj1 = (nearestObjects [player, ["Land_Stretcher_01_F"], 15]) Select 0;
_nearestVehicle = (nearestObjects [player, ambulanciasClass, 5]) Select 0;
deleteVehicle _obj1;
[_nearestVehicle] remoteExecCall ["life_fnc_moveIn",_fe1];
};[/CODE]
la partie qui ne fonctionne pas est l'action_levar.
le script d'origine était très pollué et il n'a pas fonctionné dans ma mission c'est celui-ci, mais il a fonctionné dans la mission par défaut de tonic
[CODE lang="csharp" title="Original"]#include "..\..\script_macros.hpp"
/*
File: fn_medico.sqf
Author: GhostsBR
Description: script de maca para o samu.
*/
_ambulancia = nearestObject [player, "C_Van_02_medevac_F"];
_heli = nearestObject [player, "B_Heli_Light_01_F"];
if (side player isEqualto civilian) exitWith {hint "";};
if (side player isEqualto west) exitWith {hint "";};
if (vehicle player != player) exitWith {hint "Você não pode usar a maca dentro do veiculo.";};
if (player distance _ambulancia < 5) then {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
if (player distance _obj < 5) exitWith {hint "Já existe uma maca proxima de você";};
_maca = "Land_Stretcher_01_F" createVehicle position player;
action_carregar = {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
_obj attachTo [player, [0, 1.10, 0.60] ];
_ambulancia = nearestObject [player, "C_Van_02_medevac_F"];
soltar = player addAction ["Soltar Maca", {call action_soltar;}];
_obj removeAction pegar;
_ambulancia removeAction veiculo;
veiculo = _ambulancia addAction ["Colocar na Ambulancia", {call action_colocar;}];
player removeAction levar;
};
action_levar = {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
_fe = nearestObjects [player, ["C_man_1"], 5];
_ferido = _fe select 0;
_ferido attachTo [_obj, [0, 0.20, 0.25] ];
};
action_soltar = {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
_ambulancia = nearestObject [player, "C_Van_02_medevac_F"];
_obj = nearestObject [player, "Land_Stretcher_01_F"];
detach _obj;
ativo = false;
pegar = _obj addAction ["Pegar Maca", {call action_carregar;}];
levar = player addAction ["Colocar Jogador", {call action_levar;}];
_ambulancia removeAction veiculo;
player removeAction soltar;
};
action_colocar = {
_fe = nearestObjects [player, ["C_man_1"], 5];
_ferido = _fe select 0;
_obj = nearestObject [player, "Land_Stretcher_01_F"];
_ambulancia = nearestObject [player, "C_Van_02_medevac_F"];
_nearestVehicle = nearestObject [player, "C_Van_02_medevac_F"];
player removeAction soltar;
_obj removeAction pegar;
_ambulancia removeAction veiculo;
deleteVehicle _obj;
[_nearestVehicle] remoteExecCall ["life_fnc_moveIn",_ferido];
};
call action_carregar;
};
if (player distance _heli < 5) then {
if (player distance _ambulancia > 3) then {
_obj2 = nearestObject [player, "Land_Stretcher_01_olive_F"];
if (player distance _obj2 < 5) exitWith {hint "Já existe uma maca proxima de você";};
_maca = "Land_Stretcher_01_olive_F" createVehicle position player;
action_carregar = {
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
_obj attachTo [player, [0, 1.10, 0.60] ];
_ambulancia = nearestObject [player, "B_Heli_Light_01_F"];
soltar = player addAction ["Soltar Maca", {call action_soltar;}];
_obj removeAction pegar;
_ambulancia removeAction veiculo;
veiculo = _ambulancia addAction ["Colocar na Ambulancia", {call action_colocar;}];
player removeAction levar;
};
action_levar = {
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
_fe = nearestObjects [player, ["C_man_1"], 5];
_ferido = _fe select 0;
_ferido attachTo [_obj, [0, 0.20, 0.25] ];
};
action_soltar = {
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
_ambulancia = nearestObject [player, "B_Heli_Light_01_F"];
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
detach _obj;
ativo = false;
pegar = _obj addAction ["Pegar Maca", {call action_carregar;}];
levar = player addAction ["Colocar Jogador", {call action_levar;}];
_ambulancia removeAction veiculo;
player removeAction soltar;
};
action_colocar = {
_fe = nearestObjects [player, ["C_man_1"], 5];
_ferido = _fe select 0;
_obj = nearestObject [player, "Land_Stretcher_01_olive_F"];
_ambulancia = nearestObject [player, "B_Heli_Light_01_F"];
_nearestVehicle = nearestObject [player, "B_Heli_Light_01_F"];
player removeAction soltar;
_obj removeAction pegar;
_ambulancia removeAction veiculo;
deleteVehicle _obj;
[_nearestVehicle] remoteExecCall ["life_fnc_moveIn",_ferido];
};
call action_carregar;
};
};[/CODE]
Je l'ai changé en ceci, cela a fonctionné jusqu'à la mise à jour.
[CODE lang="csharp" title="modificado"]#include "..\..\script_macros.hpp"
/*
File: fn_medico.sqf
Description: script de maca para o samu.
*/
if (PlayerSide in [west,civilian,east]) exitWith {};
if (vehicle player != player) exitWith {hint "Você não pode usar a maca dentro do veiculo."};
ambulanciasClass = ["MM_Ducato_cube_vsav_sp","MM_Duster_vlhr_sp","MM_Ranger17_vlhr_sp","MM_FC_sp","MM_Renault_ccgc_sp","MM_BEA_sp","MM_Renault_fpt_sp","B_Heli_Light_01_F"];
Private _ambulancia = (nearestObjects [player, ambulanciasClass, 5]) Select 0;
Private _obj4 = (nearestObjects [player, ["Land_Stretcher_01_F"], 15]) Select 0;
if (player distance _obj4 < 30) exitWith {hint "Já existe uma maca proxima de você"};
if (player distance _ambulancia < 10) then {
_maca = "Land_Stretcher_01_F" createVehicle position player;
call action_carregar
};
action_carregar = {
_obj3 = (nearestObjects [player, ["Land_Stretcher_01_F"], 15]) Select 0;
_obj3 attachTo [player, [0, 1.10, 0.60] ];
RJ_CarregandoMaca = true;
};
action_levar = {
_fe2 = (nearestObjects [player, ["C_man_1"], 15]) Select 0;
_obj2 = (nearestObjects [player, ["Land_Stretcher_01_F"], 15]) Select 0;
_fe2 attachTo [_obj2, [0, 0.20, 0.25] ];
};
action_soltar = {
_obj = nearestObject [player, "Land_Stretcher_01_F"];
detach _obj;
RJ_CarregandoMaca = false;
};
action_colocar = {
_fe1 = (nearestObjects [player, ["C_man_1"], 15]) Select 0;
_obj1 = (nearestObjects [player, ["Land_Stretcher_01_F"], 15]) Select 0;
_nearestVehicle = (nearestObjects [player, ambulanciasClass, 5]) Select 0;
deleteVehicle _obj1;
[_nearestVehicle] remoteExecCall ["life_fnc_moveIn",_fe1];
};[/CODE]
la partie qui ne fonctionne pas est l'action_levar.