Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 3.51 KB | None | 0 0
  1. #include "..\script_macros.hpp"
  2. /*
  3.  
  4. Vente de véhicle en Joueur ta vue !!
  5. Par Joaquine Le random !!
  6. */
  7.  
  8. disableSerialization;
  9. // Variable de definition du vehicle & player recuperer
  10.  
  11. private _display        = findDisplay 57300;
  12. private _index_listVeh  = lbCurSel 57301;
  13. private _SEL_unit       = lbCursel 57302;
  14. private _DA3F_listVeh   = _display displayCtrl 57301;
  15. private _liste_veh      = nearestObjects [player, ["Car","air"], 20];
  16. private _liste_man      = (nearestObjects [player, ["Man"], 20])-[player];
  17. private _vehicle        = objNull;
  18. private _DA3F_Data_List_Veh = _DA3F_listVeh lbData _index_listVeh;
  19.  
  20.     //Check si pas véhicle
  21.     if (_SEL_vehicle isEqualTo -1) exitWith {
  22.         hint "Pas de véhicle selectionner";
  23.     };
  24.  
  25.     //Check si pas personnes
  26.     if (_SEL_unit isEqualTo -1) exitWith {
  27.         hint 'Pas de personnes selectionner';
  28.     };
  29.  
  30. {
  31.     if (_x in [_DA3F_Data_List_Veh]) then {
  32.         _vehicle = _x;
  33.     };
  34. } forEach _liste_veh;
  35.  
  36. _unit           = _SEL_unit select _liste_man;
  37. _unit           = call compile format ["%1",_unit];
  38. _dbInf          = _vehicle getVariable "dbInfo";
  39. _plaque         = (_dbInf select 1);
  40. _nameAcheteur   = (name _unit);
  41.  
  42. hint format ["En cours de vente a :  %1",_nameAcheteur];
  43. hint format ["Demande d'achat envoyez a : %1 avec l'uid : %2 pour la somme de %3",_price];
  44.  
  45. // Envoie formulaire de validation a l'acheteur
  46. [player,_vehicle,_value,_plaque] remoteExec ["life_fnc_receivedVeh",_unit];
  47. closeDialog 0;
  48.  
  49.  
  50.  
  51.  
  52. ////////////////////////////////////////////////////////////////////////////////
  53. ////////////////////////////////////////////////////////////////////////////////
  54. ////////////////////////////////////////////////////////////////////////////////
  55. ////////////////////////////////////////////////////////////////////////////////
  56.  
  57. #include "..\script_macros.hpp"
  58. /*
  59. Vente de véhicle en Joueur ta vue !!
  60. Par Joaquine Le random !!
  61. */
  62. disableSerialization;
  63. if (life_action_inUse) exitWith {};
  64. if (dialog) exitWith {};
  65. if (life_is_processing) exitWith {};
  66. life_action_inUse = true;
  67. _vehicleList = nearestObjects [player, ["Car","air"], 20];
  68. if (count _vehicleList < 1) exitWith {hint localize "STR_NOTF_VehicleNear";life_action_inUse = false;};
  69. if (!createDialog "life_venteVeh") exitWith {};
  70. [] spawn {waitUntil {!dialog}; life_action_inUse = false;};
  71. //Récupération des Players
  72. vehicleListVente = [];
  73. {
  74.             _vehData = _x getVariable ["vehicle_info_owners",[]];
  75.             if (count _vehData  > 0) then {
  76.                 _vehOwner = ((_vehData select 0) select 0);
  77.                 if ((getPlayerUID player) == _vehOwner) exitWith {
  78.                     vehicleListVente pushBack [_x];
  79.                 };
  80.             };
  81. } forEach _vehicleList;
  82. _control = ((findDisplay 57300) displayCtrl 57301);
  83. lbClear _control;
  84. {
  85.     _className = typeOf (_x select 0);
  86.     _vehicleInfo = [_className]call life_fnc_fetchVehInfo;
  87.     _control lbAdd (_vehicleInfo select 3);
  88.     _control lbSetPicture [(lbSize _control)-1,(_vehicleInfo select 2)];
  89.     _control lbSetData [(lbSize _control)-1,str(_x)];
  90.     _control lbSetValue [(lbSize _control)-1,_ForEachIndex];
  91. } forEach vehicleListVente;
  92.  
  93. //Near players
  94. _near_units = [];
  95. _near = ((findDisplay 57300) displayCtrl 57302);
  96. lbClear _near;
  97. { if (player distance _x < 10) then {_near_units pushBack _x};} forEach playableUnits;
  98. {
  99.     if (!isNull _x && alive _x && player distance _x < 10 && !(_x isEqualTo player)) then {
  100.         _near lbAdd format ["%1",_x getVariable ["realname",name _x]];
  101.         _near lbSetData [(lbSize _near)-1,str(_x)];
  102.     };
  103. } forEach _near_units;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement