Jump to content
Axe Cop

Elevator Script for Players and Vehicles [WIP/Prototype]

Recommended Posts

Hi, nice script & work like a charm but i have error in my rpt at start:

 

z\addons\dayz_epoch\models\metal_floor_ghost.p3d: No geometry and no visual shape

 

any idea ? :)

just ignore it, nothing to worry.. but I never got a message like that :D

Share this post


Link to post
Share on other sites

Why couldn't this script use the Fuel variable instead? Or at least the Inventory column? I'm just thinking the Fuel column would be a better spot, since building objects don't use that field at all. Couldn't we edit a file some where to exclude the Metal floor and its _Preview from having the fuel column reset to 0? I would imagine there would be some way to accomplish this. I don't really understand how the HiveWrite/Read files function as to requiring some mods to need to modify the .dll's, so maybe using Fuel would need that, and if so not really a plausible change. But, if we could "simply" change the epoch scripts to not change the fuel field for certain object types, when fuel is > 6976, then, I could again use Take Ownership again from the plot pole, instead of changing it to my ID and ruining my elevator.

 

I guess editing the take ownership to not take ownership of items with ID > 69759999, would do the trick in that case, but, using an independent field would be better I think. This would also allow for secure options. It could then use the CharacterID field to check ownership/friendly status of owner before giving access to operate it.

Share this post


Link to post
Share on other sites

@bualdoot actually that is not a bad idea, but I have no idea if you can manipulate the fuel column that easily on buildings, it might not work.

With a custom HiveExt.dll you would have all the freedom you need and can save whatever you like obviously, but for this script I wanted to keep it simple as I know there are many complications with a custom DLL, also many admins don't have that much experience, I use a custom DLL for one of my other scripts and get many questions about it and people don't know how to use it etc.. you know :)

Share this post


Link to post
Share on other sites

Should be pretty easy.

 

For fuel, call update_object.sqf -> update position to save the objects fuel (via a PV).  Amend Server_monitor.sqf to read data from the fuel field on object load and if the object is of a particular class.  Just make sure the DB field is the correct Type for the data that needs to be stored.

 

I did the same in A Plot for Life when saving the owners PlayerUID in the worldpace field of the buildable objects.

 

Feel free to take a look at the code if it would be of any help.

Share this post


Link to post
Share on other sites

@bualdoot actually that is not a bad idea, but I have no idea if you can manipulate the fuel column that easily on buildings, it might not work.

With a custom HiveExt.dll you would have all the freedom you need and can save whatever you like obviously, but for this script I wanted to keep it simple as I know there are many complications with a custom DLL, also many admins don't have that much experience, I use a custom DLL for one of my other scripts and get many questions about it and people don't know how to use it etc.. you know :)

 

Ah. Ya, I'm not really sure either. The DLL thing is why i opted for ZUPA's SC 3.0, instead of souls 2.0, or the others. I guess I'll have to fiddle around with it and find out.

 

Should be pretty easy.

 

For fuel, call update_object.sqf -> update position to save the objects fuel (via a PV).  Amend Server_monitor.sqf to read data from the fuel field on object load and if the object is of a particular class.  Just make sure the DB field is the correct Type for the data that needs to be stored.

 

I did the same in A Plot for Life when saving the owners PlayerUID in the worldpace field of the buildable objects.

 

Feel free to take a look at the code if it would be of any help.

 

Sounds simple enough :) I use your P4L 2.34, and really like that it uses the inventory field. Some times I worry that having P4L, doormanagement, plot management, and I'm sure some others all on my server right now, using the inventory field, is going to cause the field to be over the length limit or something and cause problems ( I actually do have an issue occasionally with worldspace data too long, for metal floors (maybe others) at the moment). Which is why I'm hoping we can use the fuel field, or maybe the hitpoints fields or something (with the stock dll files). I'll definitely take some more looks at your files.

 

So, I'll try your suggestion for file edits and see what I can do. I'm not as experience in arma scripting as you guys are, but, hopefully I can make it work.

