Jump to content

Vehicle Spawns


Callum1243

Recommended Posts

Posted

There is non, it is just that they do not load into the server, every default one does, not the custom ones...

I need to add the maverick/seasparrow onto the server at some coords...

  • Moderators
Posted

Or you can show us what you added and where to spawn that maverick ?

Because saying "hey I added something to spawn a maverick somewhere" but not showing us what you did is not really helpfull for us.

Posted

Under editor_server.lua:

-- MAVERICK 
gameplayVariables["maverickspawns"] =  
{ 
{-1495.888671875,-2691.40234375,57.325229644775}, 
{-2688.42578125,1471.634765625,7.1875}, 
{-1534.28125,2842.9482421875,97.463409423828}, 
{2221.8583984375,-1344.396484375,23.984273910522}, 
{1474.5999755859,-1346.5999755859,164.0000}, -- The one I added and not spawning. 
} 

-- SEASPARROW 
gameplayVariables["seasparrowspawns"] =  
{ 
{-2191.6999511719,675.79998779297,69.900001525879}, 
} 

Under vehicle_spawns.lua:

  
seasparrowSpawns = gameplayVariables["seasparrowspawns"] -- What I made to follow the structure 

  
maverikSpawns = gameplayVariables["maverickspawns"] 

  
vehicleAddonsInfo = { 
{422,4,1}, 
{470,4,1}, 
{468,2,1}, 
{433,6,1}, 
{437,6,1}, 
{509,0,0}, 
{487,0,1}, 
{497,0,1}, 
{453,0,1}, 
{447,0,1}, -- I added this as it is the seasparrow id = 447 but I do not understand the structore of 0, 0 etc... 
} 

in vehicle_spawns.lua - Under = function spawnDayZVehicles() what I made by following the table structure

  
    for i,veh in ipairs(seasparrowSpawns) do 
            local x,y,z = veh[1],veh[2],veh[3] 
            veh = createVehicle(447,x,y,z) 
            vehCol = createColSphere(x,y,z,1.5) 
            attachElements ( vehCol, veh, 0, 0, 0 ) 
            setElementData(vehCol,"parent",veh) 
            setElementData(veh,"parent",vehCol) 
            setElementData(vehCol,"vehicle",true) 
            setElementData(vehCol,"MAX_Slots",30) 
            --Engine + Tires 
            local tires,engine,parts = getVehicleAddonInfos (getElementModel(veh)) 
            setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) 
            setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) 
            setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) 
            --vehicle_indentification 
            setElementData(vehCol,"spawn",{447,x,y,z}) 
            --others 
            setElementData(vehCol,"fuel",10) 
        end 
  

P.S - I am beginning on scripting LUA so this may be easy for you but complicated for me but we all have to learn. :D

Posted
Under editor_server.lua:

-- MAVERICK 
gameplayVariables["maverickspawns"] =  
{ 
{-1495.888671875,-2691.40234375,57.325229644775}, 
{-2688.42578125,1471.634765625,7.1875}, 
{-1534.28125,2842.9482421875,97.463409423828}, 
{2221.8583984375,-1344.396484375,23.984273910522}, 
{1474.5999755859,-1346.5999755859,164.0000}, -- The one I added and not spawning. 
} 

-- SEASPARROW 
gameplayVariables["seasparrowspawns"] =  
{ 
{-2191.6999511719,675.79998779297,69.900001525879}, 
} 

Under vehicle_spawns.lua:

  
seasparrowSpawns = gameplayVariables["seasparrowspawns"] -- What I made to follow the structure 

  
maverikSpawns = gameplayVariables["maverickspawns"] 

  
vehicleAddonsInfo = { 
{422,4,1}, 
{470,4,1}, 
{468,2,1}, 
{433,6,1}, 
{437,6,1}, 
{509,0,0}, 
{487,0,1}, 
{497,0,1}, 
{453,0,1}, 
{447,0,1}, -- I added this as it is the seasparrow id = 447 but I do not understand the structore of 0, 0 etc... 
} 

in vehicle_spawns.lua - Under = function spawnDayZVehicles() what I made by following the table structure

  
    for i,veh in ipairs(seasparrowSpawns) do 
            local x,y,z = veh[1],veh[2],veh[3] 
            veh = createVehicle(447,x,y,z) 
            vehCol = createColSphere(x,y,z,1.5) 
            attachElements ( vehCol, veh, 0, 0, 0 ) 
            setElementData(vehCol,"parent",veh) 
            setElementData(veh,"parent",vehCol) 
            setElementData(vehCol,"vehicle",true) 
            setElementData(vehCol,"MAX_Slots",30) 
            --Engine + Tires 
            local tires,engine,parts = getVehicleAddonInfos (getElementModel(veh)) 
            setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) 
            setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) 
            setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) 
            --vehicle_indentification 
            setElementData(vehCol,"spawn",{447,x,y,z}) 
            --others 
            setElementData(vehCol,"fuel",10) 
        end 
  

P.S - I am beginning on scripting LUA so this may be easy for you but complicated for me but we all have to learn. :D

i cant under stand u post full code with name upper of so i understand u

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...