Jump to content
  • 0
JakeQue

Virtual garage stop OP vehicles + Limit amount of vehicles

Question

Hi guys, need a few updates for the vehicle garage if possible. I need to limit the amount of vehicles per player... 

Also need to stop overpowered vehicles being stored in the garage. I have updated my player_storeVehicle.sqf with the following code but it's not working, it still stores them : 

 

// Developed by [GZA] David for German Zombie Apocalypse Servers (https://zombieapo.eu/)
private["_unit","_obj","_wogear","_charID","_objectID","_keyavailable","_keyColor","_added","_objectUID","_key","_class","_noStore"];
if(lbCurSel 3802 == -1) exitWith {hint  "No Vehicle selected"};
_unit = player;
_obj = StoreVehicleList select (lbCurSel 3802);
StoreVehicleList = nil;
_wogear = _this select 0;
closeDialog 0;

_noStore = _obj in ["AH64D"];

if (_noStore) exitWith {
cutText ["Woah, that vehicle is too overpowered. You can't store that here!", "PLAIN DOWN"];
};

_charID	= _obj getVariable ["CharacterID","0"];
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID	= _obj getVariable ["ObjectUID","0"];

if (_objectID == "1") exitWith {cutText ["Can not store mission vehicle.", "PLAIN DOWN"];}; // Check for mission vehicle WAI Script




_keyavailable = false;
_keyColor = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
if(_charID != "0") then {
{
	if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _keyColor) then {
	if (str(getNumber(configFile >> "CfgWeapons" >> _x >> "keyid")) == _charID) then {
	_key = _x; _keyavailable = true;
			};
		};
} count (items _unit);


} else {_keyavailable = true;};

if (!_keyavailable) exitWith {cutText ["You need the key of the vehicle.", "PLAIN DOWN"];};

_added = false;
if (!_wogear) then {
_added = [player, Pricegear] call SC_fnc_removeCoins;
} else {_added = true;};
Pricegear = nil;

if(!_added) exitWith {cutText ["You don't have enough money.", "PLAIN DOWN"];};
if(_charID != "0") then {
[_unit,_key] call BIS_fnc_invRemove; cutText ["Key removed!", "PLAIN DOWN"];
};

_obj setvehiclelock "locked";


PVDZE_storeVehicle = [_obj, _unit, _wogear];
publicVariableServer "PVDZE_storeVehicle";
waitUntil {!isNil "PVDZE_storeVehicleResult"};

PVDZ_obj_Destroy = [_objectID,_objectUID,_unit];
publicVariableServer "PVDZ_obj_Destroy";

deleteVehicle _obj;

PVDZE_storeVehicleResult = nil;
sleep 2;
cutText ["Stored Vehicle in Garage.", "PLAIN DOWN"];

Also would be nice to maybe implement an sql event which removes them out the garage after 14 days if anyone could write that? 

Merci ! xD

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
3 hours ago, JakeQue said:

Hi guys, need a few updates for the vehicle garage if possible. I need to limit the amount of vehicles per player... 

Also need to stop overpowered vehicles being stored in the garage. I have updated my player_storeVehicle.sqf with the following code but it's not working, it still stores them : 

 

// Developed by [GZA] David for German Zombie Apocalypse Servers (https://zombieapo.eu/)
private["_unit","_obj","_wogear","_charID","_objectID","_keyavailable","_keyColor","_added","_objectUID","_key","_class","_noStore"];
if(lbCurSel 3802 == -1) exitWith {hint  "No Vehicle selected"};
_unit = player;
_obj = StoreVehicleList select (lbCurSel 3802);
StoreVehicleList = nil;
_wogear = _this select 0;
closeDialog 0;

_noStore = _obj in ["AH64D"];

if (_noStore) exitWith {
cutText ["Woah, that vehicle is too overpowered. You can't store that here!", "PLAIN DOWN"];
};

_charID	= _obj getVariable ["CharacterID","0"];
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID	= _obj getVariable ["ObjectUID","0"];

if (_objectID == "1") exitWith {cutText ["Can not store mission vehicle.", "PLAIN DOWN"];}; // Check for mission vehicle WAI Script




_keyavailable = false;
_keyColor = ["ItemKeyYellow","ItemKeyBlue","ItemKeyRed","ItemKeyGreen","ItemKeyBlack"];
if(_charID != "0") then {
{
	if (configName(inheritsFrom(configFile >> "CfgWeapons" >> _x)) in _keyColor) then {
	if (str(getNumber(configFile >> "CfgWeapons" >> _x >> "keyid")) == _charID) then {
	_key = _x; _keyavailable = true;
			};
		};
} count (items _unit);


} else {_keyavailable = true;};

if (!_keyavailable) exitWith {cutText ["You need the key of the vehicle.", "PLAIN DOWN"];};

_added = false;
if (!_wogear) then {
_added = [player, Pricegear] call SC_fnc_removeCoins;
} else {_added = true;};
Pricegear = nil;