Share this post


Link to post
Share on other sites

don´t work for me. My Client .rpt says :

 

if ([_ct] call ELE_fnc_isElevatorStop) then {
if (s_pla>
  Error position: <ELE_fnc_isElevatorStop) then {
if (s_pla>
 Error Undefined variable in expression: ele_fnc_iselevatorstop
File mpmissions\__CUR_MP.Chernarus\Scripts\elevator\elevator_init.sqf, line 61
Error in expression <t], 0, false];
 
and
 
if ([_ct] call ELE_fnc_isElevator) then {
if (s_player_>
  Error position: <ELE_fnc_isElevator) then {
if (s_player_>
 Error Undefined variable in expression: ele_fnc_iselevator
File mpmissions\__CUR_MP.Chernarus\Scripts\elevator\elevator_init.sqf, line 41
Error in expression <t], 0, false];
 
 
aaaand
 
 
Error Undefined variable in expression: _this
File mpmissions\__CUR_MP.Chernarus\Scripts\elevator\elevator_init.sqf, line 6

Share this post


Link to post
Share on other sites

 

don´t work for me. My Client .rpt says :

 

if ([_ct] call ELE_fnc_isElevatorStop) then {
if (s_pla>
  Error position: <ELE_fnc_isElevatorStop) then {
if (s_pla>
 Error Undefined variable in expression: ele_fnc_iselevatorstop
File mpmissions\__CUR_MP.Chernarus\Scripts\elevator\elevator_init.sqf, line 61
Error in expression <t], 0, false];
 
and
 
if ([_ct] call ELE_fnc_isElevator) then {
if (s_player_>
  Error position: <ELE_fnc_isElevator) then {
if (s_player_>
 Error Undefined variable in expression: ele_fnc_iselevator
File mpmissions\__CUR_MP.Chernarus\Scripts\elevator\elevator_init.sqf, line 41
Error in expression <t], 0, false];
 
 
aaaand
 
 
Error Undefined variable in expression: _this
File mpmissions\__CUR_MP.Chernarus\Scripts\elevator\elevator_init.sqf, line 6

 

 

Then, I am sorry to report, either you have installed it incorrectly or it is conflicting with other mods you have installed. I had to add these to my variables to stop some client spam and the elevator install now works exactly as it was intended.

	s_player_elevator_next = -1;
	s_player_elevator_previous = -1;
	s_player_elevator_select = -1;
	s_player_elevator_upgrade = -1;
	s_player_elevator_upgrade_stop = -1;
	s_player_elevator_call = -1;
	s_player_elevator_id = -1;

Share this post


Link to post
Share on other sites

Another thing that should be mentioned in the OP: You need to add MetalFloor_Preview_DZ to DZE_maintainClasses in variables.sqf or else it won't get maintained. Add to the bottom of your custom variables.sqf:

DZE_maintainClasses set [count DZE_maintainClasses,"MetalFloor_Preview_DZ"];

Share this post


Link to post
Share on other sites

@AxeCop

 

The data is saved in the gear field of the object.

 

Plotfiends in gear for plotpoles, DoorFriends in gear for doors, Elevatorfriend in gear of Metal panels! ^^

 

AND P4L and vectors saves data tot the worldspace 

@Zupa

Could you do a 'lockable' and/or steam ID whitelisted version of this please?

Share this post


Link to post
Share on other sites

Whenever i upgrade the metal floor to "Elevator Stop" it just disappears, and yes ive installed the mod over 5 times like uninstall the go again step by step 5 times still doenst work. Also yes i did add the

"MetalFloor_Preview_DZ"

 to dayz_allowedobjects.

Share this post


Link to post
Share on other sites

Hey guy!

But there is no variable declaration _stop in the file elevator_functions.sqf. I do not have a problem and vanishing point of stopping here?

UPDATED: I downloaded from het latest version and it works. Although the version has not changed))

Share this post


Link to post
Share on other sites

Hi!

Plz help with my error

Error in expression <earObjects [ELE_StopClass, _maxRange]);
_stop
};
 
 
 
