adi8908456 Posted June 15, 2014 Share Posted June 15, 2014 Witam! Mam pewien problem ponieważ ostatnio dodawałem moonbeam na dayz i wszystko pięknie dodałem to co w tym linku: https://forum.multitheftauto.com/viewtopic.php?f=91&t=65555 do vehiclespawn, dodałem do VSC spawn dla niego czyli np /spawbmoonbeam i teraz mam problem poniewaz nie ma on na gorze ekranu "Fuel x/x" i gdy brakuje np silnika to nie można go wsadzić(jedynie itemy takie jak bandaż itp itd), juz kiedyś widziałem taki problem i ktos pisał ze zle sie to zrobiło. Moze wie ktoś jak go poprawnie wgrac? moje kody: Vehicle spawns gora skryptu moonSpawns = gameplayVariables.moonspawns vehicleAddonsInfo { 418, 4, 1, 1 }, Sam pojazd for i, veh in ipairs(moonSpawns) do local x, y, z = veh[1], veh[2], veh[3] veh = createVehicle(vehID, x, y, z) vehCol = createColSphere(x, y, z, 2.5) attachElements(vehCol, veh, 0, 0, 0) setElementData(vehCol, "parent", veh) setElementData(veh, "parent", vehCol) setElementData(vehCol, "vehicle", true) setElementData(vehCol, "MAX_Slots", 40) 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)) setElementData(vehCol, "spawn", { 418, x, y, z }) setElementData(vehCol, "fuel", 10) for i, items in ipairs(lootItems.helicrashsides) do local randomNumber = math.random(1, 10) if randomNumber == 5 then setElementData(vehCol, items[1], 1) end end end vehicleFuelInfo {418, 0.25}, VSC function SpawnDayZmoon(thePlayer) accountname = getAccountName(getPlayerAccount(thePlayer)) if isObjectInACLGroup("user." .. accountname, aclGetGroup("Admin")) then do local x, y, z = getElementPosition(thePlayer) veh = createVehicle(418, x + 5, y, z) vehCol = createColSphere(x + 5, y, z, 2.5) attachElements(vehCol, veh, 0, 0, 0) setElementData(vehCol, "parent", veh) setElementData(veh, "parent", vehCol) setElementData(vehCol, "vehicle", true) setElementData(vehCol, "MAX_Slots", 40) local tires, engine, parts = getVehicleAddonInfos(getElementModel(veh)) setElementData(vehCol, "Tire_inVehicle", 4) setElementData(vehCol, "Engine_inVehicle", 1) setElementData(vehCol, "Parts_inVehicle", 1) setElementData(vehCol, "spawn", { 418, x, y, z }) setElementData(vehCol, "fuel", 80) setTimer(outputChatBox, 50, 1, "#6002B1[VSC]#FFFFFF-Ragina has been spawned!", thePlayer, 171, 205, 239, true) end else outputChatBox("#6002B1[VSC]#FF0000-You are not a admin!", thePlayer, 171, 205, 239, true) end end addCommandHandler("/reginaown", SpawnDayZRegina) vehicleAddonsInfo = { { 418, 4, 1, 1 } } function getVehicleAddonInfos(id) for i, veh in ipairs(vehicleAddonsInfo) do if veh[1] == id then return veh[2], veh[3], veh[4] end end end vehicleFuelInfo = { {418, 0.25} } function getVehicleAddonInfos(id) for i, veh in ipairs(vehicleAddonsInfo) do if veh[1] == id then return veh[2], veh[3], veh[4] end end end vehicleFuelTable = { {418, 80} } function getVehicleMaxFuel(loot) local modelID = getElementModel(getElementData(loot, "parent")) for i, vehicle in ipairs(vehicleFuelTable) do if modelID == vehicle[1] then return vehicle[2] end end return false end function onPlayerEnterDayzVehicle(veh, seat) local col = getElementData(dayZVeh, "parent") local id = getElementModel(dayZVeh) if not seat == 1 then return end local tires, engine, parts = getVehicleAddonInfos(id) setVehicleEngineState(dayZVeh, false) setElementData(dayZVeh, "maxfuel", getVehicleMaxFuel(col)) setElementData(dayZVeh, "needtires", tires) setElementData(dayZVeh, "needengines", engine) setElementData(dayZVeh, "needparts", parts) if getElementData(col, "Tire_inVehicle") or 0 < tonumber(tires) then setVehicleEngineState(dayZVeh, false) return end if getElementData(col, "Engine_inVehicle") or 0 < tonumber(engine) then setVehicleEngineState(dayZVeh, false) return end if not getElementData(col, "Parts_inVehicle") then setElementData(col, "Parts_inVehicle", math.random(0, parts)) end if getElementData(col, "fuel") or 1 >= 0 and not getElementModel(dayZVehBob) == 509 then triggerClientEvent(source, "displayClientInfo", source, "Vehicle", "No tank left in this vehicle!", 22, 255, 0) setVehicleEngineState(dayZVehBob, false) return end end Link to comment
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