Jump to content
  • 0

Virtual garage stop OP vehicles + Limit amount of vehicles


JakeQue

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

Link to comment
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"];
};

 

Link to comment
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 :)

Link to comment
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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Discord

×
×
  • Create New...