ELE_fnc_hasNextStop = {
priv>
  Error position: <_stop
};
 
 
 
ELE_fnc_hasNextStop = {
priv>
  Error Undefined variable in expression: _stop
File mpmissions\__CUR_MP.chernarus\scripts\elevator\elevator_functions.sqf, line 101
"ELE_fnc_getNextStop next stop id -1 is out of range"

 

Share this post


Link to post
Share on other sites

Hello, i added this script and it is awesome, one of the best scripts i have added. But the only issue is that players cannot remove there base built objects. Any ideas?

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • By nova
      Hello. I was wondering if there was a way for when players take down their own wall or door for the item to go back into their inventory instead of it being deleted. 
    • By totis
      Hi
      This is a restriction to vehicle seat according to humanity.
      It may be handy to PVE servers out there.
      Special thanks to Juandayz with his fantastic skills and salival. Both sometimes working unseen for the benefit of this community.
      Step 1.
      Make a new file, Name it veh_hum.sqf with the below contents and put into dayz_epoch/addons folder. If you dont have addons just create one.
      In this example we have a hero superhero and agenthero traders with 20k/40k/60k humanity respectively. Adjust according to your needs.
       
      private ["_vehicle","_inVehicle","_driver","_humanity","_txt"]; while {true} do { _vehicle = vehicle player; _inVehicle = (_vehicle != player); if (_inVehicle) then { _driver = driver (vehicle player); if (({(isPlayer _driver) && (alive _driver)} count (crew _vehicle) > 0)) then { _humanity = _driver getVariable["humanity",0]; if (typeOf _vehicle in DZE_heroHumanity && _humanity <= 20000 || (typeOf _vehicle in DZE_superHeroHumanity && _humanity <= 40000) || (typeOf _vehicle in DZE_agentHumanity && _humanity <= 60000)) then { player action ["getOut", (vehicle player)]; titleText ["","WHITE IN"]; _txt = "<img image='addons\vehicon.paa' /><br/><t size='0.7' color='#ea2828' align='center'>prohibited vehicle</t>"; [_txt, [safezoneX, safezoneW], [0.20 * safezoneH + safezoneY, 0.3 * safezoneH], 2, 0.5] spawn BIS_fnc_dynamicText; }; }; }; sleep 3; };  Step 2: Download this file http://www.mediafire.com/file/bdpt5d96o5cttk3/vehicon.rar
      Unzip and put paa file into addons folder.
      Step 3: Edit your custom variables file    dayz_code/init/variables.sqf
      Put the vehicles you want to restrict below call dayz_resetselfactions; ike this:
      // Custom below s_givemoney_dialog = -1; s_bank_dialog = -1; s_player_checkWallet = -1; s_bank_dialog1 = -1; s_bank_dialog2 = -1; s_player_copyToKey = -1; s_player_claimVehicle = -1; s_collect_heli = -1; }; call dayz_resetSelfActions; DZE_heroHumanity = ["Mi17_rockets_RU","Mi24_D","UH1Y_DZE"]; DZE_superHeroHumanity = ["Mi24_V","Mi24_P","Ka52"]; DZE_agentHumanity = ["AV8B2","AV8B","A10","F35B"]; DZE_safeVehicle = DZE_heroHumanity + DZE_superHeroHumanity + DZE_agentHumanity +["ParachuteWest","ParachuteC"]; Step 4: Edit your init file to exec the script. Above the   (false,12)execVm.... like below
          [] execVM "addons\veh_hum.sqf";
          //[false,12] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";
      Thats it. Enjoy!
        Hide contents
    • By Zoranth
      Based on Hacked Vehicles release by @Bricktop and Additional code by @Hooty from here:
      This is my first release
      This mod and code is not all my original work. 
      Credits to: 
      @Bricktop for the "Hacked Vehicles" https://epochmod.com/forum/topic/43750-hacked-vehicles-1061/
      @Hooty for his input in Bricktop's release on how to install it differently and to add support for Virtual Garage.
      What I did is took their information and made it modular and easier to install / customize. This way, you just need to #include which weapon systems you want to add into each vehicle that you want to modify.
      >> DOWNLOAD HERE <<  CURRENTLY ON HOLD DUE TO UNFORESEEN ERROR
      Install Directions:
      1.    Copy the Vehicle_Weapons directory into the root of your dayz_server directory
      2.    Next paste
      #include "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf";    in dayz_server\system\sever_monitor.sqf under
      3.    Then paste
      #include "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf";  in dayz_server\compile\server_publishVehicle2.sqf under
      4.    Then paste
      #include "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf";   in dayz_server\compile\spawn_vehicles.sqf under
      Installation with Virtual Garage:
      If you have @salival's Virtual Garage installed then add :
      #include "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf";   to dayz_server\compile\garage\server_spawnVehicles.sqf under
      How To Customize:
      If you would like to create your very own weapons pack for a vehicle, use the following instructions:
      1. Make a copy of "\z\addons\dayz_server\Vehicle_Weapons\vehicles\Generic_Add_Weapon.sqf" rename it like "<vehicle_classname>_Add_Weapons.sqf". Replace the <vehicle_classname> with the actual classname of the vehicle you want to add weapons to.
      2. Comment out or Delete the Weapon_Systems that you do not want to use on your new vehicle.
      3. Make a new #include "\z\addons\dayz_server\Vehicle_Weapons\vehicles\<Class_Name>_Add_Weapons.sqf"; line with your new vehicle file and add it to "\z\addons\dayz_server\Vehicle_Weapons\Add_Vehicle_Weapons.sqf";
      4. In the new vehicle file you just made.  Rearrange the Weapon_Systems in an order that makes sense to you. For example, list all guns, then all missiles so they are grouped together in your scroll menu for easier selection.
      Adding / Restricting an Ammo Type
      For Weapon_Systems that have multiple ammo types, You can go into that specific file and comment out an ammo type or make an extra file with just the ammo you want if you want to restrict it from your server. Example:
      In the file: "\z\addons\dayz_server\Vehicle_Weapons\Vehicles\Weapon_Systems\D81_125mm_Cannon.sqf". You could comment out an Ammo Type as shown Below.
      If you do this, you will want to save that as a new file such as : "D81_125mm_Cannon_SABOT_ONLY.sqf.
      List of Vehicle Weapons and Ammo:
      WARNING: Not all Weapon Systems work with all vehicles. For example, You obviously do not want to put a "GBU12_Bomb_Launcher" on an "ArmoredSUV_PMC", or "MLRS Rocket System" on the "ArmoredSUV_PMC".
      These weapons spawn on the vehicle when purchased and remain after restart.  This does not work with admin spawned vehicles nor does it work (for now) with the Deploy Anything Mod.  I do not have Virtual Garage installed on my test server,so I am unable to test that but it should work.
      Have Fun
    • By leegreaves
      Im putting up my script for a makeover of the NEAF. I did release this before back with 1.0.5.1. Since 1.0.6.1 has come out I decided to retest to see if it would still be fine , which it is. So im reposting it for anyone who might want to make use of it.
      Just put the following in a new file called NEAF.sqf (or whatever you want to call it and create a new folder called "buildings" (if you dont already have a folder called that) in the root directory of your server pbo.
      In your server_functions.sqf file in your init folder add the following to the bottom:
      call compile preProcessFileLineNumbers "\z\addons\dayz_server\buildings\NEAF.sqf";
      I do ask that the credits ARE left in this file and that no other person claims credit for this version of a better North East Airfield.
      NEAF.sqf:
       
      Link to original post which includes images of NEAF:
       
  • Advertisement
  • Donation Box

    Please donate to support the community.
    We appreciate all donations!
  • Advertisement
  • Supporters
  • Latest Donations

  • Advertisement
  • Discord

×