if(!_added) exitWith {cutText ["You don't have enough money.", "PLAIN DOWN"];};
if(_charID != "0") then {
[_unit,_key] call BIS_fnc_invRemove; cutText ["Key removed!", "PLAIN DOWN"];
};

_obj setvehiclelock "locked";


PVDZE_storeVehicle = [_obj, _unit, _wogear];
publicVariableServer "PVDZE_storeVehicle";
waitUntil {!isNil "PVDZE_storeVehicleResult"};

PVDZ_obj_Destroy = [_objectID,_objectUID,_unit];
publicVariableServer "PVDZ_obj_Destroy";

deleteVehicle _obj;

PVDZE_storeVehicleResult = nil;
sleep 2;
cutText ["Stored Vehicle in Garage.", "PLAIN DOWN"];

Also would be nice to maybe implement an sql event which removes them out the garage after 14 days if anyone could write that? 

Merci ! xD

My version of virtual garage should be out soon (work permitting) it's basically a rewrite and it has the limit features built in

This is the code you need for your version anyway:

_noStore = ["AH64D"];

if (typeOf (_obj) in _noStore) exitWith {
cutText ["Woah, that vehicle is too overpowered. You can't store that here!", "PLAIN DOWN"];
};

 

Share this post


Link to post
Share on other sites
  • 0
2 minutes ago, salival said:
_noStore = ["AH64D"];

if (typeOf (_obj) in _noStore) exitWith {
cutText ["Woah, that vehicle is too overpowered. You can't store that here!", "PLAIN DOWN"];
};

 

 

THANK YOU! I'll give it a whirl you legend :)

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, Drokz said:

Funny, not. 

Just read DZE stuff so I wonder if its for Arma 3 or Arma 2. Coz this is an A3 section.

Don't know whether it was located in A3 section but now it's in A2 so it should be quite obvious. Also Salival is a dayz epoch contributor and dev so it's another hint that he is only releasing things for A2.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Similar Content

    • By 2DayZ2Retirement
      -PROBLEM SOLVED-
       
      G'day, Survivors.
      I am having an issue on my server where vehicles which spawn randomly around the map repair themselves upon server restart.
      I use this config in my init.sqf which successfully spawns the vehicles in damaged and with low fuel...
      DynamicVehicleDamageLow = 75;
      DynamicVehicleDamageHigh = 100;
      DynamicVehicleFuelLow = 0;
      DynamicVehicleFuelHigh = 25;
      ...However upon each server restart the vehicles repair themselves (the fuel remains low however) and for the life of me I can't figure out why this is happening. 
      DayZ Version -DayZ Epoch 1.0.6.2
      Scripts Used -DZAI | -DZMS | -Right Click Actions (Suicide, Smoke Drugs, GPS Scan)
      AntiHack - InfiSTAR
      Server Host - GTXGaming
      My HiveEXT.log and arma2oaserver.RPT logs are not showing anything out of the ordinary.
      I'm not sure if it matter, but all Planes/Helicopters and Boats have been removed from the server via the dynamic_vehicle.sqf.
      In addition, all of the traders and trader cities being removed by removing the call for the CfgServerTrader.hpp in the description.ext.
      If there is any other info I can show to assist in fixing this problem please let me know, any help would be greatly appreciated.
      Cheers.
    • By rocalpha
      Bonjour, j’écris aujourd’hui parce que j’aimerais savoir si vous ne pourrez pas m'aider. Je loue un serveur via gportal et j’aimerais pouvoir être mon serveur en PvE, mais aussi créer des éléments de base pour la connexion et des choses simples comme . J'ai un autre problème lorsque j'achète une voiture chère à pied cela me met une flèche rouge puis rien non aucun véhicule il apparait qu'après un redémarrage du serveur
    • By Warburgg
      I installed the dynamic climate script and it happens that it rains on the server but only lasts 10 seconds and stops. Is it because I use the script that speeds server time? I currently use Control Time which allows the server to have 2 hours of day and 1 hour night.
      The other climates such as overcast and fog last the forecast time 5-20 minutes but the rain does not.
      In my logs show: 16:52:30 "39:2 Debug: Rain set to 0.92421 for 10.6582 minutes". It rains until it rains but soon stops.
    • By Tanita-Corp
      Hello guys)
      Tell me please how to make 
      spawned veh. unused 4 day deleted
      with key veh. unused 14 day deleted
       
      I broke my head
    • By thegdog
      2:08:04 Error Type Any, expected String 2:08:04 File z\addons\dayz_server\compile\server_playerSync.sqf, line 41 2:08:12 Server: Object 3:54 not found (message 70) 2:08:12 "Server_PublishVehicle2 error: Wrong parameter format" 2:08:12 "Trader Menu: jeffdog (76561198147272349) purchased 1x BAF_Merlin_DZE into gear at Aircraft Trader for 1 ItemObsidian" 2:08:12 Error in expression <ceFoot = 0; trying to buy aircraft from the default aircraft trader.  never touched any of it and it giving this error.  no vehicle spawns.  it shows the arrow.  EDIT:  i tried other traders, all vehicles dont spawn when bought.
  • Advertisement
  • Supporters
  • Discord

×
×
  • Create New...