Jump to content
  • 0

How to spawn vehicles and items for players?


JohnyMST

Question

Hello.

I am trying to set up a test server and want to spawn some stuff for myself to play around for a bit.

can you explain how I can spawn for example an URAL with cinder blocks & Mortar in it in a desired location? Lets say balota.

 

I am using Vilayer host and I am new to this. Any help would be great.

Thanks a lot!

Link to comment
Share on other sites

15 answers to this question

Recommended Posts

  • 0

There are 2 ways u can do this:

1. create a new database entry so the vehicle gets properly stored and handled by dayz and will remain in the server after a restart etc., but u need a server restart after u add the vehicle to load it into the world.

2. spawn the vehicle in front of u, it will only remain until the next restart and obviously the gear will be lost after the restart, but to test something that might be easier for u,

 

for the 2. option i suggest some DayZ admin tools like the ones from blue phoenix: https://github.com/BluePhoenix175/DayZ-Admin-Tools-

just follow the instructions to install it, there is a file "/admintools/Vehicles/Ural.sqf" where u can add stuff to the vehicle gear when it spawns.

 

for items its similar but u wont need a server restart for the 1. option (just a relog of the player).

Link to comment
Share on other sites

  • 0

There are 2 ways u can do this:

1. create a new database entry so the vehicle gets properly stored and handled by dayz and will remain in the server after a restart etc., but u need a server restart after u add the vehicle to load it into the world.

2. spawn the vehicle in front of u, it will only remain until the next restart and obviously the gear will be lost after the restart, but to test something that might be easier for u,

 

for the 2. option i suggest some DayZ admin tools like the ones from blue phoenix: https://github.com/BluePhoenix175/DayZ-Admin-Tools-

just follow the instructions to install it, there is a file "/admintools/Vehicles/Ural.sqf" where u can add stuff to the vehicle gear when it spawns.

 

for items its similar but u wont need a server restart for the 1. option (just a relog of the player).

 

do these work with 1.0.2.5? does anyone know?

Link to comment
Share on other sites

  • 0

Sure it does work, why not? These are just some scripts they have to reinvent ArmA mods to disable scripts like this completely so you can use it for Epoch or whatever ArmA 2 mod you like actually.

What I am saying the Epoch version may add some hacker restrictions but as server admin you can always change that if you want.. (but nothing new in 1.0.2.5 for that matter so the same works) . :)

Link to comment
Share on other sites

  • 0

Hello.

I am trying to set up a test server and want to spawn some stuff for myself to play around for a bit.

can you explain how I can spawn for example an URAL with cinder blocks & Mortar in it in a desired location? Lets say balota.

 

I am using Vilayer host and I am new to this. Any help would be great.

Thanks a lot!

 

where to find class names for building supplies?

Link to comment
Share on other sites

  • 0

Would you know the code to add items to vehicles when you spawn it in with the admin tools. I have tried all kinds and cant get anything to spawn in the vehicle. What I don't understand is some of the vehicles in admin tools come with gear but there is nothing about it in the code for the vehicle and its not normal stuff mil off road

spawns with 15 akm mags and 2 hand grenades.

Link to comment
Share on other sites

  • 0

Would you know the code to add items to vehicles when you spawn it in with the admin tools. I have tried all kinds and cant get anything to spawn in the vehicle. What I don't understand is some of the vehicles in admin tools come with gear but there is nothing about it in the code for the vehicle and its not normal stuff mil off road

spawns with 15 akm mags and 2 hand grenades.

 

If you spawn a car with admin tools, sometimes you spawn one that has "preset" or "default" gear, like I once had a crate that always spawned with 50 PKP mags. You can solve it with these commands:

clearWeaponCargoGlobal _crate3;
clearMagazineCargoGlobal _crate3;

be sure to change _crate3 to the name the object is called, I think it could be _spawn in the case for admin tools.

 

Adding items is the following command then:

_crate3 addWeaponCargoGlobal ["M240", 1];

_crate3 addBackpackCargoGlobal ["DZ_LargeGunBag_EP1", 1];

Again, change the _crate3 to how you refer to the created object.

 

Good luck!

Link to comment
Share on other sites

  • 0
_spawn = "MTVR";
_posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
_dirplr = getDir player;
_spwnveh = _spawn createVehicle (_posplr);
_spwnveh setVariable ["Sarge",1,true];
 
 
This is the code i have tried _spawn  _MTVR  still nothing.
Link to comment
Share on other sites

  • 0
_spawn = "MTVR";
_posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0];
_dirplr = getDir player;
_spwnveh = _spawn createVehicle (_posplr);
_spwnveh setVariable ["Sarge",1,true];
clearWeaponCargoGlobal _spwnveh;
clearMagazineCargoGlobal _spwnveh;

because it is "_spwnveh", not that hard to see in that easy code.. :D

Link to comment
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
  • Discord

×
×
  • Create New...