Français Solved Comment faire pour que 2 objets fonctionnent comme un radar ?

  • Auteur de la discussion Auteur de la discussion zachary ruc
  • Date de début Date de début
4/6/21
246
15
31
950
Hello! Je cherches à faire en sorte que 2 objets ais la fonction d'être un radar, suite à des conseils sur discord j'ai faits ce qui suit mais j'ai toujours une erreur ... comment faire pour mettre les 2 objets ?
 

Fichiers joints

  • fn_radar.sqf
    fn_radar.sqf
    920 bytes · Affichages: 5
  • ArmA 3 Screenshot 2022.10.30 - 10.31.44.34.png
    ArmA 3 Screenshot 2022.10.30 - 10.31.44.34.png
    52.8 KB · Affichages: 20
Solution
Salut, tu as oublié l'argument du currentWeapon :

Code:
/*
    File: fn_radar.sqf
    Author: Silly Aussie kid named Jaydon

    Description:
    Looks like weird but radar?
*/
if !(playerSide isEqualTo west) exitWith {};
private ["_speed","_vehicle"];
_vehicle = cursorObject;
_speed = round speed _vehicle;

if ((_vehicle isKindOf "Car") && ((currentWeapon player) in ["Rangefinder","TMG_Radar_Base"]))
then {
    switch (true) do {
        case (_speed > 33 && _speed <= 80): {
            hint parseText format ["<t color='#ffffff'><t size='2'><t align='center'>" +(localize "STR_Cop_Radar")+ "<br/><t color='#33CC33'><t align='center'><t size='1'>" +(localize "STR_Cop_VehSpeed"),round  _speed];
        };

        case (_speed > 80): {...
Salut, tu as oublié l'argument du currentWeapon :

Code:
/*
    File: fn_radar.sqf
    Author: Silly Aussie kid named Jaydon

    Description:
    Looks like weird but radar?
*/
if !(playerSide isEqualTo west) exitWith {};
private ["_speed","_vehicle"];
_vehicle = cursorObject;
_speed = round speed _vehicle;

if ((_vehicle isKindOf "Car") && ((currentWeapon player) in ["Rangefinder","TMG_Radar_Base"]))
then {
    switch (true) do {
        case (_speed > 33 && _speed <= 80): {
            hint parseText format ["<t color='#ffffff'><t size='2'><t align='center'>" +(localize "STR_Cop_Radar")+ "<br/><t color='#33CC33'><t align='center'><t size='1'>" +(localize "STR_Cop_VehSpeed"),round  _speed];
        };

        case (_speed > 80): {
            hint parseText format ["<t color='#ffffff'><t size='2'><t align='center'>" +(localize "STR_Cop_Radar")+ "<br/><t color='#FF0000'><t align='center'><t size='1'>" +(localize "STR_Cop_VehSpeed"),round  _speed];
        };
    };
};
 
Solution