Jump to content

[Release] Vehicle Service Point (Refuel, Repair, Rearm) [Script]


Axe Cop

Recommended Posts

yes i understand what you feeling.

You know now how i was feeling once i tryed your script.

 

in fact when i used it for the first time i didnt realise it was needed something more than the sevice_point.sqf to run the script.

so i installed only the service_point.sqf and launched the server.

Once i been connected i receved a error message ( ac_function.sqf script missing) but i tested it and been able to repair/refuel for free...

So i stoped the server and watched more carrefully your guthib install and realise i needed 4 more files.

i installed all the pack and restarted the server and then nothing worked ( due to the wrong object selected for base of the script)

 

that's exactly what hapened and why i was so disapointed...

 

Anyway, keep the good work. Your service point script is so wonderfull and many more "realistic" for epoch

Link to comment
Share on other sites

Is there a way to allow all land vehicles to repair but no air without entering every land vehicle manually?  something like

// repair settings
_repair_enable = true; // enable or disable the repair option
_repair_costs = [
	["Air",["NONE"]],
	["Land",[]] //free
Link to comment
Share on other sites

sure:

_repair_costs = [["LandVehicle",[]]];

this way only land vehicles car be repaired (for free), if you don't want air vehicles to be able to repair just don't add them, no need to add "NONE" or something :)

 

Thank you. I knew NONE was a silly example, I just used it for the lack of a better term.

Link to comment
Share on other sites

Enabled refuel and repair for land vehicles only but it shows up as free to air vehicles.

// refuel settings
_refuel_enable = true; // enable or disable the refuel option
_refuel_costs = [["LandVehicle",[]]]; // Free for land vehicles
_refuel_updateInterval = 1; // update interval (in seconds)
_refuel_amount = 0.05; // amount of fuel to add with every update (in percent)

// repair settings
_repair_enable = true; // enable or disable the repair option
_repair_costs = [["LandVehicle",[]]]; // Free for land vehicles
_repair_repairTime = 2; // time needed to repair each damaged part (in seconds)

// rearm settings
_rearm_enable = false; // enable or disable the rearm option
_rearm_costs = [];
_rearm_magazineCount = 3; // amount of magazines to be added to the vehicle weapon

Any ideas?

Link to comment
Share on other sites

oh yes, sorry I didn't thought about it but I return free costs by default if there is no matching vehicle class...

so you have to change a little at the code, this is not possible in the config :(

 

set the repair costs to something like this:

_repair_costs = [
	["LandVehicle",[]], // free for land vehicles
	["AllVehicles",""] // repair not available for all other vehicle types
];

if you want set it for all other vehicles (or just air vehicles) to "NONE" (or anything else but an array with []), so your first idea was pretty good after all :)

 

then you have to change the script a little, around line 150, replace this code:

_actionTitle = ["Repair", _costs] call _fnc_actionTitle;
SP_repair_action = _vehicle addAction [_actionTitle, _folder + "service_point_repair.sqf", [_servicePoint, _costs, _repair_repairTime], -1, false, true, "", _actionCondition];

with

if (typeName _costs == "ARRAY") then {
	_actionTitle = ["Repair", _costs] call _fnc_actionTitle;
	SP_repair_action = _vehicle addAction [_actionTitle, _folder + "service_point_repair.sqf", [_servicePoint, _costs, _repair_repairTime], -1, false, true, "", _actionCondition];
};

that is the easiest way, this is just for repair if you want it for refuel and rearm too you have to change that code too.

this should work, sorry but there is no way i could put all special cases in the config section of the script :/

Link to comment
Share on other sites

IDEA

 

So i drive up to a fuel station and have the option

- Refuel (Free)
- Repair (2 Gold)
- Rearm (2 10oz Gold),
Well is there a chance you could add a Quick Option to the script?
 
For example ive got my rates at 5% for these things to do, so refuel is as if its normal refuel speed on a standard version of dayz.
 
So, for example the scroll options would be
- Refuel (Free)
- Quick Refuel (2Gold)
- Repair (2Gold)
- Quick Repair (4Gold)
- Rearm (2 10ozGold)
- Quick Rearm ( 3 10ozGold)
 
So people can wither sit around and wait for the option chosen to happen or pay a little to have it done instantly. Please Reply and Make this happen please.
Link to comment
Share on other sites

Hey, thanks for the idea but I think it would just complicate it for most players and admins on how to use the mod dont you think?

