English [License plates] Display on D3S cars

  • Auteur de la discussion Auteur de la discussion Loic Shmit
  • Date de début Date de début

Loic Shmit

User
25/8/18
40
2
35
300
the-programmer.com
Hello, in this Tutorial I will show you how to make work D3S Cars with License Plates

Let's start the tutorial !

In the following files @The_Programmer/addons/license_plates/client/
  • fn_vehicleBuyImmatriculation.sqf
  • fn_newPlate.sqf
  • fn_maskPlate.sqf
  • fn_customPlateConfirm.sqf
And in the files @The_Programmer/addons/license_plates/server/
  • fn_initVehicleImmatriculation.sqf
  • fn_updatePlate.sqf
Add at the end of each file :
Code:
Développer Réduire Copier
[_vehicle] call d3s_fnc_setLicense;

Replace the file @modpack/addons/d3s_cars_core/functions/vehicle/fn_setlicense.sqf by :
Code:
Développer Réduire Copier
/*
    Author : Maxence
*/
_vehicle = param [0,objNull,[objNull]];
if !(local _vehicle) exitWith {false};

_license = _vehicle getVariable ["vehicle_info_plate",""];

if !(_license in ["","0"]) then {
    _licenseArr = _license splitString "";

    {
        _licenseChar = _x;
        _licenseChar = toLower _licenseChar;

        if !(_licenseChar in ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]) then {
            _licenseArr deleteAt _forEachIndex;
        };
    } forEach _licenseArr;

    _licenseArr resize 7;

    {
        _licenseChar = _licenseArr select _forEachIndex;
        if (isNil {_licenseChar}) then {_licenseChar = "";};
        _licenseChar = toLower _licenseChar;

        if (_licenseChar in ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]) then {
            _vehicle setObjectTextureGlobal [_x,format ["d3s_cars_core\license\%1.paa",_licenseChar]];
        } else {
            _vehicle setObjectTextureGlobal [_x, ""];
        };
    } forEach [20,21,22,23,24,25,26];
} else {
    {
        _vehicle setObjectTextureGlobal [_x, ""];
    } forEach [20,21,22,23,24,25,26];
};

true;

Replace the file @modpack/addons/d3s_f10_12/functions/vehicle/fn_setlicense.sqf by :
Code:
Développer Réduire Copier
/*
    Author : Maxence
*/
_vehicle = param [0,objNull,[objNull]];
if !(local _vehicle) exitWith {false};

_license = _vehicle getVariable ["vehicle_info_plate",""];

if !(_license in ["","0"]) then {
    _licenseArr = _license splitString "";

    {
        _licenseChar = _x;
        _licenseChar = toLower _licenseChar;

        if !(_licenseChar in ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]) then {
            _licenseArr deleteAt _forEachIndex;
        };
    } forEach _licenseArr;

    _licenseArr resize 7;

    {
        _licenseChar = _licenseArr select _forEachIndex;
        if (isNil {_licenseChar}) then {_licenseChar = "";};
        _licenseChar = toLower _licenseChar;

        if (_licenseChar in ["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]) then {
            _vehicle setObjectTextureGlobal [_x,format ["d3s_cars_core\license\%1.paa",_licenseChar]];
        } else {
            _vehicle setObjectTextureGlobal [_x, ""];
        };
    } forEach [20,21,22,23,24,25,26];
} else {
    {
        _vehicle setObjectTextureGlobal [_x, ""];
    } forEach [20,21,22,23,24,25,26];
};

true;

And that's it !

Sincerely,
Forum Manager Loic Shmit
 
Dernière édition par un modérateur:
  • Like
Les réactions: IceEagle132
Activité
Pour l'instant, il n'y a personne ici