Jump to content

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


Axe Cop

Recommended Posts

I'm having the same issue as some others with the refuel and repair script allowing refueling and repairing despite the player not having any gold in his or her inventory.  My service_point.sqf file is here:

 

 

 

 

Never mind.  I had the wrong version somehow....   *faceplam*


Link to comment
Share on other sites

Now I'm getting this error in my client RPT:

Error in expression <Time = _args select 2;


if !([[[_costs select 0, _costs select 1]],0] call epoc>
  Error position: <select 0, _costs select 1]],0] call epoc>
  Error select: Type Number, expected Array,Config entry
File mpmissions\__CUR_MP.Chernarus\addons\service_point\service_point_repair.sqf, line 14

And repair does not work.

Link to comment
Share on other sites

I'd appreciate some help with this script, I put it here:

 

if (!isDedicated) then {
//Conduct map operations
0 fadeSound 0;
waitUntil {!isNil "dayz_loadScreenMsg"};
dayz_loadScreenMsg = (localize "STR_AUTHENTICATING")
execVM "service_point\service_point.sqf";
 
 
Did I do it correctly? I also put the "server_point" folder in the mission.pbo 
 
I'm stuck, someone please teach me what I'm doing wrong.
Link to comment
Share on other sites

then you most likely have an script error and it should be visible in the log..

anyway I checked your provided code again and it seems you really have an error but in the line above my stuff:

dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");

there is no ";" after your line, check that again.. that is most likely the problem with the whole server not working.. (and yes one missing ";" is a major error in programming languages :P)

Link to comment
Share on other sites

@mdswish: did you change the config, especially the repair costs? show me that code "_repair_costs = ???"

 

 

 

Here it is.  We are also not getting the messages when near a repair area.  Yet still when you pull up to a service station you get the option to do the repairs.  But no money is taken and no repairs or refueling is done.

// ---------------- CONFIG START ----------------

// general settings
_folder = "addons\service_point\"; // folder where the service point scripts are saved, relative to the mission file
_servicePointClasses = ["Land_Ind_TankSmall","Land_fuel_tank_big","Land_fuel_tank_stairs","Land_fuel_tank_stairs_ep1","Land_wagon_tanker","Land_fuelstation","Land_fuelstation_army","land_fuelstation_w","Land_benzina_schnell","Land_A_FuelStation_Feed","FuelPump_DZ","Land_A_FuelStation_Feed","Land_Ind_FuelStation_Feed_EP1","Land_FuelStation_Feed_PMC","FuelStation","Land_ibr_FuelStation_Feed","Land_fuelstation_army","Land_fuelstation","land_fuelstation_w","Land_benzina_schnell","Land_A_FuelStation_Feed","FuelPump_DZ"]; // service point classes (add "FuelPump_DZ" to use the dynamic Epoch fuel pumps)
_maxDistance = 20; // maximum distance from a service point for the options to be shown
_actionTitleFormat = "%1 (%2)"; // text of the vehicle menu, %1 = action name (Refuel, Repair, Rearm), %2 = costs (see format below)
_actionCostsFormat = "%2 %1"; // %1 = item name, %2 = item count
_costsFree = "free"; // text for no costs
_message = "Vehicle Service Point nearby"; // message to be shown when in range of a service point (set to "" to disable)

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

// repair settings
_repair_enable = true; // enable or disable the repair option
_repair_costs = [["AllVehicles",["ItemGoldBar",2]]];
_repair_repairTime = 1; // time needed to repair each damaged part (in seconds)

// rearm settings
_rearm_enable = false; // enable or disable the rearm option
_rearm_costs = [["AllVehicles",["ItemGoldBar10oz",2]] ];  // 1 10oz Gold for all other vehicles
_rearm_magazineCount = 3; // amount of magazines to be added to the vehicle weapon

// ----------------- CONFIG END -----------------
Link to comment
Share on other sites

Yeah but your error is

 

Error select: Type Number, expected Array,Config entry

which means the costs provided to that code is not an array (which it should be), but just a single number, don't know why your config looks like an array to me..

 

e.g. this would produce that error:

_repair_costs = [["AllVehicles",123]];

so the costs would be single number (123) and not an array ["ItemGoldBar",2], so I have no idea why the scripts receives a number instead of an array in your case..

Link to comment
Share on other sites

Axe Cop has done such a wonderful job with this.    But rearm was not a good fit for my server because I use a lot of custom modded vehciels,an extra missile here a little less bombs there...etc.    So rewrote the rearm module and now it takes an exsiting maagazine load out (as it looks after a restart) and rearms the whole turrent at one time.  If you had 1 clip of 28rnd hdra that is what you get when you rearm  There a 2nd set of code if it is an epoch vehicle will load one magazine into it since they all spawn empty.  I PM Axe and he asked me to post it so here it is.

 

https://github.com/piggd/service_point

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

AXE Cop, how u doing bro, great script. For some reason the SC one doesnt refuel or repair while the option is there. I have infistar anti hack!

 

You know what to do and could u tell me!?

 

thanks

 

1) Are u using the newest version of the SC AxeCop service points github repo ?

 

