Jump to content

[Release] Vehicle Service Point with Rearm+


piggd

Recommended Posts

Mod Features:

Configurable Service points (service_point.sqf)
Adjustable pricing of each service. (service_point.sqf)
Disable dfeatures you do not want ((service_point.sqf))
Rearms by vehicle postion and turrent.
Non-Epoch vehicles will rearm like a re-arm truck back to there spawned loadout
Pulls the loadout from the ingame configuration instead of the config file ( This is important if you mod your vehicles on spawn )
Epoch vehicles spawn with 0 magazines so rearm+ will add one magazine to the turrent.

Download:
1) Download from GutHub
2) Left side towards the bottom click download zip.
3) Unzip and move cusom into your mission pbo.

Installation:

Edit your init.sqf

Modify the following block of code:
 
 

if (!isDedicated) then {
    //Conduct map operations
    0 fadeSound 0;
    waitUntil {!isNil "dayz_loadScreenMsg"};
    dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
    
    //Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =     [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";    
    
    //anti Hack
    [] execVM "\z\addons\dayz_code\system\antihack.sqf";

    //Lights
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    
};

 
 
 

if (!isDedicated) then {
    //Conduct map operations
    0 fadeSound 0;
    waitUntil {!isNil "dayz_loadScreenMsg"};
    dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
    
    //Run the player monitor
    _id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
    _playerMonitor =     [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";    
    
    //anti Hack
    [] execVM "\z\addons\dayz_code\system\antihack.sqf";

    //Lights
    //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
    // Service Point Rearm+
    [] execVM "custom\service_point\service_point.sqf";
};

 




Refuel and Repair scripts are 100% Axe Cops work.  Rearm was rewritten to provide new rearm capabilities.
 
Email: [email protected]
Website: Piggd Dayz Gaming
Donate to piggd

Link to comment
Share on other sites

  • 1 month later...

Would it be possible to add a script to this for a key changer? We have a scroll option right now that allows players to either claim unkeyed vehicles, or to make a master key with more than one vehicle on it. What i'm wondering is if that code could be called from this script instead of a right click menu?

Link to comment
Share on other sites

No I am sorry it is a little out of scope for me.  I use a custom player UID to tie all my objects too so my servers do not use keys at all. When you buy a vehicle or claim it on my sever it is tied to the players custom id and vehicle access is all key-less.

Link to comment
Share on other sites

No I am sorry it is a little out of scope for me.  I use a custom player UID to tie all my objects too so my servers do not use keys at all. When you buy a vehicle or claim it on my sever it is tied to the players custom id and vehicle access is all key-less.

Could you share how you tied keys to UID ??

Link to comment
Share on other sites

  • 5 months later...

He's added in "tanks" for the refuel and repair. I'm not scripter but the rearm part looks different to me. Am I missing something?

 

Piggd version

/*


Vehicle Service Point Rearm+ by piggd
Email: [email protected]<script cf-hash='f9e31' type="text/javascript"> /* */</script>
Website: http://dayzpiggd.enjin.com
Donations Accepted via paypal to [email protected]<script cf-hash='f9e31' type="text/rocketscript"> /* */</script>
Based on Vehicle Service Point (Refuel, Repair, Rearm) by Axe Cop

Refuel and Repair scripts are 100% Axe Cops work. Rearm was rewritten to provide new rearm capabilities.
*/
private ["_vehicle","_args","_costs","_vehicleType","_vehicleName","_turret","_magazines","_rearm_rearmTime","_role","_ammoType","_weapons","_ammo"];

_vehicle = _this select 0;
if (!local _vehicle) exitWith { diag_log format["Error: called service_point_rearm.sqf with non-local vehicle: %1", _vehicle] };

_args = _this select 3;
_role = _args select 0;
_turret = _role select 1;
_costs = _args select 1;
_rearm_rearmTime = _args select 2;
_vehicleType = typeOf _vehicle;
_vehicleName = getText(configFile >> "cfgVehicles" >> _vehicleType >> "displayName");

if !([[[_costs select 0, _costs select 1]],0] call epoch_returnChange) then {
cutText [format[(localize "STR_EPOCH_ACTIONS_12"), _costs select 1, _vehicleName], "PLAIN DOWN"];
} else {
_vehicle setVehicleAmmo 1;
_magazines = _vehicle magazinesTurret _turret;
{
_vehicle removeMagazineTurret [_x, _turret];
} count _magazines;
{
_ammoType = getText (configFile >> "cfgMagazines" >> _x >> "displayName");
if (_ammoType == "") then {_ammoType = _x;};
titleText [format["Rearming %1 for %2 in progress...",_ammoType, _vehicleName], "PLAIN DOWN"];
sleep _rearm_rearmTime;
_vehicle addMagazineTurret [_x, _turret];
} count _magazines;
// Epoch DZ Vehicles that start with 0 magazines
if (count _magazines < 1) then {
_weapons = _vehicle weaponsTurret _turret;
{
_magazines = getArray (configFile >> "cfgWeapons" >> _x >> "magazines");
_ammo = _magazines select 0; // rearm with the first magazine
_ammoType = getText (configFile >> "cfgMagazines" >> _ammo >> "displayName");
if (_ammoType == "") then {_ammoType = _ammo;};
if (_ammo != "") then {
_vehicle removeMagazineTurret [_ammo,_turret];
titleText [format["Rearming %1 for %2 in progress...",_ammoType, _vehicleName], "PLAIN DOWN"];
sleep _rearm_rearmTime;
_vehicle addMagazineTurret [_ammo,_turret];
};
} count _weapons;
};
titleText [format["Rearming %1 completed!", _vehicleName], "PLAIN DOWN"];
};

 

Zupa edited Axecop version with coins

// Vehicle Service Point (Rearm) by Axe Cop



private ["_vehicle","_args","_servicePoint","_costs","_magazineCount","_weapon","_type","_name","_weaponType","_weaponName","_turret","_magazines","_ammo","_textMissing"];

_vehicle = _this select 0;
if (!local _vehicle) exitWith { diag_log format["Error: called service_point_rearm.sqf with non-local vehicle: %1", _vehicle] };

_args = _this select 3;
_servicePoint = _args select 0;
_costs = _args select 1;
_magazineCount = _args select 2;
_weapon = _args select 3;

//if !([_costs] call player_checkAndRemoveItems) exitWith {};
if !([ player,_costs select 1] call SC_fnc_removeCoins) then {
_repair_cost = _costs select 1;
cutText [format["You need %1 %2",_repair_cost,CurrencyName] , "PLAIN DOWN"];
} else {

_type = typeOf _vehicle;
_name = getText(configFile >> "cfgVehicles" >> _type >> "displayName");

_weaponType = _weapon select 0;
_weaponName = _weapon select 1;
_turret = _weapon select 2;

_magazines = getArray (configFile >> "CfgWeapons" >> _weaponType >> "magazines");
_ammo = _magazines select 0; // rearm with the first magazine

// remove all magazines
_magazines = _vehicle magazinesTurret _turret;
{
_vehicle removeMagazineTurret [_x, _turret];
} forEach _magazines;

// add magazines
for "_i" from 1 to _magazineCount do {
_vehicle addMagazineTurret [_ammo, _turret];
};

titleText [format["%1 of %2 Rearmed", _weaponName, _name], "PLAIN DOWN"];
};

Link to comment
Share on other sites

He's added in "tanks" for the refuel and repair. I'm not scripter but the rearm part looks different to me. Am I missing something?

 

lol, all vehicles was working with refuel and repair already, he added "tank" with a specific price and a bunch of irrelevant code that is unneeded cause of what someone posted on one of the very first pages of axecops original topic ...

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...