Jump to content

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


Axe Cop

Recommended Posts

There is a link on the previous page: 

 

Hi, I am running Epoch 1.0.3.1 for now (Dayz.st slow in getting update available). I had already installed your release of the 1.0.4 version before realizing there was a previous version available.

 

Even though I am running Epoch 1.0.3.1, the script was working except for the fact that, even if I had no gold, I could select to repair for 2 gold and my vehicle would be repaired (without paying).

 

I went to the older version link you posted in that link (above in quote) and found the ac_functions.sqf along with the older versions of service_point.sqf, service_point_rearm.sqf, service_point_refuel.sqf, and service_point_repair.sqf. I put them all these files inside the service_point folder inside my dayz_mission.pbo.

 

I did not see instructions regarding any changes to the execVM "service_point\service_point.sqf"; that is placed in the init.sqf, so I left that alone. However I will paste how I have it inserted so you can make sure its right (It was working before I tried the older 1.0.3.1 files) 

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

After making the changes above, I no longer get the option to refuel, refuel or rearm. 

 

Is there something I need to do outside of what I already have done? 

Link to comment
Share on other sites

@NickStewart: no what you are describing is absolutely right and it should work like that and yes the new versions works with older versions of Epoch but then you get everything for free because those functions have been added to Epoch 1.0.4 and not before.

Anyway you can check your RPT log file for errors like always, please clear or remove the file before your join the server and then check for errors!

If you don't knwo where to find the log file see here: https://community.bistudio.com/wiki/RPT#ARMA_2_OA (I think I'have posted that link like 10 times in this topic alone ..)

Link to comment
Share on other sites

Hi so i have implemented your script and it is working almost 100% my one problem which i probably did something wrong is when i get to a gas station i get the scroll wheel option (repair 2 gold) and it works even if i do not have the gold on me...how would i fix this?

What Epoch version are you using? The current version of this mod is for the latest Epoch version 1.0.4+ and does not work with 1.0.3.1 because there are missing functions (that's most likely why it doesn't work for you BUT this should be clearly visible in the log files, who nobody checks by themselves it seems)...

Does anybody read like the last 10 posts here in the topic or do I have to repeat everything 10x every day, sorry but it's getting tireing because people do the same mistakes and I have to answer with the same text all the time :p

Link to comment
Share on other sites

getting cannot find service point.sqf? did everything you stated...help ? D: or better yet anyone need to make some money coding for me? apply on my ts3 or my skype [email protected]

 

 

UPDATE: all are saying need power...

I have no idea what you did, but it only says "need power" if you use the default epoch refill stations and not my script haha

so if it cannot find the service_point.sqf at all you have installed it at the wrong location i guess?

Link to comment
Share on other sites

How would I go about making it so you have to have a set humanity level to be able to use this.. say + or - 15k a an example.

You can just use this to get the humanity of the current player:

player getVariable["humanity",0];

as simple as that, do a condition for the required humanity like:

if (abs player getVariable["humanity",0] >= 15000) then {
  // do something
};

see the "abs" command, so you only need to check for positive values and it will also be true for < -15k  :)

Link to comment
Share on other sites

that include items like the toolbox for example?

why don't you just try it, that would be faster than asking me all this haha.. anyway I don't think tools work as payment because tools count as weapons in ArmA and not items!

do you just want to check for a toolbox or remove it as payment for a repair or something? that is all very easy if you knwo a little AmA scripting.. (faster to write that code then writing this text here lol)

 

so the script to remove the items from the player's inventory uses the command "magazines player", I don't think that includes tools by default.

Link to comment
Share on other sites

I had this working great on my epoch tavi 1.0.3.1 but cant get it working on my panthera epoch 1.0.4.1 server ( I get no scroll options)

my variables in dayz_code shows all the gas stations I have tried to get this working at ( do I need to have a custom variables or will the dayz_fuelpumparray be called from the code ???)

I have downloaded the latest \service_point files  to the mission root service_point folder.

my init............

