Jump to content

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


Axe Cop

Recommended Posts

  • 2 weeks later...

High, This is a great Script, Thank You very much. 

 

I was just wondering if it was possible to separate the things you can get service for. For example, set it up so that players can only fuel up at the MAP_A_FuelStation_Feeds and nothing else, but if they get close to the MAP_repair_center they would only get the repair option, etc. 

Doesn't make sense that you can repair or rearm at a fuel pump, sure it's better than nothing for sure, don't get me wrong, and I love the script as do our players. I just want to make things a bit more realistic on our servers.

 

If this has already been covered in the thread, I apologize, as I did not see it. and if it has, please point me to the post.

Link to comment
Share on other sites

High, This is a great Script, Thank You very much. 

 

I was just wondering if it was possible to separate the things you can get service for. For example, set it up so that players can only fuel up at the MAP_A_FuelStation_Feeds and nothing else, but if they get close to the MAP_repair_center they would only get the repair option, etc. 

Doesn't make sense that you can repair or rearm at a fuel pump, sure it's better than nothing for sure, don't get me wrong, and I love the script as do our players. I just want to make things a bit more realistic on our servers.

 

If this has already been covered in the thread, I apologize, as I did not see it. and if it has, please point me to the post.

I think that was already answered once or twice. :D

The short answer for the easiest solution is still to copy the the main script (service_point.sqf) and set up different class names and settings for your needs, you can just start the different scripts in your init.sqf that's no problem :)

e.g.

execVM "service_point\service_point.sqf";
execVM "service_point\service_point_rep.sqf"; // copy for repair only with different config
Link to comment
Share on other sites

  • 2 weeks later...

Hi everyone! I have a problem, players on server can't use refuel/repair/rearm menu because actions in menu are removed after short moment. But admins can use. Server runs with infiSTART antihack. Latest 125548 patch.

check your anti hack tools (infistar?), there are some solutions in this thread.

Link to comment
Share on other sites

Hello Axe Cop,

 

Trying to get your Service Point working on a NPC in my traders. I have the NPCs in place but there is no option. I have placed your files in a folder called "Service", inside another folder called "Scripts" (Super OCD  :P ). Here is my service_point.sqf:

 

// Vehicle Service Point by Axe Cop

private ["_folder","_servicePointClasses","_maxDistance","_actionTitleFormat","_actionCostsFormat","_costsFree","_message","_messageShown","_refuel_enable","_refuel_costs","_refuel_updateInterval","_refuel_amount","_repair_enable","_repair_costs","_repair_repairTime","_rearm_enable","_rearm_costs","_rearm_magazineCount","_lastVehicle","_lastRole","_fnc_removeActions","_fnc_getCosts","_fnc_actionTitle","_fnc_isArmed","_fnc_getWeapons"];

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

// general settings
_folder = "Scripts\Service\"; // folder where the service point scripts are saved, relative to the mission file
_servicePointClasses = "TK_CIV_Worker01_EP1"; // service point classes (can be house, vehicle and unit classes)
_maxDistance = 10; // 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 = [
	["Air",["ItemGoldBar10oz",2]], // free for all vehicles (equal to [["AllVehicles",[]]])
	["AllVehicles",["ItemGoldBar10oz",1]]
_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 = [
	["Air",["ItemGoldBar10oz",4]], // 5 Gold for helicopters and planes
	["AllVehicles",["ItemGoldBar10oz",3]] // 2 Gold for all other 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 = [
	["ArmoredSUV_PMC_DZE",["ItemGoldBar10oz",2]], // special costs for a single vehicle type
	["Air",["ItemGoldBar10oz",2]], // 2 10oz Gold for helicopters and planes
	["AllVehicles",["ItemGoldBar10oz",1]] // 1 10oz Gold for all other vehicles
];
_rearm_magazineCount = 3; // amount of magazines to be added to the vehicle weapon

// ----------------- CONFIG END -----------------

 

No errors in my RPT, cant seem to figure this one out. Any help would be great, thank you!  :D

Link to comment
Share on other sites

well if you have a folder called "Service" and inside another folder called "Scripts", then you should define it like that and not the other way around:

_folder = "Service\Scripts\";
??? :)

Omg Axe Cop thank you. I must have been staring at it too long. LOL!

Link to comment
Share on other sites

well if you have a folder called "Service" and inside another folder called "Scripts", then you should define it like that and not the other way around:

_folder = "Service\Scripts\";

??? :)

 

Ok I switched it, but still no option. No error in RPT either.

Link to comment
Share on other sites

Ok I switched it, but still no option. No error in RPT either.

weird, did you make sure the script is even started from your init.sqf?

if you are not sure you can add a simple debug log message and check that, e.g. at the very bottom of the service_point.sqf file add this line:

diag_log "service point script started";

that text should be printed to your client RPT file if the script is started.

 

note: most admins check the wrong RPT, so make sure to look into the CLIENT file, not the server log :D

Link to comment
Share on other sites

Not for the service point, we have a script that allows players to make keys for server spawned vehicles, at a cost of course, and to combine keys for their vehicles into a single key. It just seems that it would be more realistic if it were able to be done at a service point instead of anywhere in the world, I'll zip up that script in a bit and attach it

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