Also i dont know if many server admins would even like options like that, sure it could be optional but that would even more complicate the script even more haha

Anyway if you really want options like that it is of course possible and should be fairy easy to implement!?

And please guys stop sending me the same messages you write in the public topic via PM, i get notifications for new posts in here, so it is not necessary, thanks.;)

Link to comment
Share on other sites

well it works fine on my server I also use safezone and tow & lift without any problems.

maybe you missed a ";" at the end of my script in the init.sqf and the tow & lift scripts etc won't get executed because of that!?

check you RPT log file for script errors :)

Link to comment
Share on other sites

this is really cool but as we put this yesterday on our server it worked just fine but then we tryed to implement a price for refuel and then nothing of this worked anymore untill I removed the whole fuel price thing again.

 

Would someone be so kind to give me a hand?

 

We want one price for all sort of vehicles ...for starters just one silver bar

 

Thx

Link to comment
Share on other sites

Hey Axe Cop,

 

thanks but just to make it sure ......

 

thats the original part

 

// refuel settings
_refuel_enable = true; // enable or disable the refuel option
_refuel_costs = []; // free for all vehicles (equal to [["AllVehicles",[]]])
_refuel_updateInterval = 1; // update interval (in seconds)
_refuel_amount = 0.05; // amount of fuel to add with every update (in percent)

 

and that's the way it should look like?

 

// refuel settings
_refuel_enable = true; // enable or disable the refuel option
_refuel_costs = [["AllVehicles",["ItemSilverBar",1]]];
_refuel_updateInterval = 1; // update interval (in seconds)
_refuel_amount = 0.05; // amount of fuel to add with every update (in percent)

 

no ]; after this part?

Link to comment
Share on other sites

what do you mean there is a "];" in the snipped I posted!?

maybe you are confused because it is in one line. that doesn't matter line breaks are just to make it more readable for humans.. the computer doesn't care about that :D

but yes it looks good just try it like that :)

 

if you want write it line this:

_refuel_costs = [
    ["AllVehicles",["ItemSilverBar",1]]
];

that is the same as you see, but if you have only 1 item its ok to write in in 1 line i think :)

Link to comment
Share on other sites

hi

loaded your script into my dayz panthera epoch server it worked fine  but it disabled * lift and tow * and also AGN safezone in traders

could you tell me how to get the script working with those it  is a awesome script thnx

my email is [email protected]

thnx mike

yes do what Axe Cop Said. i have it working with no problems on my panthera server with AGN and RF3 tow/lift

 

and thanks again Axe Cop for this my players Love it!!!!

Link to comment
Share on other sites

Guys help out please! My RPT shows this:

 

Error in expression <cVM "service_point\service_point.sqf";

 

This is how the very bottom of my init.sqf looks: (Is there something I did wrong here?)

 

//Start Dynamic Weather
if(true) then {
execVM "\z\addons\dayz_code\external\DynamicWeatherEffects.sqf";
};
 
#include "\z\addons\dayz_code\system\BIS_Effects\init.sqf"
 
_nil = [] execVM "safezone\init.sqf";
 
[] execVM "service_point\service_point.sqf";
 
};
Link to comment
Share on other sites

  • 2 weeks later...

Hey guys, figured I'd share this with yall.

 

I did a bit of scripting over the weekend and fixed a couple of issues with the re-arm script and added a new feature.

 

Fixes:

* Can now arm driver/pilot based weaponry

* Re-arming no longer removes ALL ammo, just the ammo type you are rearming.  This is required since there are issues with adding too many mags to a vehicle.

 

Addon:

* Can now exclude specific ammo type from rearming.  My example includes removal of hydras and s-5 rockets from air vehicles.

 

link:

https://github.com/deadfred666/dayz  (Note, this repo is already configured for my server's weaponry.  you will probably need to adjust prices accordingly)

Link to comment
Share on other sites

small maintenance update for Epoch 1.0.4.

you don't have to update the script still works, I just removed my script ac_functions.sqf from this mod

(because vbawol asked me to integrate the functions in the base Epoch mod, so the file is now obsolete since 1.0.4  :) ).

Link to comment
Share on other sites

did you modify anything? I know some people tried to change the repair costs and made a syntax error. then you can repair for free :D

or with the old version the ac_functions.sqf file was required if you didnt downlod it you could als do it for free... but not with the new version unless you use this script with an older Epoch version than 1.0.4!

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...