2) Do you have the remove and add coins functions?

 

3) Can your provide any more data about whats wrong.

 

Client and server side RPT logs could help.

 

Find the client side rpt @:

 

C:\User\Yourname\AppData\Local\Arma2OA\Arma2OA.rpt

Link to comment
Share on other sites

Zupa thanks man for helping...

 

1) yes downloaded it this morning

2) i use your SCbank script so i gues, yes :-)

3) The thing is, i drive up to the station, scroll and the options is there, then i click refuel, and nothing happens.

 

the error is this i think

 

if !([ player,_costs select 1] call SC_fnc_removeCoins) then {
_repair_cost >
  Error position: <SC_fnc_removeCoins) then {
_repair_cost >
  Error Undefined variable in expression: sc_fnc_removecoins
File mpmissions\__CUR_MP.Tavi\service_point\service_point_refuel.sqf, line 15
Error in expression <;
 
and 
 
if !([ player,_costs select 1] call SC_fnc_removeCoins) then >
  Error position: <select 1] call SC_fnc_removeCoins) then >
  Error Zero divisor
File mpmissions\__CUR_MP.Tavi\service_point\service_point_refuel.sqf, line 15
Error in expression <Count = _costs select 1;
_displayName = _itemName;
_costsText = format [_actionC>
  Error position: <_itemName;
_costsText = format [_actionC>
  Error Undefined variable in expression: _itemname
File mpmissions\__CUR_MP.Tavi\service_point\service_point.sqf, line 100
 
 
Link to comment
Share on other sites

saw in your file these two line too:

 

BIS_fnc_numberDigits = compile preprocessFileLineNumbers "custom\numberDigits.sqf";

BIS_fnc_numberText = compile preprocessFileLineNumbers "custom\numberText.sqf"; 
 
i dont have those line or files, do i need those too?
 
testing the refuel now... ;-) *edit ZUPA u the greatest...
Link to comment
Share on other sites

Axe Cop has done such a wonderful job with this.    But rearm was not a good fit for my server because I use a lot of custom modded vehciels,an extra missile here a little less bombs there...etc.    So rewrote the rearm module and now it takes an exsiting maagazine load out (as it looks after a restart) and rearms the whole turrent at one time.  If you had 1 clip of 28rnd hdra that is what you get when you rearm  There a 2nd set of code if it is an epoch vehicle will load one magazine into it since they all spawn empty.  I PM Axe and he asked me to post it so here it is.

 

https://github.com/piggd/service_point

i have installed your files on my server but nothing is hapening i get options and all but does not remove or rearm my tanks/chopers/cars i am currently using overpoch setting any help would be apreciated

The only thing i want with this is too have rearm script rearm all kind of mags without any restriction and not removing existing mags like flares and ...

thanks in advance budy  B)  

thanks to you both axe cop and piggd for the amazing scripts

Regards SGT.NEL

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