So, my friend of mine created some thing, that it respawns vehicle's and it removes them.. It did worked for 2 months, i did nothing and it stopped working..
In vehicle_spawns.lua >
--spawnDayZVehicles()
function spawnVehiclePack(ps, cmd)
if getElementData(ps, "Admin") then
spawnDayZVehicles()
outputChatBox("[MTD] Masinas tika nospawnotas.", ps, 255, 0, 0, true)
for i,items in ipairs(lootItems["helicrashsides"]) do
local randomNumber = math.random(1,10)
if randomNumber == 5 then
setElementData(vehCol,items[1],math.random(1,2))
end
end
elseif id == 470 then
for i,items in ipairs(lootItems["helicrashsides"]) do
local randomNumber = math.random(1,10)
if randomNumber == 5 then
setElementData(vehCol,items[1],math.random(1,2))
end
end
end
end
This is the script, but it does not work anymore. It simply's respawns and removes the cars from server using command /sveh and /rveh.
What is wrong?
btw, i did actually use f6vehiclepanel, i spawned some cars and drived with them, in this result, that can fu** up the database of spawning cars of some shi**? Can you help me guys please? Vehicles doesnt apear and respawn anymore.
Question
bundiiE
So, my friend of mine created some thing, that it respawns vehicle's and it removes them.. It did worked for 2 months, i did nothing and it stopped working..
In vehicle_spawns.lua >
--spawnDayZVehicles()
function spawnVehiclePack(ps, cmd)
if getElementData(ps, "Admin") then
spawnDayZVehicles()
outputChatBox("[MTD] Masinas tika nospawnotas.", ps, 255, 0, 0, true)
end
end
addCommandHandler("sveh", spawnVehiclePack)
function destroyVehiclePack(ps, cmd)
if getElementData(ps, "Admin") then
vehicles = getElementsByType("vehicle")
for i,v in ipairs(vehicles) do
local col = getElementData(v, "parent")
destroyElement(col)
destroyElement(v)
end
end
end
addCommandHandler("rveh", destroyVehiclePack)
function notifyAboutExplosion()
local col = getElementData(source,"parent")
local x1,y1,z1 = getElementPosition(source)
id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4]
setTimer(respawnDayZVehicle,1800000,1,id,x,y,z,source,col,getElementData(col,"MAX_Slots"))
setElementData(col,"deadVehicle",true)
setElementData(source,"isExploded",true)
createExplosion (x1+4,y1+1,z1,4)
createExplosion (x1+2,y1-4,z1,4)
createExplosion (x1-1,y1+5,z1,4)
createExplosion (x1-4,y1,z1-2,4)
end
addEventHandler("onVehicleExplode", getRootElement(), notifyAboutExplosion)
function respawnVehiclesInWater (vehiclesInWater)
for i,veh in ipairs(vehiclesInWater) do
if getElementModel(veh) == 473 then break end
local col = getElementData(veh,"parent")
id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4]
respawnDayZVehicle(id,x,y,z,veh,col,getElementData(col,"MAX_Slots"))
end
end
addEvent("respawnVehiclesInWater",true)
addEventHandler("respawnVehiclesInWater",getRootElement(),respawnVehiclesInWater)
function checkVehicleInWater ()
local randomPlayer = getRandomPlayer()
triggerClientEvent("checkVehicleInWaterClient",randomPlayer)
end
setTimer(checkVehicleInWater,1800000,0)
--1800000
function respawnDayZVehicle(id,x,y,z,veh,col,max_slots)
if id == 497 then
local item_id = math.random(table.size(hunterSpawns))
x,y,z = hunterSpawns[item_id][1],hunterSpawns[item_id][2],hunterSpawns[item_id][3]
end
if id == 487 then
local item_id = math.random(table.size(maverikSpawns))
x,y,z = maverikSpawns[item_id][1],maverikSpawns[item_id][2],maverikSpawns[item_id][3]
end
destroyElement(veh)
destroyElement(col)
veh = createVehicle(id,x,y,z+1)
vehCol = createColSphere(x,y,z,4)
attachElements ( vehCol, veh, 0, 0, 0 )
setElementData(vehCol,"parent",veh)
setElementData(veh,"parent",vehCol)
setElementData(vehCol,"vehicle",true)
setElementData(vehCol,"MAX_Slots",max_slots)
--Engine + Tires
local tires,engine = getVehicleAddonInfos (getElementModel(veh))
setElementData(vehCol,"Tire_inVehicle",math.random(0,tires))
setElementData(vehCol,"Engine_inVehicle",math.random(0,engine))
--vehicle_indentifikation
setElementData(vehCol,"spawn",{id,x,y,z})
--others
setElementData(vehCol,"fuel",10)
if id == 433 then
for i,items in ipairs(lootItems["helicrashsides"]) do
local randomNumber = math.random(1,10)
if randomNumber == 5 then
setElementData(vehCol,items[1],math.random(1,2))
end
end
elseif id == 470 then
for i,items in ipairs(lootItems["helicrashsides"]) do
local randomNumber = math.random(1,10)
if randomNumber == 5 then
setElementData(vehCol,items[1],math.random(1,2))
end
end
end
end
This is the script, but it does not work anymore. It simply's respawns and removes the cars from server using command /sveh and /rveh.
What is wrong?
btw, i did actually use f6vehiclepanel, i spawned some cars and drived with them, in this result, that can fu** up the database of spawning cars of some shi**? Can you help me guys please? Vehicles doesnt apear and respawn anymore.
Link to comment
1 answer to this question
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