if (!isDedicated) then {
//Conduct map operations
0 fadeSound 0;
waitUntil {!isNil "dayz_loadScreenMsg"};
dayz_loadScreenMsg = (localize "STR_AUTHENTICATING");
execVM "service_point\service_point.sqf";  /// tried it here
//Run the player monitor
_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
_playerMonitor =  [] execVM "\z\addons\dayz_code\system\player_monitor.sqf";
 
execVM "service_point\service_point.sqf";  /// tried it here
//anti Hack
if (true) then {
[] execVM "ATPExclusion\antihack.sqf";
};
 
//Lights
//[0,0,true,true,true,58,280,600,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
_nil = [] execVM "custom\JAEM\EvacChopper_init.sqf";
execVM "service_point\service_point.sqf";  /// tried it here
};
Link to comment
Share on other sites

@calamity: weird, it should work like that and no you don't need a custom variables.sqf, it will just use the global array defined in the Epoch variables.sqf.

you can try and put a debug line in the service_point.sqf and see if it actually gets executed at all.

e.g. at the top of the file

diag_log "hello from the service_point.sqf";

and that text should be visible in your client RPT log file when you join the server. if not there is something wrong with your init.sqf

Link to comment
Share on other sites

 

 

ok so I forget sometimes that I am an idiot.

the problem was I had saved your github files by right clicking save as blah blah.sqf. I cant ever find a easy zip. normally I copy and paste the scripts into an empty sqf

this time I thought I could just right click save as, not soo much, it included html stuff.

 

well it works now that I copy and paste the scripts

 

thankz for helping an idiot like myself...

Link to comment
Share on other sites

no that's the wrong file, I say this in every second post by now but most admins don't know about the client report file on the client. not the server, see the wiki entry from BI here:

https://community.bistudio.com/wiki/RPT#ARMA_2_OA

depending on your operating system look in the folder and maybe you find other script errors in that file so that might be a reason why the script isn't loading.

 

the arma2oaserver.RPT is  just for scripts that run on the server, but with DayZ most scripts actually run on the client itself and that's where you gonna see the log messages and also errors :)

Link to comment
Share on other sites

no that's the wrong file, I say this in every second post by now but most admins don't know about the client report file on the client. not the server, see the wiki entry from BI here:

https://community.bistudio.com/wiki/RPT#ARMA_2_OA

depending on your operating system look in the folder and maybe you find other script errors in that file so that might be a reason why the script isn't loading.

 

the arma2oaserver.RPT is  just for scripts that run on the server, but with DayZ most scripts actually run on the client itself and that's where you gonna see the log messages and also errors :)

thankz for the link, I will be needing that, my game has been crashing often lately...... If I delete that file will a new one be generated ?? I have about 7000 lines in it most are Bad conversion: bool

Link to comment
Share on other sites

yeah you can just remove all 3 files if you have them (arma2.rpt, arma2.bidmp and arma2.mdmp), also check out the other folder the game caches every mission file from every server you have ever played on and everything in there, might clean up that too :D

Link to comment
Share on other sites

problems not charging for repair/rearm

 

Ok so I looked though this entire thread.  I have it installed, the scripts are executing like they should and I get the mousewheel option at fuel stations.

 

I haven't touched the config portion service_point.sqf, haven't changed the prices or anything. I wanted to test it first.

 

It will let me repair and rearm for free. The menu says it costs gold but it doesn't check my inventory properly or something because i can just sit there and rearm the machine guns on the UH1H without having any gold in my inventory.

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

// general settings
_folder = "service_point\"; // folder where the service point scripts are saved, relative to the mission file
_servicePointClasses = dayz_fuelpumparray; // service point classes (can be house, vehicle and unit classes)
_maxDistance = 15; // 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 = []; // 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)

// repair settings
_repair_enable = true; // enable or disable the repair option
_repair_costs = [
	["Air",["ItemGoldBar",5]], // 5 Gold for helicopters and planes
	["AllVehicles",["ItemGoldBar",2]] // 2 Gold for all other vehicles
];
_repair_repairTime = 2; // time needed to repair each damaged part (in seconds)

// rearm settings
_rearm_enable = true; // 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 -----------------
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...