Jaroo Posted November 29, 2013 Report Share Posted November 29, 2013 Guys Im happy its working perfect Thank you big hugss Axe Cop and Bags2247 Im pasted in service point class "Land_benzina_schnell" yeaahh :) Thank you again :D Link to comment Share on other sites More sharing options...
Bags2247 Posted November 29, 2013 Report Share Posted November 29, 2013 shit soz Axe Cop and Jaroo, i went afk for a bit then..... Glad it worked mate Bags p.s. I just realized that I pasted cherno fuel things instead of panthera, soz brain fart... missus is in hosp and wasnt really paying much attention to the post, kinda worried atm Link to comment Share on other sites More sharing options...
Lysus Posted November 29, 2013 Report Share Posted November 29, 2013 Anyone else having a problem with the _message not working? Link to comment Share on other sites More sharing options...
Axe Cop Posted November 29, 2013 Author Report Share Posted November 29, 2013 Anyone else having a problem with the _message not working? Maybe you need to enable the radio in the init.sqf, but it's just using the vehicle chat and not the radio!? And only the driver can see the message Link to comment Share on other sites More sharing options...
Richie Posted November 29, 2013 Report Share Posted November 29, 2013 I liked the original version but i was curious so i updated to the latest :) Both work like a charm, many thanks Axe Cop Link to comment Share on other sites More sharing options...
Alcsaar Posted November 29, 2013 Report Share Posted November 29, 2013 Why is the format for the service_point.sqf completely boned for me? Its nearly implossible to change any variable settings because this is what my downloaded SQF for service_point looks like: <td class="blob-line-code"> <div class="highlight"><pre><div class='line' id='LC1'>// Vehicle Service Point by Axe Cop</div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'>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","_refuel_action","_repair_action","_rearm_actions","_fnc_removeActions","_fnc_getCosts","_fnc_actionTitle","_fnc_isArmed","_fnc_getWeapons"];</div><div class='line' id='LC4'><br/></div><div class='line' id='LC5'>// ---------------- CONFIG START ----------------</div><div class='line' id='LC6'><br/></div><div class='line' id='LC7'>// general settings</div><div class='line' id='LC8'>_folder = "service_point\"; // folder where the service point scripts are saved, relative to the mission file</div><div class='line' id='LC9'>_servicePointClasses = ["Land_A_FuelStation_Feed"]; // service point classes (add "FuelPump_DZ" to use the dynamic Epoch fuel pumps)</div><div class='line' id='LC10'>_maxDistance = 10; // maximum distance from a service point for the options to be shown</div><div class='line' id='LC11'>_actionTitleFormat = "%1 (%2)"; // text of the vehicle menu, %1 = action name (Refuel, Repair, Rearm), %2 = costs (see format below)</div><div class='line' id='LC12'>_actionCostsFormat = "%2 %1"; // %1 = item name, %2 = item count</div><div class='line' id='LC13'>_costsFree = "free"; // text for no costs</div><div class='line' id='LC14'>_message = "Vehicle Service Point nearby"; // message to be shown when in range of a service point (set to "" to disable)</div><div class='line' id='LC15'><br/></div><div class='line' id='LC16'>// refuel settings</div><div class='line' id='LC17'>_refuel_enable = true; // enable or disable the refuel option</div><div class='line' id='LC18'>_refuel_costs = []; // free for all vehicles (equal to [["AllVehicles",[]]])</div><div class='line' id='LC19'>_refuel_updateInterval = 0.5; // update interval (in seconds)</div><div class='line' id='LC20'>_refuel_amount = 0.02; // amount of fuel to add with every update (in percent)</div><div class='line' id='LC21'><br/></div><div class='line' id='LC22'>// repair settings</div><div class='line' id='LC23'>_repair_enable = true; // enable or disable the repair option</div><div class='line' id='LC24'>_repair_costs = [</div><div class='line' id='LC25'> ["Air",["ItemGoldBar",5]], // 5 Gold for helicopters and planes</div><div class='line' id='LC26'> ["AllVehicles",["ItemGoldBar",2]] // 2 Gold for all other vehicles</div><div class='line' id='LC27'>];</div><div class='line' id='LC28'>_repair_repairTime = 2; // time needed to repair each damaged part (in seconds)</div><div class='line' id='LC29'><br/></div><div class='line' id='LC30'>// rearm settings</div><div class='line' id='LC31'>_rearm_enable =false; // enable or disable the rearm option</div><div class='line' id='LC32'>_rearm_costs = [</div><div class='line' id='LC33'> ["ArmoredSUV_PMC_DZE",["ItemGoldBar10oz",2]], // special costs for a single vehicle type</div><div class='line' id='LC34'> ["Air",["ItemGoldBar10oz",2]], // 2 10oz Gold for helicopters and planes</div><div class='line' id='LC35'> ["AllVehicles",["ItemGoldBar10oz",1]] // 1 10oz Gold for all other vehicles</div><div class='line' id='LC36'>];</div><div class='line' id='LC37'>_rearm_magazineCount = 3; // amount of magazines to be added to the vehicle weapon</div><div class='line' id='LC38'><br/></div><div class='line' id='LC39'>// ----------------- CONFIG END -----------------</div><div class='line' id='LC40'><br/></div><div class='line' id='LC41'>call compile preprocessFileLineNumbers (_folder + "ac_functions.sqf");</div><div class='line' id='LC42'><br/></div><div class='line' id='LC43'>_lastVehicle = objNull;</div><div class='line' id='LC44'>_lastRole = [];</div><div class='line' id='LC45'><br/></div><div class='line' id='LC46'>_refuel_action = -1;</div><div class='line' id='LC47'>_repair_action = -1;</div><div class='line' id='LC48'>_rearm_actions = [];</div><div class='line' id='LC49'><br/></div><div class='line' id='LC50'>_messageShown = false;</div><div class='line' id='LC51'><br/></div><div class='line' id='LC52'>_fnc_removeActions = {</div><div class='line' id='LC53'> if (isNull _lastVehicle) exitWith {};</div><div class='line' id='LC54'> _lastVehicle removeAction _refuel_action;</div><div class='line' id='LC55'> _refuel_action = -1;</div><div class='line' id='LC56'> _lastVehicle removeAction _repair_action;</div><div class='line' id='LC57'> _repair_action = -1;</div><div class='line' id='LC58'> {</div><div class='line' id='LC59'> _lastVehicle removeAction _x;</div><div class='line' id='LC60'> } forEach _rearm_actions;</div><div class='line' id='LC61'> _rearm_actions = [];</div><div class='line' id='LC62'> _lastVehicle = objNull;</div><div class='line' id='LC63'> _lastRole = [];</div><div class='line' id='LC64'>};</div><div class='line' id='LC65'><br/></div><div class='line' id='LC66'>_fnc_getCosts = {</div><div class='line' id='LC67'> private ["_vehicle","_costs","_cost"];</div><div class='line' id='LC68'> _vehicle = _this select 0;</div><div class='line' id='LC69'> _costs = _this select 1;</div><div class='line' id='LC70'> _cost = [];</div><div class='line' id='LC71'> {</div><div class='line' id='LC72'> private "_typeName";</div><div class='line' id='LC73'> _typeName = _x select 0;</div><div class='line' id='LC74'> if (_vehicle isKindOf _typeName) exitWith {</div><div class='line' id='LC75'> _cost = _x select 1;</div><div class='line' id='LC76'> };</div><div class='line' id='LC77'> } forEach _costs;</div><div class='line' id='LC78'> _cost</div><div class='line' id='LC79'>};</div><div class='line' id='LC80'><br/></div><div class='line' id='LC81'>_fnc_actionTitle = {</div><div class='line' id='LC82'> private ["_actionName","_costs","_costsText","_actionTitle"];</div><div class='line' id='LC83'> _actionName = _this select 0;</div><div class='line' id='LC84'> _costs = _this select 1;</div><div class='line' id='LC85'> _costsText = _costsFree;</div><div class='line' id='LC86'> if (count _costs == 2) then {</div><div class='line' id='LC87'> private ["_itemName","_itemCount","_displayName"];</div><div class='line' id='LC88'> _itemName = _costs select 0;</div><div class='line' id='LC89'> _itemCount = _costs select 1;</div><div class='line' id='LC90'> _displayName = getText (configFile >> "CfgMagazines" >> _itemName >> "displayName");</div><div class='line' id='LC91'> _costsText = format [_actionCostsFormat, _displayName, _itemCount];</div><div class='line' id='LC92'> };</div><div class='line' id='LC93'> _actionTitle = format [_actionTitleFormat, _actionName, _costsText];</div><div class='line' id='LC94'> _actionTitle</div><div class='line' id='LC95'>};</div><div class='line' id='LC96'><br/></div><div class='line' id='LC97'>_fnc_isArmed = {</div><div class='line' id='LC98'> private ["_role","_armed"];</div><div class='line' id='LC99'> _role = _this;</div><div class='line' id='LC100'> _armed = count _role > 1;</div><div class='line' id='LC101'> _armed</div><div class='line' id='LC102'>};</div><div class='line' id='LC103'><br/></div><div class='line' id='LC104'>_fnc_getWeapons = {</div><div class='line' id='LC105'> private ["_vehicle","_role","_weapons"];</div><div class='line' id='LC106'> _vehicle = _this select 0;</div><div class='line' id='LC107'> _role = _this select 1;</div><div class='line' id='LC108'> _weapons = [];</div><div class='line' id='LC109'> if (count _role > 1) then {</div><div class='line' id='LC110'> private ["_turret","_weaponsTurret"];</div><div class='line' id='LC111'> _turret = _role select 1;</div><div class='line' id='LC112'> _weaponsTurret = _vehicle weaponsTurret _turret;</div><div class='line' id='LC113'> {</div><div class='line' id='LC114'> private "_weaponName";</div><div class='line' id='LC115'> _weaponName = getText (configFile >> "CfgWeapons" >> _x >> "displayName");</div><div class='line' id='LC116'> _weapons set [count _weapons, [_x, _weaponName, _turret]];</div><div class='line' id='LC117'> } forEach _weaponsTurret;</div><div class='line' id='LC118'> };</div><div class='line' id='LC119'> _weapons</div><div class='line' id='LC120'>};</div><div class='line' id='LC121'><br/></div><div class='line' id='LC122'>while {true} do {</div><div class='line' id='LC123'> private ["_vehicle","_inVehicle"];</div><div class='line' id='LC124'> _vehicle = vehicle player;</div><div class='line' id='LC125'> _inVehicle = _vehicle != player;</div><div class='line' id='LC126'> if (local _vehicle && _inVehicle) then {</div><div class='line' id='LC127'> private ["_pos","_objects","_inRange"];</div><div class='line' id='LC128'> _pos = position _vehicle;</div><div class='line' id='LC129'> _objects = nearestObjects [_pos, _servicePointClasses, _maxDistance];</div><div class='line' id='LC130'> _inRange = count _objects > 0;</div><div class='line' id='LC131'> if (_inRange) then {</div><div class='line' id='LC132'> private ["_role","_actionCondition","_costs","_actionTitle"];</div><div class='line' id='LC133'> _role = assignedVehicleRole player;</div><div class='line' id='LC134'> if (((str _role) != (str _lastRole)) || (_vehicle != _lastVehicle)) then {</div><div class='line' id='LC135'> // vehicle or seat changed</div><div class='line' id='LC136'> call _fnc_removeActions;</div><div class='line' id='LC137'> };</div><div class='line' id='LC138'> _lastVehicle = _vehicle;</div><div class='line' id='LC139'> _lastRole = _role;</div><div class='line' id='LC140'> _actionCondition = "vehicle _this == _target && local _target";</div><div class='line' id='LC141'> if (_refuel_action < 0 && _refuel_enable) then {</div><div class='line' id='LC142'> _costs = [_vehicle, _refuel_costs] call _fnc_getCosts;</div><div class='line' id='LC143'> _actionTitle = ["Refuel", _costs] call _fnc_actionTitle;</div><div class='line' id='LC144'> _refuel_action = _vehicle addAction [_actionTitle, _folder + "service_point_refuel.sqf", [_costs, _refuel_updateInterval, _refuel_amount], -1, false, true, "", _actionCondition];</div><div class='line' id='LC145'> };</div><div class='line' id='LC146'> if (_repair_action < 0 && _repair_enable) then {</div><div class='line' id='LC147'> _costs = [_vehicle, _repair_costs] call _fnc_getCosts;</div><div class='line' id='LC148'> _actionTitle = ["Repair", _costs] call _fnc_actionTitle;</div><div class='line' id='LC149'> _repair_action = _vehicle addAction [_actionTitle, _folder + "service_point_repair.sqf", [_costs, _repair_repairTime], -1, false, true, "", _actionCondition];</div><div class='line' id='LC150'> };</div><div class='line' id='LC151'> if ((_role call _fnc_isArmed) && (count _rearm_actions == 0) && _rearm_enable) then {</div><div class='line' id='LC152'> private ["_weapons"];</div><div class='line' id='LC153'> _costs = [_vehicle, _rearm_costs] call _fnc_getCosts;</div><div class='line' id='LC154'> _weapons = [_vehicle, _role] call _fnc_getWeapons;</div><div class='line' id='LC155'> {</div><div class='line' id='LC156'> private ["_weaponName","_rearm_action"];</div><div class='line' id='LC157'> _weaponName = _x select 1;</div><div class='line' id='LC158'> _actionTitle = [format["Rearm %1", _weaponName], _costs] call _fnc_actionTitle;</div><div class='line' id='LC159'> _rearm_action = _vehicle addAction [_actionTitle, _folder + "service_point_rearm.sqf", [_costs, _rearm_magazineCount, _x], -1, false, true, "", _actionCondition];</div><div class='line' id='LC160'> _rearm_actions set [count _rearm_actions, _rearm_action];</div><div class='line' id='LC161'> } forEach _weapons;</div><div class='line' id='LC162'> };</div><div class='line' id='LC163'> if (!_messageShown && _message != "") then {</div><div class='line' id='LC164'> _messageShown = true;</div><div class='line' id='LC165'> _vehicle vehicleChat _message;</div><div class='line' id='LC166'> };</div><div class='line' id='LC167'> } else {</div><div class='line' id='LC168'> call _fnc_removeActions;</div><div class='line' id='LC169'> _messageShown = false;</div><div class='line' id='LC170'> };</div><div class='line' id='LC171'> } else {</div><div class='line' id='LC172'> call _fnc_removeActions;</div><div class='line' id='LC173'> _messageShown = false;</div><div class='line' id='LC174'> };</div><div class='line' id='LC175'> sleep 2;</div><div class='line' id='LC176'>};</div></pre></div> </td> </tr> </table> </div> I'm no expert, but this looks like its written in HTML. the fuck? I've tried opening the file using Notepad++ And Notepad. Edit: I guess its because I right clicked on the github and used the "save file as" option and its completely boning the format. Whats the deal? I can't find a download zip button or anything on your github page to download normally. I have that option if I go to the mainpage of your Github, but that does me no good because it wants me to dowload all your scripts, and I'm not interested in the others. Why does github have to be such a pain in the ass? I guess ill have to download everything and just sort out what I need. Pretty annoying though. Link to comment Share on other sites More sharing options...
Axe Cop Posted November 29, 2013 Author Report Share Posted November 29, 2013 Yeah you have saved the github page containing the script, click on "raw" and then save or just download the whole dayz script package here: https://github.com/vos/dayz/archive/master.zip (it's very small, don't worry) and copy the service_point folder to your mission folder. :) Link to comment Share on other sites More sharing options...
Alcsaar Posted November 29, 2013 Report Share Posted November 29, 2013 Yep thats what I did thanks. Github is finnicky sometimes. Link to comment Share on other sites More sharing options...
Lysus Posted November 29, 2013 Report Share Posted November 29, 2013 Maybe you need to enable the radio in the init.sqf, but it's just using the vehicle chat and not the radio!? And only the driver can see the message That was it, thanks works great! Link to comment Share on other sites More sharing options...
Axe Cop Posted November 30, 2013 Author Report Share Posted November 30, 2013 would be cool if we could split up what we can do on which building... so for example refueling on fuel stations, fuel pumps or fuel tanks repairing/rearmin on garages or repair buildings... any suggestions on this? If you want you can do that by simply copying the service_point.sqf script 3 times and only enable one of repair, refuel or rearm in each script and then change the service point class and start all 3 in your init.sqf, I hope you know what i mean. :D That should work, it's about the same performance as if the script itself would check 3 different buildings, not that the script uses much performance but still this is the easiest way without changing the whole script for what you want. WEB11 and Gagi2 2 Link to comment Share on other sites More sharing options...
andygully Posted November 30, 2013 Report Share Posted November 30, 2013 trying to add this to my panthera but it is not working any ideas? changed the thing to use to Land_benzina_schnell Link to comment Share on other sites More sharing options...
Jaroo Posted November 30, 2013 Report Share Posted November 30, 2013 Andygully try paste this code for me working _servicePointClasses = ["Land_A_FuelStation_Feed", "Land_A_FuelStation_Feed", "Land_benzina_schnell", "Land_Ind_TankSmall", "Land_Ind_TankSmall2", "Land_Ind_TankSmall2_EP1", "Land_fuel_tank_stairs"]; // service point classes (add "FuelPump_DZ" to use the dynamic Epoch fuel pumps) Link to comment Share on other sites More sharing options...
Axe Cop Posted November 30, 2013 Author Report Share Posted November 30, 2013 Andygully try paste this code for me working _servicePointClasses = ["Land_A_FuelStation_Feed", "Land_A_FuelStation_Feed", "Land_benzina_schnell", "Land_Ind_TankSmall", "Land_Ind_TankSmall2", "Land_Ind_TankSmall2_EP1", "Land_fuel_tank_stairs"]; // service point classes (add "FuelPump_DZ" to use the dynamic Epoch fuel pumps) Just keep in mind this will enable the players to refuel, repair and rearm at almost any fuel tank on the map! Link to comment Share on other sites More sharing options...
andygully Posted December 1, 2013 Report Share Posted December 1, 2013 thanks for the help but its just not working iv added the line to the init but no joy Link to comment Share on other sites More sharing options...
Axe Cop Posted December 1, 2013 Author Report Share Posted December 1, 2013 thanks for the help but its just not working iv added the line to the init but no joy that may be because you have no idea what you are doing, you can't just copy things in any file and it magically works dude :P The part Jaroo posted needs to replace my line in the file service_point.sqf in the config section. :) MatthewK 1 Link to comment Share on other sites More sharing options...
andygully Posted December 1, 2013 Report Share Posted December 1, 2013 nice way to talk to people dude! i no what im doing iv changed the line service_point.sqf to what jaroo posted also followed your instructions and had no joy so thanked people including yourself for your help and you act like a d##k i was not saying anything bad it did not work for me that is all.... Link to comment Share on other sites More sharing options...
MatthewK Posted December 1, 2013 Report Share Posted December 1, 2013 Got a quickie for you axe cop. I've added refuel trucks to the list of refuel point vehicles, so a player can drive to their buddy in one and repair / refuel a vehicle.. It works great, but one issue I'm struggling with is that I don't want them sat in the vehicle using it as god mode, if you know what I mean. So I'm trying to get the script to check that the vehicle is within a set distance, i.e no more than 15 meters , but no less than 5 meters, so they can't use the truck to repair / refuel itself .. Any ideas? Link to comment Share on other sites More sharing options...
MatthewK Posted December 1, 2013 Report Share Posted December 1, 2013 nice way to talk to people dude! i no what im doing iv changed the line service_point.sqf to what jaroo posted also followed your instructions and had no joy so thanked people including yourself for your help and you act like a d##k i was not saying anything bad it did not work for me that is all.... He was actually speaking tongue in cheek , I was thinking the same thing as he was (but I was not thinking so politely). You say you put it in the init, but it doesn't go in the init, the line you were told to change goes in another file. Maybe if you provided more information, the full code for that document you've changed maybe too ? This is us, trying to help you, help yourself :p Link to comment Share on other sites More sharing options...
Axe Cop Posted December 2, 2013 Author Report Share Posted December 2, 2013 (edited) Got a quickie for you axe cop. I've added refuel trucks to the list of refuel point vehicles, so a player can drive to their buddy in one and repair / refuel a vehicle.. It works great, but one issue I'm struggling with is that I don't want them sat in the vehicle using it as god mode, if you know what I mean. So I'm trying to get the script to check that the vehicle is within a set distance, i.e no more than 15 meters , but no less than 5 meters, so they can't use the truck to repair / refuel itself .. Any ideas? Quick and easy solution, after: _objects = nearestObjects [_pos, _servicePointClasses, _maxDistance]; _inRange = count _objects > 0; add this line: { if (_x distance _vehicle < 5) exitWith { _inRange = false; }; } forEach _objects; if the vehicle is too close to any service point (usually just one in range, but in your case you never know haha) it sets "_inRange" to false so it will not add the action menu. Should work, pretty easy i think? :D oh and change the 5 to whatever your closest range should be, obviously less than _maxDistance... Edited December 2, 2013 by Axe Cop MatthewK 1 Link to comment Share on other sites More sharing options...
MatthewK Posted December 2, 2013 Report Share Posted December 2, 2013 { if (_x distance _vehicle > 5) exitWith { _inRange = false; }; } forEach _objects; Should that be: { if (_x distance _vehicle < 5) exitWith { _inRange = false; }; } forEach _objects; < 5 or am I being dim ? Link to comment Share on other sites More sharing options...
Axe Cop Posted December 2, 2013 Author Report Share Posted December 2, 2013 (edited) i am a little sleepy yeah maybe you are right if < 5 then it will be "out of range", I better change it in the code above when sombody else reads that :P After thinking a little about that, maybe change that to a better solution, so a vehicle cannot use itself as a service point that would be better I think? instead of this if you have more service poinst you won't get the option if you are to close which might seems like a bug :D try this instead, not tested: if (!(_vehicle in _objects) && _inRange) then { so if the vehicle is not a service point and in range... that should be better and makes more sense Edited December 2, 2013 by Axe Cop Link to comment Share on other sites More sharing options...
MatthewK Posted December 2, 2013 Report Share Posted December 2, 2013 I tried it and it doesn't work. The vehicle doesn't get the option to refuel/repair/re-ammo, even if I'm right on top of the refuel point. I can still refuel other vehicles normally though.. Link to comment Share on other sites More sharing options...
MatthewK Posted December 2, 2013 Report Share Posted December 2, 2013 Or how about a time out or not while in combat? I'll have to play with those two ideas during the week. Meanwhile, thanks again for a cool script, it's certainly been a game changer on my server :) Link to comment Share on other sites More sharing options...
Axe Cop Posted December 2, 2013 Author Report Share Posted December 2, 2013 Or how about a time out or not while in combat? I'll have to play with those two ideas during the week. Meanwhile, thanks again for a cool script, it's certainly been a game changer on my server :) did you try the code from my last post? Link to comment Share on other sites More sharing options...
MatthewK Posted December 2, 2013 Report Share Posted December 2, 2013 i am a little sleepy yeah maybe you are right if < 5 then it will be "out of range", I better change it in the code above when sombody else reads that :P After thinking a little about that, maybe change that to a better solution, so a vehicle cannot use itself as a service point that would be better I think? instead of this if you have more service poinst you won't get the option if you are to close which might seems like a bug :D try this instead, not tested: if (!(_vehicle in _objects) && _inRange) then { so if the vehicle is not a service point and in range... that should be better and makes more sense Will try this when i get up later today. It's 2am for me and I've not slept since erm... about a day ago haha! Thanks for the help on this one, I'll let you know as soon as I've tested it. :) Link to comment Share on other sites More sharing options...