Zupa Posted August 12, 2014 Report Share Posted August 12, 2014 Credits to Axe for orignal script. Universal for 1.1 and 2.0 These are based on my dev functions: (The functions are needed in your compiles, double check this!) THE DEV FUNCTIONS are needed! You can find Service Points files on github here: Replace your old files with these. https://github.com/EpochSC/ServicePointSC Change the configs to your likings. bFe, mgm, calamity and 4 others 7 Link to comment Share on other sites More sharing options...
Storm Posted August 12, 2014 Report Share Posted August 12, 2014 I'll take a look at it. Link to comment Share on other sites More sharing options...
asremix Posted August 12, 2014 Report Share Posted August 12, 2014 Oh . I love you ZUPA. I have one question. How to make refuel to not free? Link to comment Share on other sites More sharing options...
Coco-Nuts Posted August 12, 2014 Report Share Posted August 12, 2014 Awesome, that's exactly what i'm looking for :) Link to comment Share on other sites More sharing options...
orionjade Posted August 12, 2014 Report Share Posted August 12, 2014 Thanks, been waiting for this. :) I'm getting some errors in my client rpt log 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.panthera2\custom\service_point\service_point_refuel.sqf, line 15 Error in expression <; if !([ player,_costs select 1] call SC_fnc_removeCoins) then { _textMissing > Error position: <SC_fnc_removeCoins) then { _textMissing > Error Undefined variable in expression: sc_fnc_removecoins File mpmissions\__CUR_MP.panthera2\custom\service_point\service_point_repair.sqf, line 14 Error in expression <; if !([ player,_costs select 1] call SC_fnc_removeCoins) then { _textMissing > Error position: <SC_fnc_removeCoins) then { _textMissing > Error Undefined variable in expression: sc_fnc_removecoins File mpmissions\__CUR_MP.panthera2\custom\service_point\service_point_rearm.sqf, line 15 Error in expression <; anyone figure this out yet? Oh and just to let everyone know there is a missing ] in service_point.sqf This _repair_costs = [ ["Air",[CurrencyName,_coinsRepairAir], // 5 Gold for helicopters and planes ["AllVehicles",[CurrencyName,_coinsRepairVehicles]] // 2 Gold for all other vehicles ]; should be this _repair_costs = [ ["Air",[CurrencyName,_coinsRepairAir]], // 5 Gold for helicopters and planes ["AllVehicles",[CurrencyName,_coinsRepairVehicles]] // 2 Gold for all other vehicles ]; mgm 1 Link to comment Share on other sites More sharing options...
McPimpin Posted August 13, 2014 Report Share Posted August 13, 2014 Has anyone made this to work with It doesn't work for me as-is. Link to comment Share on other sites More sharing options...
Coco-Nuts Posted August 13, 2014 Report Share Posted August 13, 2014 Ok so it works for me but tha amount show "Repair 2000 any" Link to comment Share on other sites More sharing options...
orionjade Posted August 13, 2014 Report Share Posted August 13, 2014 Thanks, been waiting for this. :) I'm getting some errors in my client rpt log 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.panthera2\custom\service_point\service_point_refuel.sqf, line 15 Error in expression <; if !([ player,_costs select 1] call SC_fnc_removeCoins) then { _textMissing > Error position: <SC_fnc_removeCoins) then { _textMissing > Error Undefined variable in expression: sc_fnc_removecoins File mpmissions\__CUR_MP.panthera2\custom\service_point\service_point_repair.sqf, line 14 Error in expression <; if !([ player,_costs select 1] call SC_fnc_removeCoins) then { _textMissing > Error position: <SC_fnc_removeCoins) then { _textMissing > Error Undefined variable in expression: sc_fnc_removecoins File mpmissions\__CUR_MP.panthera2\custom\service_point\service_point_rearm.sqf, line 15 Error in expression <; anyone figure this out yet? Oh and just to let everyone know there is a missing ] in service_point.sqf This _repair_costs = [ ["Air",[CurrencyName,_coinsRepairAir], // 5 Gold for helicopters and planes ["AllVehicles",[CurrencyName,_coinsRepairVehicles]] // 2 Gold for all other vehicles ]; should be this _repair_costs = [ ["Air",[CurrencyName,_coinsRepairAir]], // 5 Gold for helicopters and planes ["AllVehicles",[CurrencyName,_coinsRepairVehicles]] // 2 Gold for all other vehicles ]; Got this figured out, but I'm having some trouble with the refuel, it says missing <null> more of <null> after clicking on refuel. Anyone have a solution for this? Link to comment Share on other sites More sharing options...
Storm Posted August 13, 2014 Report Share Posted August 13, 2014 Has anyone made this to work with It doesn't work for me as-is. I have Soul's as well, I will be taking a look at it and will update when I am finally back home. Link to comment Share on other sites More sharing options...
kat Posted August 14, 2014 Report Share Posted August 14, 2014 Thanks, been waiting for this. :) I'm getting some errors in my client rpt log Error position: <select 1] call SC_fnc_removeCoins) then > Error Zero divisor File mpmissions\__CUR_MP.panthera2\custom\service_point\service_point_refuel.sqf, line 15 Error in expression <; if !([ player,_costs select 1] call SC_fnc_removeCoins) then { _textMissing > Error position: <SC_fnc_removeCoins) then { _textMissing > Error Undefined variable in expression: sc_fnc_removecoins File mpmissions\__CUR_MP.panthera2\custom\service_point\service_point_repair.sqf, line 14 Error in expression <; if !([ player,_costs select 1] call SC_fnc_removeCoins) then { _textMissing > Error position: <SC_fnc_removeCoins) then { _textMissing > Error Undefined variable in expression: sc_fnc_removecoins File mpmissions\__CUR_MP.panthera2\custom\service_point\service_point_rearm.sqf, line 15 Error in expression <; if !([ player,_costs select 1] call SC_fnc_removeCoins) then > anyone figure this out yet? Oh and just to let everyone know there is a missing ] in service_point.sqf This _repair_costs = [ ["Air",[CurrencyName,_coinsRepairAir], // 5 Gold for helicopters and planes ["AllVehicles",[CurrencyName,_coinsRepairVehicles]] // 2 Gold for all other vehicles ]; should be this _repair_costs = [ ["Air",[CurrencyName,_coinsRepairAir]], // 5 Gold for helicopters and planes ["AllVehicles",[CurrencyName,_coinsRepairVehicles]] // 2 Gold for all other vehicles ]; Did you add the variables to your custom compiles? If you have Souls custom Hive.dll In those variables change 'headShots' to 'cashMoney' Refuel wasn't working as i was getting null something null (cant remember exactly) :rolleyes: In Service_point.sqf i changed _refuel_costs = []; to _refuel_costs = [ ["AllVehicles",[CurrencyName,_coinsRefuelVehicles]], ["Air",[CurrencyName,_coinsRefuelAir]]]; Then added: _coinsRefuelVehicles = 0; _coinsRefuelAir = 0; Under: _coinsRepairVehicles = 2000; Probably not the best way to go about it, works tho. :lol: service_point.sqf mgm 1 Link to comment Share on other sites More sharing options...
orionjade Posted August 14, 2014 Report Share Posted August 14, 2014 Did you add the variables to your custom compiles? If you have Souls custom Hive.dll In those variables change 'headShots' to 'cashMoney' Refuel wasn't working as i was getting null something null (cant remember exactly) :rolleyes: In Service_point.sqf i changed _refuel_costs = []; to _refuel_costs = [ ["AllVehicles",[CurrencyName,_coinsRefuelVehicles]], ["Air",[CurrencyName,_coinsRefuelAir]]]; Then added: _coinsRefuelVehicles = 0; _coinsRefuelAir = 0; Under: _coinsRepairVehicles = 2000; Probably not the best way to go about it, works tho. :lol: service_point.sqf Thanks, I'll try this later today. I No I don't use Soul's .dll cause no one there seems willing the try and help me get it working, I have nothing but errors with his .dll file. I wish I could get his to work cause I would rather use this version instead of the original. Link to comment Share on other sites More sharing options...
mgm Posted August 14, 2014 Report Share Posted August 14, 2014 Credits to Axe for orignal script. FOR 999: 1.1 Version <snip> https://github.com/EpochSC/ServicePointSC <snip> service_point.sqf Thanks to Zupa for posting this and kat for the testing and fixes. Working fine on our test server. Link to comment Share on other sites More sharing options...
shayd Posted August 15, 2014 Report Share Posted August 15, 2014 Works very well! Once again really good work Zupa! One problem I did find tho is when running Overpoch it would not refuel any of the 350Z's or Holdens? Link to comment Share on other sites More sharing options...
mgm Posted August 16, 2014 Report Share Posted August 16, 2014 Some fuel stations don't seem to work. Did anyone have a fix for that yet? Link to comment Share on other sites More sharing options...
kat Posted August 16, 2014 Report Share Posted August 16, 2014 Specifically what stations? Link to comment Share on other sites More sharing options...
mgm Posted August 17, 2014 Report Share Posted August 17, 2014 Specifically what stations? As you know service stations normally have the yellow colored text "VEHICLE SERVICE POINT NEARBY" come up automatically when you're in close range (10 meters or so) and they have the service point mousewheel menu appear as per normal. The one which was "not working" for us: (North of Solnichniy) didn't had the text and no mouse wheel service point options came up. I am 100% sure it did NOT work when we tested it last time (just before I posted this thread). We had 5 guys in the heli, we took turns trying to figure out what's wrong with it and it consistently did not work. We were lifting a heli and the lifting heli or the lifted heli (and also none of the quickly spawned land/air vehicles received the service point action menu). I am not sure whether a one off oddity or something else that will bug us in the future but for now we can assume it is all good as the issue affected only me and just once. NO ISSUES (working consistently with over 20 restarts so far): East of Kamenka, West of Cherno, West of Elektro, East of Novy Sobor. Link to comment Share on other sites More sharing options...
Rocu Posted August 18, 2014 Report Share Posted August 18, 2014 Works perfectly on Overpoch Taviana with Soul's hive.dll. Thanks a lot. Works very well! Once again really good work Zupa! One problem I did find tho is when running Overpoch it would not refuel any of the 350Z's or Holdens? Works fine for me. Just tried repairing/refueling some 350z's. Edit// Just noticed a minor error in this. When you don't have the right amount of money you will get a weird message something like: "You need 1000 more of Coins". Instead of calculating the amount of coins you're missing. Not exactly the most vital error but if you're a perfectionst then this fix will help: service_point_repair.sqf Find: cutText [format[(localize "STR_EPOCH_ACTIONS_12"), _costs select 1, _textMissing], "PLAIN DOWN"]; Replace with: _player_money = player getVariable ["cashMoney",0]; _repair_cost = _costs select 1; _needed = _repair_cost - _player_money; cutText [format["You need another %1 %2",_needed,CurrencyName] , "PLAIN DOWN"]; Do the same with service_point_refuel.sqf and service_point_rearm.sqf. Now you get something like: You need another 500 Coins. Link to comment Share on other sites More sharing options...
GSGBen Posted August 22, 2014 Report Share Posted August 22, 2014 I've done everything listed here, and I get no errors, but when I go to any of the fuel stations I don't get the scroll menu. I'm running on Chernarus overpoch. I've done everything as stated by Rocu and Kat as far as edits and fixes go, and I've double checked everything. I've also added in the dev functions. Link to comment Share on other sites More sharing options...
McPimpin Posted August 23, 2014 Report Share Posted August 23, 2014 I am using a modified version of this but i am am having issues with refuel. I have the refuel set at free. but when I try and refuel without any coins it tells me that i need 0 coins. Can anyone give me some pointers? // 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","_fnc_getMagazines"]; // ---------------- CONFIG START ---------------- // -- Single Currency Prices -- // _coinsRepairAir = 5000; _coinsRepairVehicles = 2000; _coinsRepairTank = 20000; _coinsRefuelVehicles = 0; _coinsRefuelAir = 0; //Rearm _coinsRearmAir = 20000; _coinsRearmVehicles = 10000; _coinsRearmTank = 100000; // -- End Single Currency Prices -- // // general settings _folder = "Custom\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 = 30; // 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",[CurrencyName,_coinsRefuelVehicles]], ["Air",[CurrencyName,_coinsRefuelAir]] ]; _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",[CurrencyName,_coinsRepairAir]], // [1,"ItemGoldBar10oz",1] ["Tank",[CurrencyName,_coinsRepairTank]], // ["AllVehicles",[CurrencyName,_coinsRepairVehicles]] // 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 //_blockedWeaponNames=["S-5","Hydra","CRV7"]; // weapon names you wish to exclude from rearming. Leave empty [] to allow all _blockedWeaponNames=[]; // Weapon names you wish to exclude from rearming. Leave empty [] to allow all _blockedAmmoNames = []; _rearm_costs = [ ["Car",[CurrencyName,_coinsRearmVehicles]], ["Air",[CurrencyName,_coinsRearmAir]], // ["Tank",[CurrencyName,_coinsRearmTank]], // ["AllVehicles",[CurrencyName,_coinsRearmVehicles]] // 1 10oz Gold for all other vehicles ]; _rearm_magazineCount = 1; // amount of magazines to be added to the vehicle weapon // ----------------- CONFIG END ----------------- call compile preprocessFileLineNumbers (_folder + "ac_functions.sqf"); _lastVehicle = objNull; _lastRole = []; SP_refuel_action = -1; SP_repair_action = -1; SP_rearm_actions = []; _messageShown = false; _fnc_removeActions = { if (isNull _lastVehicle) exitWith {}; _lastVehicle removeAction SP_refuel_action; SP_refuel_action = -1; _lastVehicle removeAction SP_repair_action; SP_repair_action = -1; { _lastVehicle removeAction _x; } forEach SP_rearm_actions; SP_rearm_actions = []; _lastVehicle = objNull; _lastRole = []; }; _fnc_getCosts = { private ["_vehicle","_costs","_cost"]; _vehicle = _this select 0; _costs = _this select 1; _cost = []; { private "_typeName"; _typeName = _x select 0; if (_vehicle isKindOf _typeName) exitWith { _cost = _x select 1; }; } forEach _costs; _cost }; _fnc_actionTitle = { private ["_actionName","_costs","_costsText","_actionTitle"]; _actionName = _this select 0; _costs = _this select 1; _costsText = _costsFree; if (count _costs == 2) then { private ["_itemName","_itemCount","_displayName"]; _itemName = _costs select 0; _itemCount = _costs select 1; _displayName = _itemName; _costsText = format [_actionCostsFormat, _displayName, _itemCount]; }; _actionTitle = format [_actionTitleFormat, _actionName, _costsText]; _actionTitle }; _fnc_isArmed = { private ["_role","_armed"]; _role = _this; _armed = count _role > 1; _armed }; _fnc_getWeapons = { private ["_vehicle","_role","_weapons","_magazineNumber","_badAmmo","_badWeapon","_magazines","_weapon"]; _vehicle = _this select 0; _role = _this select 1; _weapons = []; if (count _role > 1) then { private ["_turret","_weaponsTurret"]; _turret = _role select 1; _weaponsTurret = _vehicle weaponsTurret _turret; { private "_weaponName"; _weaponName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); //_weapons set [count _weapons, [_x, _weaponName, _turret]]; // block ammo types _badWeapon = _weaponName in _blockedWeaponNames; if (!_badWeapon) then { _weapon = _x; // get all ammo types for this weapon _magazines = [_weapon] call _fnc_getMagazines; // loop through all ammo types and add them to our list { _badAmmo = _x in _blockedAmmoNames; // check to see if our ammo is prohibited if (!_badAmmo) then { // add one entry to weapons per ammo type. _weapons set [count _weapons, [_weapon, _weaponName, _turret, _x]]; }; } foreach _magazines; }; } forEach _weaponsTurret; } else { private ["_turret","_weaponsTurret","_badAmmo","_badWeapon","_magazines","_weapon"]; _turret = [-1]; _weaponsTurret = vehicle player weaponsTurret [-1]; { private "_weaponName"; _weaponName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); // block ammo types _badWeapon = _weaponName in _blockedWeaponNames; if (!_badWeapon) then { _weapon = _x; // get all ammo types for this weapon _magazines = [_weapon] call _fnc_getMagazines; // loop through all ammo types and add them to our list { // check to see if our ammo is prohibited _badAmmo = _x in _blockedAmmoNames; if (!_badAmmo) then { // add one entry to weapons per ammo type. _weapons set [count _weapons, [_weapon, _weaponName, _turret, _x]]; }; } foreach _magazines; }; } forEach _weaponsTurret; }; _weapons }; _fnc_getMagazines = { private ["_weaponType","_magazines","_mags"]; _magazines = []; _weaponType = _this select 0; _magazines = getArray (configFile >> "CfgWeapons" >> _weaponType >> "magazines"); _magazines //_ammo = _magazines select 0; // rearm with the first magazine }; while {true} do { private ["_vehicle","_inVehicle"]; _vehicle = vehicle player; _inVehicle = _vehicle != player; if (local _vehicle && _inVehicle) then { private ["_pos","_servicePoints","_inRange"]; _pos = getPosATL _vehicle; _servicePoints = (nearestObjects [_pos, _servicePointClasses, _maxDistance]) - [_vehicle]; _inRange = count _servicePoints > 0; if (_inRange) then { private ["_servicePoint","_role","_actionCondition","_costs","_actionTitle"]; _servicePoint = _servicePoints select 0; _role = assignedVehicleRole player; if (((str _role) != (str _lastRole)) || (_vehicle != _lastVehicle)) then { // vehicle or seat changed call _fnc_removeActions; }; _lastVehicle = _vehicle; _lastRole = _role; _actionCondition = "vehicle _this == _target && local _target"; if (SP_refuel_action < 0 && _refuel_enable) then { _costs = [_vehicle, _refuel_costs] call _fnc_getCosts; _actionTitle = ["Refuel", _costs] call _fnc_actionTitle; SP_refuel_action = _vehicle addAction [_actionTitle, _folder + "service_point_refuel.sqf", [_servicePoint, _costs, _refuel_updateInterval, _refuel_amount], -1, false, true, "", _actionCondition]; }; if (SP_repair_action < 0 && _repair_enable) then { _costs = [_vehicle, _repair_costs] call _fnc_getCosts; _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]; }; if (count SP_rearm_actions == 0 && _rearm_enable) then { private ["_weapons"]; _costs = [_vehicle, _rearm_costs] call _fnc_getCosts; _weapons = [_vehicle, _role] call _fnc_getWeapons; { private ["_weaponName","_magazineName"]; _weaponName = _x select 1; _magazineName = _x select 3; _actionTitle = [format["Rearm %1 - %2", _weaponName, _magazineName], _costs] call _fnc_actionTitle; SP_rearm_action = _vehicle addAction [_actionTitle, _folder + "service_point_rearm.sqf", [_servicePoint, _costs, _rearm_magazineCount, _x], -1, false, true, "", _actionCondition]; SP_rearm_actions set [count SP_rearm_actions, SP_rearm_action]; } forEach _weapons; }; if (!_messageShown && _message != "") then { _messageShown = true; _vehicle vehicleChat _message; }; } else { call _fnc_removeActions; _messageShown = false; }; } else { call _fnc_removeActions; _messageShown = false; }; sleep 2; }; If I have coin on me, it will refuel but not deduct any coin. Link to comment Share on other sites More sharing options...
Rocu Posted August 23, 2014 Report Share Posted August 23, 2014 I am using a modified version of this but i am am having issues with refuel. I have the refuel set at free. but when I try and refuel without any coins it tells me that i need 0 coins. Can anyone give me some pointers? // 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","_fnc_getMagazines"]; // ---------------- CONFIG START ---------------- // -- Single Currency Prices -- // _coinsRepairAir = 5000; _coinsRepairVehicles = 2000; _coinsRepairTank = 20000; _coinsRefuelVehicles = 0; _coinsRefuelAir = 0; //Rearm _coinsRearmAir = 20000; _coinsRearmVehicles = 10000; _coinsRearmTank = 100000; // -- End Single Currency Prices -- // // general settings _folder = "Custom\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 = 30; // 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",[CurrencyName,_coinsRefuelVehicles]], ["Air",[CurrencyName,_coinsRefuelAir]] ]; _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",[CurrencyName,_coinsRepairAir]], // [1,"ItemGoldBar10oz",1] ["Tank",[CurrencyName,_coinsRepairTank]], // ["AllVehicles",[CurrencyName,_coinsRepairVehicles]] // 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 //_blockedWeaponNames=["S-5","Hydra","CRV7"]; // weapon names you wish to exclude from rearming. Leave empty [] to allow all _blockedWeaponNames=[]; // Weapon names you wish to exclude from rearming. Leave empty [] to allow all _blockedAmmoNames = []; _rearm_costs = [ ["Car",[CurrencyName,_coinsRearmVehicles]], ["Air",[CurrencyName,_coinsRearmAir]], // ["Tank",[CurrencyName,_coinsRearmTank]], // ["AllVehicles",[CurrencyName,_coinsRearmVehicles]] // 1 10oz Gold for all other vehicles ]; _rearm_magazineCount = 1; // amount of magazines to be added to the vehicle weapon // ----------------- CONFIG END ----------------- call compile preprocessFileLineNumbers (_folder + "ac_functions.sqf"); _lastVehicle = objNull; _lastRole = []; SP_refuel_action = -1; SP_repair_action = -1; SP_rearm_actions = []; _messageShown = false; _fnc_removeActions = { if (isNull _lastVehicle) exitWith {}; _lastVehicle removeAction SP_refuel_action; SP_refuel_action = -1; _lastVehicle removeAction SP_repair_action; SP_repair_action = -1; { _lastVehicle removeAction _x; } forEach SP_rearm_actions; SP_rearm_actions = []; _lastVehicle = objNull; _lastRole = []; }; _fnc_getCosts = { private ["_vehicle","_costs","_cost"]; _vehicle = _this select 0; _costs = _this select 1; _cost = []; { private "_typeName"; _typeName = _x select 0; if (_vehicle isKindOf _typeName) exitWith { _cost = _x select 1; }; } forEach _costs; _cost }; _fnc_actionTitle = { private ["_actionName","_costs","_costsText","_actionTitle"]; _actionName = _this select 0; _costs = _this select 1; _costsText = _costsFree; if (count _costs == 2) then { private ["_itemName","_itemCount","_displayName"]; _itemName = _costs select 0; _itemCount = _costs select 1; _displayName = _itemName; _costsText = format [_actionCostsFormat, _displayName, _itemCount]; }; _actionTitle = format [_actionTitleFormat, _actionName, _costsText]; _actionTitle }; _fnc_isArmed = { private ["_role","_armed"]; _role = _this; _armed = count _role > 1; _armed }; _fnc_getWeapons = { private ["_vehicle","_role","_weapons","_magazineNumber","_badAmmo","_badWeapon","_magazines","_weapon"]; _vehicle = _this select 0; _role = _this select 1; _weapons = []; if (count _role > 1) then { private ["_turret","_weaponsTurret"]; _turret = _role select 1; _weaponsTurret = _vehicle weaponsTurret _turret; { private "_weaponName"; _weaponName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); //_weapons set [count _weapons, [_x, _weaponName, _turret]]; // block ammo types _badWeapon = _weaponName in _blockedWeaponNames; if (!_badWeapon) then { _weapon = _x; // get all ammo types for this weapon _magazines = [_weapon] call _fnc_getMagazines; // loop through all ammo types and add them to our list { _badAmmo = _x in _blockedAmmoNames; // check to see if our ammo is prohibited if (!_badAmmo) then { // add one entry to weapons per ammo type. _weapons set [count _weapons, [_weapon, _weaponName, _turret, _x]]; }; } foreach _magazines; }; } forEach _weaponsTurret; } else { private ["_turret","_weaponsTurret","_badAmmo","_badWeapon","_magazines","_weapon"]; _turret = [-1]; _weaponsTurret = vehicle player weaponsTurret [-1]; { private "_weaponName"; _weaponName = getText (configFile >> "CfgWeapons" >> _x >> "displayName"); // block ammo types _badWeapon = _weaponName in _blockedWeaponNames; if (!_badWeapon) then { _weapon = _x; // get all ammo types for this weapon _magazines = [_weapon] call _fnc_getMagazines; // loop through all ammo types and add them to our list { // check to see if our ammo is prohibited _badAmmo = _x in _blockedAmmoNames; if (!_badAmmo) then { // add one entry to weapons per ammo type. _weapons set [count _weapons, [_weapon, _weaponName, _turret, _x]]; }; } foreach _magazines; }; } forEach _weaponsTurret; }; _weapons }; _fnc_getMagazines = { private ["_weaponType","_magazines","_mags"]; _magazines = []; _weaponType = _this select 0; _magazines = getArray (configFile >> "CfgWeapons" >> _weaponType >> "magazines"); _magazines //_ammo = _magazines select 0; // rearm with the first magazine }; while {true} do { private ["_vehicle","_inVehicle"]; _vehicle = vehicle player; _inVehicle = _vehicle != player; if (local _vehicle && _inVehicle) then { private ["_pos","_servicePoints","_inRange"]; _pos = getPosATL _vehicle; _servicePoints = (nearestObjects [_pos, _servicePointClasses, _maxDistance]) - [_vehicle]; _inRange = count _servicePoints > 0; if (_inRange) then { private ["_servicePoint","_role","_actionCondition","_costs","_actionTitle"]; _servicePoint = _servicePoints select 0; _role = assignedVehicleRole player; if (((str _role) != (str _lastRole)) || (_vehicle != _lastVehicle)) then { // vehicle or seat changed call _fnc_removeActions; }; _lastVehicle = _vehicle; _lastRole = _role; _actionCondition = "vehicle _this == _target && local _target"; if (SP_refuel_action < 0 && _refuel_enable) then { _costs = [_vehicle, _refuel_costs] call _fnc_getCosts; _actionTitle = ["Refuel", _costs] call _fnc_actionTitle; SP_refuel_action = _vehicle addAction [_actionTitle, _folder + "service_point_refuel.sqf", [_servicePoint, _costs, _refuel_updateInterval, _refuel_amount], -1, false, true, "", _actionCondition]; }; if (SP_repair_action < 0 && _repair_enable) then { _costs = [_vehicle, _repair_costs] call _fnc_getCosts; _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]; }; if (count SP_rearm_actions == 0 && _rearm_enable) then { private ["_weapons"]; _costs = [_vehicle, _rearm_costs] call _fnc_getCosts; _weapons = [_vehicle, _role] call _fnc_getWeapons; { private ["_weaponName","_magazineName"]; _weaponName = _x select 1; _magazineName = _x select 3; _actionTitle = [format["Rearm %1 - %2", _weaponName, _magazineName], _costs] call _fnc_actionTitle; SP_rearm_action = _vehicle addAction [_actionTitle, _folder + "service_point_rearm.sqf", [_servicePoint, _costs, _rearm_magazineCount, _x], -1, false, true, "", _actionCondition]; SP_rearm_actions set [count SP_rearm_actions, SP_rearm_action]; } forEach _weapons; }; if (!_messageShown && _message != "") then { _messageShown = true; _vehicle vehicleChat _message; }; } else { call _fnc_removeActions; _messageShown = false; }; } else { call _fnc_removeActions; _messageShown = false; }; sleep 2; }; If I have coin on me, it will refuel but not deduct any coin. See here for fix: Link to comment Share on other sites More sharing options...
Rocu Posted August 23, 2014 Report Share Posted August 23, 2014 I've done everything listed here, and I get no errors, but when I go to any of the fuel stations I don't get the scroll menu. I'm running on Chernarus overpoch. I've done everything as stated by Rocu and Kat as far as edits and fixes go, and I've double checked everything. I've also added in the dev functions. Did you follow the original Service Point tutorial first? If not, do that first, THEN replace it with Zupa's files. Here's the original: Link to comment Share on other sites More sharing options...
Pro_Speedy Posted August 25, 2014 Report Share Posted August 25, 2014 Struggling to get this working properly I am no no longer getting any messages or options. Could someone take a look and see what's wrong? http://pastebin.com/Q4aDksT6 Thank you Link to comment Share on other sites More sharing options...
drsubo Posted August 26, 2014 Report Share Posted August 26, 2014 same here I cant get this to work I have had original working fine and I just replace the the files on here with the old ones and nothing, then I do the fixes stated on the first page and I get the scroll options but nothing happens when I click on them? Can someone please drop me a link the their working files for this. I don't know what else to try. Thanks Link to comment Share on other sites More sharing options...
McPimpin Posted August 26, 2014 Report Share Posted August 26, 2014 Struggling to get this working properly I am no no longer getting any messages or options. Could someone take a look and see what's wrong? http://pastebin.com/Q4aDksT6 Thank you did you add the functions to the top of your compiles.sqf? I use souls custom hive.dll //Player only BIS_fnc_numberDigits = compile preprocessFileLineNumbers "custom\numberDigits.sqf"; BIS_fnc_numberText = compile preprocessFileLineNumbers "custom\numberText.sqf"; // usage // _removed = [player, 5000] call SC_fnc_removeCoins; // if(_removed = true)then{ GREAT SUCCES }else{ IT FAILED, not enoguh money}; SC_fnc_removeCoins= { private ["_player","_amount","_wealth","_newwealth", "_result"]; _player = _this select 0; _amount = _this select 1; _result = false; _wealth = _player getVariable["cashMoney",0]; if (_wealth < _amount) then { _result = false; } else { _newwealth = _wealth - _amount; _player setVariable["cashMoney",_newwealth, true]; _player setVariable ["moneychanged",1,true]; _result = true; PVDZE_plr_Save = [_player,(magazines _player),true,true] ; publicVariableServer "PVDZE_plr_Save"; }; _result }; // usage // _added = [player, 5000] call SC_fnc_addCoins; // if(_added = true)then{ GREAT SUCCES }else{ IT FAILED, Something went wrong}; SC_fnc_addCoins = { private ["_player","_amount","_wealth","_newwealth", "_result"]; _player = _this select 0; _amount = _this select 1; _result = false; _wealth = _player getVariable["cashMoney",0]; _player setVariable["cashMoney",_wealth + _amount, true]; PVDZE_plr_Save = [_player,(magazines _player),true,true] ; publicVariableServer "PVDZE_plr_Save"; _player setVariable ["moneychanged",1,true]; _newwealth = _player getVariable["cashMoney",0]; if (_newwealth >= _wealth) then { _result = true; }; _result }; Link to comment Share on other sites More sharing options...
ttkrickjames Posted August 28, 2014 Report Share Posted August 28, 2014 Hello, I am having trouble getting this to work correctly on our server. I cannot repair or rearm any vehicles if there is a cost for the action, but if i set the cost to 0 it works.What could be the problem? Here is my service_point.sqf : // refuel settings _refuel_enable = true; // enable or disable the refuel option _refuel_costs = [ ["AllVehicles",[CurrencyName,_coinsRefuelVehicles]], ["Air",[CurrencyName,_coinsRefuelAir]]]; // 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",[CurrencyName,_coinsRepairAir]], // 5 Gold for helicopters and planes ["AllVehicles",[CurrencyName,_coinsRepairVehicles]]]; // 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",[CurrencyName,_coinsRearmSUV]], // special costs for a single vehicle type ["Air",[CurrencyName,_coinsRearmAir]], // 2 10oz Gold for helicopters and planes ["AllVehicles",[CurrencyName,_coinsRearmVehicles]]]; // 1 10oz Gold for all other vehicles _rearm_magazineCount = 3; // amount of magazines to be added to the vehicle weapon Here is the add/remove coins code in my compiles.sqf from Zupa: // usage // _removed = [player, 5000] call SC_fnc_removeCoins; // if(_removed = true)then{ GREAT SUCCES }else{ IT FAILED, not enoguh money}; SC_fnc_removeCoins= { private ["_player","_amount","_wealth","_newwealth", "_result"]; _player = _this select 0; _amount = _this select 1; _result = false; _wealth = _player getVariable["headShots",0]; if (_wealth < _amount) then { _result = false; } else { _newwealth = _wealth - _amount; _player setVariable["headShots",_newwealth, true]; _player setVariable ["moneychanged",1,true]; _result = true; PVDZE_plr_Save = [_player,(magazines _player),true,true] ; publicVariableServer "PVDZE_plr_Save"; }; _result }; // usage // _added = [player, 5000] call SC_fnc_addCoins; // if(_added = true)then{ GREAT SUCCES }else{ IT FAILED, Something went wrong}; SC_fnc_addCoins = { private ["_player","_amount","_wealth","_newwealth", "_result"]; _player = _this select 0; _amount = _this select 1; _result = false; _wealth = _player getVariable["headShots",0]; _player setVariable["headShots",_wealth + _amount, true]; PVDZE_plr_Save = [_player,(magazines _player),true,true] ; publicVariableServer "PVDZE_plr_Save"; _player setVariable ["moneychanged",1,true]; _newwealth = _player getVariable["headShots",0]; if (_newwealth >= _wealth) then { _result = true; }; _result }; Thanks for any help I get and these great scripts. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now