[Finie]Assurance 4.4R1
Page 1 sur 2 • 1, 2
[Finie]Assurance 4.4R1
Dans mpmissions\dialog\impound.hpp
Trouver:
Placer apres :
Trouver:
- Code:
class BuyCar : life_RscButtonMenu
{
idc = -1;
text = "$STR_Global_Sell";
onButtonClick = "[] call life_fnc_sellGarage; closeDialog 0;";
x = 0.26 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = (6.25 / 40);
h = (1 / 25);
};
Placer apres :
- Code:
class InsureCar : life_RscButtonMenu
{
idc = 97480;
text = "Assurer";
onButtonClick = "[] call life_fnc_InsureCar;";
x = 0.43 + (6.25 / 40) + (1 / 250 / (safezoneW / safezoneH));
y = 0.9 - (1 / 25);
w = (6.25 / 40);
h = (1 / 25);
};
! Fait !
Dernière édition par Slift le Lun 20 Fév - 22:36, édité 2 fois
Slift- Messages : 143
Date d'inscription : 28/01/2017
Age : 37
Localisation : Bordeaux
Fiche RP
Prénom/Nom : *****
Profession:
Grade: *****
Re: [Finie]Assurance 4.4R1
Créer le fichier fn_insureCar.sqf dansmpmissions\dialog\function
Contenu:
Contenu:
- Code:
#include "..\..\script_macros.hpp"
/*
File: fn_insureCar.sqf
Author: Guit0x "Lintox"
Description:
Insure a vehicle from the garage.
*/
private["_vehicle","_vid","_pid","_unit","_price"];
disableSerialization;
if(EQUAL(lbCurSel 2802,-1)) exitWith {hint localize "STR_Global_NoSelection"};
_vehicle = lbData[2802,(lbCurSel 2802)];
_vehicle = (call compile format["%1",_vehicle]) select 0;
_vid = lbValue[2802,(lbCurSel 2802)];
_pid = steamid;
_unit = player;
if(isNil "_vehicle") exitWith {hint localize "STR_Garage_Selection_Error"};
_Price = switch(playerSide) do {
case civilian: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_vehicle,"insurance"),0)};
case west: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_vehicle,"insurance"),1)};
case independent: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_vehicle,"insurance"),2)};
case east: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_vehicle,"insurance"),3)};
};
if(!(EQUAL(typeName _Price,typeName 0)) OR _Price < 1) then {_Price = 1000};
if(BANK < _price) exitWith {hint format[(localize "STR_GNOTF_NotEnoughMoney"),[_price] call life_fnc_numberText];};
[[_vid,_pid,_unit,_price],"TON_fnc_insureCar",false,false] spawn life_fnc_MP;
hint localize "STR_Assur_OK";
SUB(BANK,_price);
closeDialog 0;
! Fait !
Dernière édition par Slift le Lun 20 Fév - 5:44, édité 1 fois
Slift- Messages : 143
Date d'inscription : 28/01/2017
Age : 37
Localisation : Bordeaux
Fiche RP
Prénom/Nom : *****
Profession:
Grade: *****
Re: [Finie]Assurance 4.4R1
Dans mpmissions\Functions.hpp
Trouver:
Y ajouter:
Trouver:
- Code:
class Dialog_Controls
Y ajouter:
- Code:
class insureCar {};
! Fait !
Dernière édition par Slift le Lun 20 Fév - 6:35, édité 3 fois
Slift- Messages : 143
Date d'inscription : 28/01/2017
Age : 37
Localisation : Bordeaux
Fiche RP
Prénom/Nom : *****
Profession:
Grade: *****
Re: [Finie]Assurance 4.4R1
Dans life_server\config.cpp
Trouver:
Y ajouter :
Trouver:
- Code:
class TON_System {
tag = "TON";
class Systems {
file = "\life_server\Functions\Systems";
Y ajouter :
- Code:
class insureCar {};
! Fait !
Dernière édition par Slift le Lun 20 Fév - 6:36, édité 1 fois
Slift- Messages : 143
Date d'inscription : 28/01/2017
Age : 37
Localisation : Bordeaux
Fiche RP
Prénom/Nom : *****
Profession:
Grade: *****
Re: [Finie]Assurance 4.4R1
Dans life_server\Functions\Systems\fn_spawnVehicle.sqf
Trouver :
Remplacer par :
Contrôle des quotes
Trouver:
Remplacer par:
Contrôle des quotes
Trouver:
Remplacer par:
Contrôle des quotes
Trouver :
- Code:
_query = format["SELECT id, side, classname, type, pid, alive, active, plate, color, inventory, gear, fuel FROM vehicles WHERE id='%1' AND pid='%2'",_vid,_pid];
Remplacer par :
- Code:
_query = format[“SELECT id, side, classname, type, pid, alive, active, plate, color, inventory, gear, fuel, insure FROM vehicles WHERE id=’%1’ AND pid=’%2’”,_vid,_pid];
Contrôle des quotes
! Fait !
Trouver:
- Code:
_vehicle setVariable["dbInfo",[(_vInfo select 4),_vInfo select 7]];
Remplacer par:
- Code:
_vehicle setVariable[“dbInfo”,[(_vInfo select 4),_vInfo select 7,_vInfo select 12]];
Contrôle des quotes
! Fait !
Trouver:
- Code:
[1,"Your vehicle is ready!"] remoteExecCall ["life_fnc_broadcast",_unit];
serv_sv_use deleteAt _servIndex;
Remplacer par:
- Code:
if(EQUAL(SEL(_vInfo,12),1)) then
{
[[1,“Votre véhicule est disponible et il est assuré!”],“life_fnc_broadcast”,_unit,false] spawn life_fnc_MP;
}
else
{
[[1,“Votre véhicule est disponible mais il n’est pas assuré!”],“life_fnc_broadcast”,_unit,false] spawn life_fnc_MP;
};
serv_sv_use deleteAt _servIndex;
Contrôle des quotes
! Fait !
Dernière édition par Slift le Lun 20 Fév - 7:28, édité 2 fois
Slift- Messages : 143
Date d'inscription : 28/01/2017
Age : 37
Localisation : Bordeaux
Fiche RP
Prénom/Nom : *****
Profession:
Grade: *****
Re: [Finie]Assurance 4.4R1
Créer le fichier fn_insureCar.sqf dans life_server\functions\Systems
Contenu:
Contenu:
- Code:
/*
Fichier: fn_insureCar.sqf
Auteur: Guit0x "Lintox"
Traduction: Apocalyptos
Description: Assurance véhicule à partir du garage.
*/
private["_vid","_pid","_query","_sql", "_unit", "_assurPrice", "_thread"];
_vid = [_this,0,-1,[0]] call BIS_fnc_param;
_pid = [_this,1,"",[""]] call BIS_fnc_param;
_unit = [_this,2,ObjNull,[ObjNull]] call BIS_fnc_param;
_assurPrice = [_this,3,0,[0]] call BIS_fnc_param;
_query = format["UPDATE vehicles SET insure='1' WHERE pid='%1' AND id='%2'",_pid,_vid];
waitUntil {!DB_Async_Active};
_thread = [_query,1] call DB_fnc_asyncCall;
! Fait !
Dernière édition par Slift le Lun 20 Fév - 6:42, édité 1 fois
Slift- Messages : 143
Date d'inscription : 28/01/2017
Age : 37
Localisation : Bordeaux
Fiche RP
Prénom/Nom : *****
Profession:
Grade: *****
Re: [Finie]Assurance 4.4R1
Dans mpmissions\dialog\function\fn_garageLBChange.sqf
Remplacer le tout par :
Remplacer le tout par :
- Code:
#include “…\script_macros.hpp”
/*
File: fn_garageLBChange.sqf
Author: Bryan “Tonic” Boardwine
Description:
Can't be bothered to answer it.. Already deleted it by accident..
*/
disableSerialization;
private["_control","_index","_className","_classNameLife","_dataArr","_vehicleColor","_vehicleInfo","_trunkSpace","_sellPrice","_retrievePrice","_assurPrice","_assur"];
_control = SEL(_this,0);
_index = SEL(_this,1);
//Fetch some information.
_dataArr = CONTROL_DATAI(_control,_index);
_dataArr = call compile format["%1",_dataArr];
_className = SEL(_dataArr,0);
_classNameLife = _className;
_assur = SEL(_dataArr,2);
if(!isClass (missionConfigFile >> CONFIG_LIFE_VEHICLES >> _classNameLife)) then {
_classNameLife = “Default”; //Use Default class if it doesn’t exist
diag_log format["%1: LifeCfgVehicles class doesn’t exist",_className];
};
_vehicleColor = SEL(SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“textures”),SEL(_dataArr,1)),0);
if(isNil “_vehicleColor”) then {_vehicleColor = “Default”;};
_vehicleInfo = [_className] call life_fnc_fetchVehInfo;
_trunkSpace = [_className] call life_fnc_vehicleWeightCfg;
_retrievePrice = switch(playerSide) do {
case civilian: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“storageFee”),0)};
case west: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“storageFee”),1)};
case independent: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“storageFee”),2)};
case east: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“storageFee”),3)};
};
_sellPrice = switch(playerSide) do {
case civilian: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“garageSell”),0)};
case west: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“garageSell”),1)};
case independent: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“garageSell”),2)};
case east: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“garageSell”),3)};
};
_assurPrice = switch(playerSide) do {
case civilian: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“insurance”),0)};
case west: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“insurance”),1)};
case independent: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“insurance”),2)};
case east: {SEL(M_CONFIG(getArray,CONFIG_LIFE_VEHICLES,_classNameLife,“insurance”),3)};
};
if(!(EQUAL(typeName _sellPrice,typeName 0)) OR _sellPrice < 1) then {_sellPrice = 1000};
if(!(EQUAL(typeName _retrievePrice,typeName 0)) OR _retrievePrice < 1) then {_retrievePrice = 1000};
if(!(EQUAL(typeName _assurPrice,typeName 0)) OR _assurPrice < 1) then {_assurPrice = 1000};
(CONTROL(2800,2803)) ctrlSetStructuredText parseText format[
(localize “STR_Shop_Veh_UI_RetrievalP”)+ " <t color=’#8cff9b’>$%1</t><br/>
" +(localize “STR_Shop_Veh_UI_SellP”)+ " <t color=’#8cff9b’>$%2</t><br/>
Prix de l’assurance: <t color=’#8cff9b’>$%9</t><br/>
Etat de l’assurance: %10<br/>
" +(localize “STR_Shop_Veh_UI_Color”)+ " <t color=’#8cff9b’>%8</t><br/>
" +(localize “STR_Shop_Veh_UI_MaxSpeed”)+ " <t color=’#8cff9b’>%3 km/h</t><br/>
" +(localize “STR_Shop_Veh_UI_HPower”)+ " <t color=’#8cff9b’>%4</t><br/>
" +(localize “STR_Shop_Veh_UI_PSeats”)+ " <t color=’#8cff9b’>%5</t><br/>
" +(localize “STR_Shop_Veh_UI_Trunk”)+ " <t color=’#8cff9b’>%6</t><br/>
" +(localize “STR_Shop_Veh_UI_Fuel”)+ " <t color=’#8cff9b’>%7</t>
“,
[_retrievePrice] call life_fnc_numberText,
[_sellPrice] call life_fnc_numberText,
SEL(_vehicleInfo,8),
SEL(_vehicleInfo,11),
SEL(_vehicleInfo,10),
if(_trunkSpace == -1) then {“None”} else {_trunkSpace},
SEL(_vehicleInfo,9),
_vehicleColor,
[_assurPrice] call life_fnc_numberText,
if(_assur == 1) then {”<t color=’#8cff9b’>Assuré</t>"} else {"<t color=’#FF0000’>Pas d’assurance</t>"},
SEL(_vehicleInfo,12)
];
if(_assur == 1) then {
ctrlShow [97480,False];
}else{
ctrlShow [97480,True];
};
ctrlShow [2803,true];
ctrlShow [2830,true];
! Fait !
Dernière édition par Slift le Lun 20 Fév - 6:00, édité 1 fois
Slift- Messages : 143
Date d'inscription : 28/01/2017
Age : 37
Localisation : Bordeaux
Fiche RP
Prénom/Nom : *****
Profession:
Grade: *****
Re: [Finie]Assurance 4.4R1
Dans mpmissions\dialog\function\fn_impoundMenu.sqf
Trouver:
Remplacer par:
Trouver:
- Code:
_tmp = [SEL(_x,2),SEL(_x,8)];
Remplacer par:
- Code:
_tmp = [SEL(_x,2),SEL(_x,8),SEL(_x,12)];
! Fait !
Dernière édition par Slift le Lun 20 Fév - 6:02, édité 1 fois
Slift- Messages : 143
Date d'inscription : 28/01/2017
Age : 37
Localisation : Bordeaux
Fiche RP
Prénom/Nom : *****
Profession:
Grade: *****
Page 1 sur 2 • 1, 2
|
|