Skip to content

Commit 3e36b49

Browse files
that-edwardJason2605DomT602
authored
returns rental vehicles (#635)
* returns rental vehicles * Config option * Fix that weird mistake * Naming conventions Co-authored-by: Jason_000 <Jason2605@users.noreply.github.com> Co-authored-by: DomT602 <32492434+DomT602@users.noreply.github.com>
1 parent 941fdbe commit 3e36b49

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

Altis_Life.Altis/config/Config_Master.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class Life_Settings {
145145
vehicle_infiniteRepair[] = {false, false, true, false}; //Set to true for unlimited repairs with 1 toolkit. False will remove toolkit upon use. civilian, west, independent, east
146146
vehicleShop_rentalOnly[] = { "B_MRAP_01_hmg_F", "B_G_Offroad_01_armed_F", "B_Boat_Armed_01_minigun_F" }; //Vehicles that can only be rented and not purchased. (Last only for the session)
147147
vehicleShop_3D = false; //Add preview 3D inside Shop vehicle. Default : False
148+
vehicle_rentalReturn = false; //Can return rental vehicles to 'Store vehicle in garage', doesn't actually store it in garage.
148149

149150
/* Vehicle Purchase Prices */
150151
vehicle_purchase_multiplier_CIVILIAN = 1; //Civilian Vehicle Buy Price = Config_Vehicle price * multiplier

Altis_Life.Altis/stringtable.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2552,7 +2552,19 @@
25522552
<Italian>Il veicolo è in affitto e non può essere depositato in garage.</Italian>
25532553
<Portuguese>Esse veículo é alugado e não pode ser armazenado na garagem.</Portuguese>
25542554
<Polish>Pojazd wynajęty, nie możesz go schować w garażu.</Polish>
2555-
<Chinesesimp>载具是租赁的,不能存放在你的仓库里。</Chinesesimp>
2555+
<Chinesesimp>载具是租赁的,不能存放在你的仓库里。</Chinesesimp>
2556+
</Key>
2557+
<Key ID="STR_Garage_Store_NotPersistent2">
2558+
<Original>Thank you for returning the rental vehicle.</Original>
2559+
<Czech>Děkujeme za vrácení zapůjčeného vozidla.</Czech>
2560+
<Spanish>Gracias por devolver el vehículo de alquiler.</Spanish>
2561+
<Russian>Спасибо, что вернул автомобиль в аренду.</Russian>
2562+
<German>Vielen Dank für die Rückgabe des Mietwagens.</German>
2563+
<French>Nous vous remercions de nous avoir rendu le véhicule de location.</French>
2564+
<Italian>Grazie per aver restituito il veicolo a noleggio.</Italian>
2565+
<Portuguese>Obrigado por devolver o veículo alugado.</Portuguese>
2566+
<Polish>Dziękuję za zwrot wypożyczonego pojazdu.</Polish>
2567+
<Chinesesimp>感谢您归还租车。</Chinesesimp>
25562568
</Key>
25572569
<Key ID="STR_Garage_Store_NoOwnership">
25582570
<Original>That vehicle doesn't belong to you therefor you cannot store it in your garage.</Original>

life_hc/MySQL/Vehicles/fn_vehicleStore.sqf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@ if (_impound) exitWith {
6868

6969
// not persistent so just do this!
7070
if (_vInfo isEqualTo []) exitWith {
71-
[1,"STR_Garage_Store_NotPersistent",true] remoteExecCall ["life_fnc_broadcast",_ownerID];
71+
if (LIFE_SETTINGS(getNumber,"vehicle_rentalReturn") isEqualTo 1) then {
72+
[1,"STR_Garage_Store_NotPersistent2",true] remoteExecCall ["life_fnc_broadcast",_ownerID];
73+
if (!isNil "_vehicle" && {!isNull _vehicle}) then {
74+
deleteVehicle _vehicle;
75+
};
76+
} else {
77+
[1,"STR_Garage_Store_NotPersistent",true] remoteExecCall ["life_fnc_broadcast",_ownerID];
78+
};
7279
life_garage_store = false;
7380
_ownerID publicVariableClient "life_garage_store";
7481
};

life_server/Functions/Systems/fn_vehicleStore.sqf

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,14 @@ if (_impound) exitWith {
6767

6868
// not persistent so just do this!
6969
if (_vInfo isEqualTo []) exitWith {
70-
[1,"STR_Garage_Store_NotPersistent",true] remoteExecCall ["life_fnc_broadcast",(owner _unit)];
70+
if (LIFE_SETTINGS(getNumber,"vehicle_rentalReturn") isEqualTo 1) then {
71+
[1,"STR_Garage_Store_NotPersistent2",true] remoteExecCall ["life_fnc_broadcast",(owner _unit)];
72+
if (!isNil "_vehicle" && {!isNull _vehicle}) then {
73+
deleteVehicle _vehicle;
74+
};
75+
} else {
76+
[1,"STR_Garage_Store_NotPersistent",true] remoteExecCall ["life_fnc_broadcast",(owner _unit)];
77+
};
7178
life_garage_store = false;
7279
(owner _unit) publicVariableClient "life_garage_store";
7380
};

0 commit comments

Comments
 (0)