Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "..\script_macros.hpp"
- /*
- Vente de véhicle en Joueur ta vue !!
- Par Joaquine Le random !!
- */
- disableSerialization;
- // Variable de definition du vehicle & player recuperer
- private _display = findDisplay 57300;
- private _index_listVeh = lbCurSel 57301;
- private _SEL_unit = lbCursel 57302;
- private _DA3F_listVeh = _display displayCtrl 57301;
- private _liste_veh = nearestObjects [player, ["Car","air"], 20];
- private _liste_man = (nearestObjects [player, ["Man"], 20])-[player];
- private _vehicle = objNull;
- private _DA3F_Data_List_Veh = _DA3F_listVeh lbData _index_listVeh;
- //Check si pas véhicle
- if (_SEL_vehicle isEqualTo -1) exitWith {
- hint "Pas de véhicle selectionner";
- };
- //Check si pas personnes
- if (_SEL_unit isEqualTo -1) exitWith {
- hint 'Pas de personnes selectionner';
- };
- {
- if (_x in [_DA3F_Data_List_Veh]) then {
- _vehicle = _x;
- };
- } forEach _liste_veh;
- _unit = _SEL_unit select _liste_man;
- _unit = call compile format ["%1",_unit];
- _dbInf = _vehicle getVariable "dbInfo";
- _plaque = (_dbInf select 1);
- _nameAcheteur = (name _unit);
- hint format ["En cours de vente a : %1",_nameAcheteur];
- hint format ["Demande d'achat envoyez a : %1 avec l'uid : %2 pour la somme de %3",_price];
- // Envoie formulaire de validation a l'acheteur
- [player,_vehicle,_value,_plaque] remoteExec ["life_fnc_receivedVeh",_unit];
- closeDialog 0;
- ////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////
- ////////////////////////////////////////////////////////////////////////////////
- #include "..\script_macros.hpp"
- /*
- Vente de véhicle en Joueur ta vue !!
- Par Joaquine Le random !!
- */
- disableSerialization;
- if (life_action_inUse) exitWith {};
- if (dialog) exitWith {};
- if (life_is_processing) exitWith {};
- life_action_inUse = true;
- _vehicleList = nearestObjects [player, ["Car","air"], 20];
- if (count _vehicleList < 1) exitWith {hint localize "STR_NOTF_VehicleNear";life_action_inUse = false;};
- if (!createDialog "life_venteVeh") exitWith {};
- [] spawn {waitUntil {!dialog}; life_action_inUse = false;};
- //Récupération des Players
- vehicleListVente = [];
- {
- _vehData = _x getVariable ["vehicle_info_owners",[]];
- if (count _vehData > 0) then {
- _vehOwner = ((_vehData select 0) select 0);
- if ((getPlayerUID player) == _vehOwner) exitWith {
- vehicleListVente pushBack [_x];
- };
- };
- } forEach _vehicleList;
- _control = ((findDisplay 57300) displayCtrl 57301);
- lbClear _control;
- {
- _className = typeOf (_x select 0);
- _vehicleInfo = [_className]call life_fnc_fetchVehInfo;
- _control lbAdd (_vehicleInfo select 3);
- _control lbSetPicture [(lbSize _control)-1,(_vehicleInfo select 2)];
- _control lbSetData [(lbSize _control)-1,str(_x)];
- _control lbSetValue [(lbSize _control)-1,_ForEachIndex];
- } forEach vehicleListVente;
- //Near players
- _near_units = [];
- _near = ((findDisplay 57300) displayCtrl 57302);
- lbClear _near;
- { if (player distance _x < 10) then {_near_units pushBack _x};} forEach playableUnits;
- {
- if (!isNull _x && alive _x && player distance _x < 10 && !(_x isEqualTo player)) then {
- _near lbAdd format ["%1",_x getVariable ["realname",name _x]];
- _near lbSetData [(lbSize _near)-1,str(_x)];
- };
- } forEach _near_units;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement