Sell or Service your last driven vehicle

  • Offline zailone
  • Fresh Spawn
  • *
  • Posts: 4
  • [Fr]

Re: Sell or Service your last driven vehicle

« Reply #30 posted: Jan 27, 2016, 07:47 AM »
Hello and thank you for the mod that works wonders, GG
Le monde ne sera pas détruit par ceux qui font le mal, mais par ceux qui les regardent sans rien faire.
A.E

Re: Sell or Service your last driven vehicle

« Reply #31 posted: Apr 08, 2016, 03:11 PM »
How can i edit this so UAV's can be sold too?
  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1075
  • ^_^;;

Re: Sell or Service your last driven vehicle

« Reply #32 posted: Apr 10, 2016, 08:49 AM »
How can i edit this so UAV's can be sold too?

There is currently no check for UAVs - I can have a look at it at some stage i guess :P
- from the grassy knoll -

Re: Sell or Service your last driven vehicle

« Reply #33 posted: Apr 11, 2016, 03:10 AM »
There is currently no check for UAVs - I can have a look at it at some stage i guess :P

That would be amazingly helpful

Re: Sell or Service your last driven vehicle

« Reply #34 posted: Apr 12, 2016, 09:11 AM »
I don't know when this happened, but players are now unable to sell their vehicles using your script. Players will get the following  warning when they try to sell the vehicles they have bought:

"You are not the owner of [vehicleName]"

How can I fix this?

Sent from my L50t using Tapatalk

  • Offline CREAMPIE
  • Armaholic
  • Veteran
  • ******
  • Posts: 1075
  • ^_^;;

Re: Sell or Service your last driven vehicle

« Reply #35 posted: Apr 12, 2016, 11:43 AM »
hmmm weird - mine works fine ...

You must have messed something up somewhere :P

- from the grassy knoll -

Re: Sell or Service your last driven vehicle

« Reply #36 posted: Apr 12, 2016, 05:38 PM »
I think I've found the cultprit:
https://github.com/Jermin/ArmA3_Wasteland.Altis/blob/8e66845f3e2e916625f274ce0b87d8d00c2e2f8b/client/systems/selling/sellVehicle.sqf#l39


It didn't fix it. How can I check the owner of a vehicle?

Sent from my L50t using Tapatalk

  • Offline Magic
  • First Blood
  • ***
  • Posts: 92

Re: Sell or Service your last driven vehicle

« Reply #37 posted: Apr 13, 2016, 12:06 AM »
Lines 28 to 65 of my sell vehicle file, replace your line 28 to 51 with this, it will sort it out fine for you:


   if (isNull _vehicle) exitWith
   {
      playSound "FD_CP_Not_Clear_F";
      ["Your previous vehicle does not exist anymore.", "Error"] call  BIS_fnc_guiMessage;
   };

   _objClass = typeOf _vehicle;
   _objName = getText (configFile >> "CfgVehicles" >> _objClass >> "displayName");

   _checkValidDistance =
   {
      if (_vehicle distance _storeNPC > VEHICLE_MAX_SELLING_DISTANCE) then
      {
         playSound "FD_CP_Not_Clear_F";
         [format [' The "%1" is further away than %2m from the store.', _objName, VEHICLE_MAX_SELLING_DISTANCE], "Error"] call  BIS_fnc_guiMessage;
         false
      } else { true };
   };

   _checkValidOwnership =
   {
      if (!local _vehicle) then
      {
         playSound "FD_CP_Not_Clear_F";
         [format ['You are not the owner of the "%1"', _objName], "Error"] call  BIS_fnc_guiMessage;
         false
      } else { true };
   };

   if (!call _checkValidDistance) exitWith {};
   if (!call _checkValidOwnership) exitWith {};
   
{   
   if (_type == _x select 1) then
   {   
   _price = _x select 2;
   _price = _price / SELL_PRICE;
   };

Re: Sell or Service your last driven vehicle

« Reply #38 posted: Apr 13, 2016, 07:40 AM »
Lines 28 to 65 of my sell vehicle file, replace your line 28 to 51 with this, it will sort it out fine for you:


   if (isNull _vehicle) exitWith
   {
      playSound "FD_CP_Not_Clear_F";
      ["Your previous vehicle does not exist anymore.", "Error"] call  BIS_fnc_guiMessage;
   };

   _objClass = typeOf _vehicle;
   _objName = getText (configFile >> "CfgVehicles" >> _objClass >> "displayName");

   _checkValidDistance =
   {
      if (_vehicle distance _storeNPC > VEHICLE_MAX_SELLING_DISTANCE) then
      {
         playSound "FD_CP_Not_Clear_F";
         [format [' The "%1" is further away than %2m from the store.', _objName, VEHICLE_MAX_SELLING_DISTANCE], "Error"] call  BIS_fnc_guiMessage;
         false
      } else { true };
   };

   _checkValidOwnership =
   {
      if (!local _vehicle) then
      {
         playSound "FD_CP_Not_Clear_F";
         [format ['You are not the owner of the "%1"', _objName], "Error"] call  BIS_fnc_guiMessage;
         false
      } else { true };
   };

   if (!call _checkValidDistance) exitWith {};
   if (!call _checkValidOwnership) exitWith {};
   
{   
   if (_type == _x select 1) then
   {   
   _price = _x select 2;
   _price = _price / SELL_PRICE;
   };

Works like a charm. Thanks!  :)

Re: Sell or Service your last driven vehicle

« Reply #39 posted: Jun 16, 2016, 12:55 PM »
Hello Creampie, Gents,

<edited>

Okay let me rephrase :) I got up to where it says "You are not the owner of [vehicleName]", just like Jermin, I think I will stop for now, let the lads play a bit.  Does Creampie have any input on Magic's fix?

Regards,
topper

<ok resolved just the variable name did not match is all> thanks all.
  • Offline zailone
  • Fresh Spawn
  • *
  • Posts: 4
  • [Fr]

Re: Sell or Service your last driven vehicle

« Reply #40 posted: Apr 21, 2017, 03:45 PM »
Hello , Here is the message that I have at stake in the top right of the screen when I want to sell the vehicle :

"an unknown error occurred cancelled "

For info I made the following installation: @CREAMPIE + modification of @Magic.

please help me :)
Le monde ne sera pas détruit par ceux qui font le mal, mais par ceux qui les regardent sans rien faire.
A.E