Jump to content
boxman80

Enabling different vehicles?

Recommended Posts

Hi, can anyone point me in the right direction for a guide or set of instructions as to what files I need to look at for changing/locking/unlocking vehilces on a private hive server?

Thanks in advance.

Share this post


Link to post
Share on other sites

I do know how to do in on a DayZ.st private hive, but i do not know where you have your hive. On DayZ.st you get a map where its just a right click to add and delete spawns on the map. If you want to add vehicles outside of what the server offers when you buy it, you need to go to the servers database and manually script it in (or thats the only way i know how to do it). As for the specific files it depends on the vehicles, and i am not 100% on how it works. Try google, im sure there are guides somewhere out there.

Edited by V2_Danny
  • Like 1

Share this post


Link to post
Share on other sites

3 tables are important for vehicle spawns :

1) "object_classes" table, this is the list with allowed vehicles to spawn(do not know if this is also the so called "dayz locked" vehicles), i do know that any vehicle you want to spawn in has to be in the classes table.

2) "object_spawns" table, this table hold ALL data to spawn a vehicle, this list has all spawnpoints of all vehicles. ( if you want to spawn 2 UH1, the "object_classes" needs to have an entry for a UH1, and the "object_spawn" needs to have 2 entries for a UH1, each with a different spawn location)

3) "object_data". this table are the actual spawned vehicles that will be read by the server and placed on the map in the server. This table is created true a script, each time the database is restarted it will check this list and if not available or changed it will respawn the vehicles again.

If you are using this private hive version : http://www.tunngle.n...pdated/ ,the script is a "procedure" inside the database, it is called "pmain"

And looks like this :

# maximum number of INSTANCE id's USED.

#-----------------------------------------------

DECLARE sInstance VARCHAR(8) DEFAULT 391;

#-----------------------------------------------

#maximum number of vehicles allowed !!! theoretical max. amount

#-----------------------------------------------

DECLARE iVehSpawnMax INT DEFAULT 100;

#-----------------------------------------------

# DECLARE iVehSpawnMin INT DEFAULT 0; #ToDo !!!

DECLARE iTimeoutMax INT DEFAULT 250; #number of loops before timeout

DECLARE iTimeout INT DEFAULT 0; #internal counter for loops done; used to prevent infinite loops - DO NOT CHANGE

DECLARE iNumVehExisting INT DEFAULT 0; #internal counter for already existing vehicles - DO NOT CHANGE

DECLARE iNumClassExisting INT DEFAULT 0; #internal counter for already existing class types - DO NOT CHANGE

DECLARE i INT DEFAULT 1; #internal counter for vehicles spawns - DO NOT CHANGE

#Starts Cleanup

CALL pCleanup();

SELECT COUNT(*) #retrieve the amount of already spawned vehicles...

INTO iNumVehExisting

FROM object_data

WHERE Instance = sInstance

AND Classname != '-' #exclude dummys

AND Classname != 'Hedgehog_DZ' #exclude hedgehog

AND Classname != 'Wire_cat1' #exclude wirecat

AND Classname != 'Sandbag1_DZ' #exclude Sanbag

AND Classname != 'TrapBear' #exclude trap

AND Classname != 'TentStorage'; #exclude TentStorage

WHILE (iNumVehExisting < iVehSpawnMax) DO #loop until maximum amount of vehicles is reached

#select a random vehicle class

SELECT Classname, Chance, MaxNum, Damage

INTO @rsClassname, @rsChance, @rsMaxNum, @rsDamage

FROM object_classes ORDER BY RAND() LIMIT 1;

#count number of same class already spawned

SELECT COUNT(*)

INTO iNumClassExisting

FROM object_data

WHERE Instance = sInstance

AND Classname = @rsClassname;

IF (iNumClassExisting < @rsMaxNum) THEN

IF (rndspawn(@rschance) = 1) THEN

INSERT INTO object_data (ObjectUID, Instance, Classname, Damage, CharacterID, Worldspace, Inventory, Hitpoints, Fuel, Datestamp)

SELECT ObjectUID, sInstance, Classname, RAND(@rsDamage), '0', Worldspace, Inventory, Hitpoints, RAND(1), SYSDATE()

FROM object_spawns

WHERE Classname = @rsClassname

AND NOT ObjectUID IN (select objectuid from object_data where instance = sInstance)

ORDER BY RAND()

LIMIT 0, 1;

SELECT COUNT(*)

INTO iNumVehExisting

FROM object_data

WHERE Instance = sInstance

AND Classname != '-' #exclude dummys

AND Classname != 'Hedgehog_DZ' #exclude hedgehog

AND Classname != 'Wire_cat1' #exclude wirecat

AND Classname != 'Sandbag1_DZ' #exclude Sanbag

AND Classname != 'TrapBear' #exclude trap

AND Classname != 'TentStorage'; #exclude TentStorage

#update number of same class already spawned

SELECT COUNT(*)

INTO iNumClassExisting

FROM object_data

WHERE Instance = sInstance

AND Classname = @rsClassname;

END IF;

END IF;

SET iTimeout = iTimeout + 1; #raise timeout counter

IF (iTimeout >= iTimeoutMax) THEN

SET iNumVehExisting = iVehSpawnMax;

END IF;

END WHILE;

SET i = i + 1;

Hope this helps you on the way.

PS: Locked stuff is done true the "dayz_anim.pbo" it is "hardcoded" in !!

Edited by Allie
  • Like 1

Share this post


Link to post
Share on other sites

3 tables are important for vehicle spawns :

1) "object_classes" table, this is the list with allowed vehicles to spawn(do not know if this is also the so called "dayz locked" vehicles), i do know that any vehicle you want to spawn in has to be in the classes table.

2) "object_spawns" table, this table hold ALL data to spawn a vehicle, this list has all spawnpoints of all vehicles. ( if you want to spawn 2 UH1, the "object_classes" needs to have an entry for a UH1, and the "object_spawn" needs to have 2 entries for a UH1, each with a different spawn location)

3) "object_data". this table are the actual spawned vehicles that will be read by the server and placed on the map in the server. This table is created true a script, each time the database is restarted it will check this list and if not available or changed it will respawn the vehicles again.

If you are using this private hive version : http://www.tunngle.n...pdated/ ,the script is a "procedure" inside the database, it is called "pmain"

And looks like this :

Hope this helps you on the way.

Thanks man, much appreciated.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×