Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.


Wysłany: 2020-03-16, 01:42


Matikmontana

Modern Stories






Wiek: 17
Na forum: 551 dni
Posty: 278
Nick w MP: Mazeusz*

Piwa: 384

Respekt: 70


Ostrzeżeń: 60%
Dobry, chciałbym zrobić auta frakcyjne w interiorze ale gdy załaduje skrypt to auta są niewidoczne --> https://imgur.com/undefined

Jakich funkcji użyć żeby było je widać ?

addCommandHandler("samc-restarcikser", function(player, cmd)

if getElementData(player, "player:duty") == "SAMC" then
restartResource(getThisResource())
end
end)

local szkolenia = {
{1261.33, -7.82, 1000.80, 359.7, 0.0, 178.9},
{1261.07, -21.53, 1000.80, 359.7, 0.0, 178.9},
}

local karetki_2 = {
{1288.51, -6.85, 1000.79, 359.7, 0.2, 181.7},
{1288.95, -21.45, 1000.79, 359.7, 0.2, 181.7},
}

local karetki = {
{1298.93, -34.62, 1000.79, 359.7, 0.2, 181.7},
{1298.67, -21.29, 1000.79, 359.7, 0.2, 181.7},
{1298.11, -6.31, 1000.80, 359.7, 0.0, 180.0},
}

local helikopter = {
--{-2632.67, 593.42, 66.49, 2.3, 358.1, 182.8},
--{-2646.45, 594.55, 66.29, 0.2, 359.7, 176.6},
-- {-2656.82, 595.04, 66.29, 0.2, 359.7, 176.6},
--{-2669.68, 596.79, 66.29, 0.2, 359.7, 176.6},
--{-2686.54, 597.01, 66.29, 0.2, 359.7, 176.6},

}

local karawany = {
{-2545.12, 658.03, 14.19, 0.0, 0.0, 90},

}

local admiral = {
{1279.65, -35.43, 1000.79, 359.7, 0.0, 180.3},
{1279.57, -21.12, 1000.79, 359.7, 0.0, 180.3},
{1279.49, -7.57, 1000.79, 359.7, 0.0, 180.3},

}

local sultany = {
{1270.49, -7.43, 1000.80, 359.8, 360.0, 180.1, 560},
{1270.58, -21.21, 1000.80, 359.7, 360.0, 180.9, 560},

}

local fbirancher = {
{1253.43, -60.81, 1002.27, 359.8, 360.0, 270.6, 490},
{1251.63, -55.60, 1002.27, 359.8, 0.0, 268.8, 490},

}

local rancher = {
{1251.57, -66.82, 1002.27, 359.7, 0.1, 270.0, 489},

}

local premiery = {
{1302.32, -66.20, 1002.27, 359.9, 360.0, 51.2},
{1295.67, -66.51, 1002.27, 359.8, 360.0, 51.2},
{1287.35, -66.23, 1002.27, 359.8, 360.0, 51.2},
{1278.61, -65.89, 1002.27, 359.8, 360.0, 51.2},

}

--[[for i,v in pairs(szkolenia) do
local vehicle=createVehicle(431, v[1], v[2], v[3])
setVehicleColor(vehicle,255, 255, 0,255,0,0)
setElementRotation(vehicle, v[4], v[5], v[6])
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
setVehicleColor(vehicle,255, 255, 0,255,0,0)
setElementData(vehicle,"vehicle:rank",90)
setElementData(vehicle,"vehicle:fuel", 100)
setElementData(vehicle,"vehicle:desc","Autobus Szkoleniowy SAMC")
setVehicleHandling(vehicle,"maxVelocity", 200)
setVehicleHandling(vehicle,"engineAcceleration", 15)
setVehicleHandling(vehicle,"driveType", rwd)
addVehicleUpgrade(vehicle, 1096)
setElementData(vehicle, "vehicle:ogranicznik", 1)
end]]--

for i,v in pairs(karetki) do
local vehicle=createVehicle(416, v[1], v[2], v[3])
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
removeVehicleSirens(vehicle)
setVehicleSirens ( vehicle, 1, 0.302, 2.320, -0.012, 0, 96, 255, 255, 255 )
addVehicleSirens ( vehicle, 8, 1, true, false, false, true )
setVehicleSirens ( vehicle, 2, -0.395, 2.320, 0.000, 255, 0, 0, 255, 255)
addVehicleSirens ( vehicle, 8, 1, true, false, false, true )
setVehicleSirens ( vehicle, 3, -0.775, -2.700, 0.031, 255, 0, 0, 255, 255 )
addVehicleSirens ( vehicle, 8, 1, true, false, false, true )
setVehicleSirens ( vehicle, 4, 0.768, -2.700, 0.031, 255, 0, 0, 255, 255 )
addVehicleSirens ( vehicle, 8, 1, true, false, false, true )
setVehicleSirens ( vehicle, 5, 0.522, -0.405, 0.900, 0, 96, 255, 255, 255 )
addVehicleSirens ( vehicle, 8, 1, true, false, false, true )
setVehicleSirens ( vehicle, 6, -0.479, -0.424, 0.900, 255, 0, 0, 255, 255 )
addVehicleSirens ( vehicle, 8, 1, true, false, false, true )
setElementData(vehicle,"vehicle:samc", true)
setElementData(vehicle,"vehicle:rank",1)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:desc","KWA\nSan Andreas Medica Center - [2]" ..i)
setVehicleHandling(vehicle,"maxVelocity", 250)
setVehicleHandling(vehicle,"engineAcceleration", 15)
setVehicleHandling(vehicle,"driveType", rwd) setElementData(vehicle, "vehicle:ogranicznik", 1)

local col=createColSphere(v[1], v[2], v[3],1.2)
attachElements(col,vehicle,0,-4.2,0)

addEventHandler("onColShapeHit", col, function(plr, matchingDimensions)
if getElementType(plr) == "player" and matchingDimensions then
if getElementData(plr,"player:duty") == "SAMC" then

if target then
exports["pystories-nosze"]:usun(plr,target)
setTimer(warpPedIntoVehicle,500,1,target,vehicle,3)
end
setElementData(plr,"mozenosze",true)
--outputChatBox("[Frakcja] Znajdujesz sie z tylu pojazdu uzyj [/pystories-nosze-pomoc]",plr,0,120,41)
--outputDebugString('tak')
end
end
end)
addEventHandler("onColShapeLeave", col,function(plr, matchingDimensions)
if getElementType(plr) == "player" and matchingDimensions then
if getElementData(plr,"player:duty") == "SAMC" then
setElementData(plr,"mozenosze",false)
--outputDebugString('nie')
end
end
end)
end


for i,v in pairs(helikopter) do
local vehicle=createVehicle(487, v[1], v[2], v[3])
setVehicleColor(vehicle,255,255,255,255)
setElementRotation(vehicle, v[4], v[5], v[6])
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
removeVehicleSirens(vehicle)
addVehicleSirens(vehicle, 6, 2, true, false, true, true )
setVehicleSirens(vehicle, 1, -0.800, 2.600, -0.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.800, 2.600, -0.200, 0, 60, 255, 255, 255 )
setVehicleSirens(vehicle, 3, -0.700, -2.200, 0.000, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 4, 0.700, -2.200, 0.000, 255, 0, 0, 255, 255 )
setVehicleColor( vehicle,255, 255, 0,0,128,255 )
setElementData(vehicle,"vehicle:rank",1)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:desc","MAV-0" ..i)
setElementData(vehicle, "vehicle:ogranicznik", 1)
end


for i,v in pairs(karetki_2) do
local vehicle=createVehicle(416, v[1], v[2], v[3])
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
addVehicleSirens(vehicle, 6, 2, true, false, false, true )
setVehicleSirens(vehicle, 1, -0.400, 0.900, 1.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.000, 0.900, 1.200, 255, 255, 255, 255, 255 )
setVehicleSirens(vehicle, 3, 0.400, 0.900, 1.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 4, 0.900, -3.700, 1.400, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 5, -0.900, -3.700, 1.400, 255, 0, 0, 255, 255 )
setElementData(vehicle,"vehicle:rank",1)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:desc","KWA\nSan Andreas Medica Center - " ..i)
setVehicleHandling(vehicle,"maxVelocity", 200)
setVehicleHandling(vehicle,"engineAcceleration", 15)
setVehicleHandling(vehicle,"driveType", rwd)
setElementData(vehicle, "vehicle:ogranicznik", 1)

local col=createColSphere(v[1], v[2], v[3],1.2)
attachElements(col,vehicle,0,-4.2,0)

addEventHandler("onColShapeHit", col, function(plr, matchingDimensions)
if getElementType(plr) == "player" and matchingDimensions then
if getElementData(plr,"player:duty") == "SAMC" then

if target then
exports["pystories-nosze"]:usun(plr,target)
setTimer(warpPedIntoVehicle,500,1,target,vehicle,3)
end
setElementData(plr,"mozenosze",true)
--outputChatBox("[Frakcja] Znajdujesz sie z tylu pojazdu uzyj [/pystories-nosze-pomoc]",plr,0,120,41)
--outputDebugString('tak')
end
end
end)
addEventHandler("onColShapeLeave", col,function(plr, matchingDimensions)
if getElementType(plr) == "player" and matchingDimensions then
if getElementData(plr,"player:duty") == "SAMC" then
setElementData(plr,"mozenosze",false)
--outputDebugString('nie')
end
end
end)
end

for i,v in pairs(karawany) do
local vehicle=createVehicle(442, v[1], v[2], v[3])
setVehicleColor(vehicle,255,255,255,255)
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
addVehicleSirens(vehicle, 2, 2, true, false, true, false )
setVehicleSirens(vehicle, 1, -0.400, 2.600, -0.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.400, 2.600, -0.200, 0, 0, 255, 255, 255 )
setVehicleColor( vehicle, 0, 0, 0, 255,255,255)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:rank",1)
setVehicleHandling(vehicle,"maxVelocity", 200)
setVehicleHandling(vehicle,"engineAcceleration", 15)
setVehicleHandling(vehicle,"driveType", rwd)
addVehicleUpgrade(vehicle, 1096)
setElementData(vehicle, "vehicle:ogranicznik", 1)
end

for i,v in pairs(admiral) do
local vehicle=createVehicle(445, v[1], v[2], v[3])
setVehicleColor(vehicle,99 ,184, 255)
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
addVehicleSirens(vehicle, 2, 2, true, false, true, false )
setVehicleSirens(vehicle, 1, -0.400, 2.600, -0.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.400, 2.600, -0.200, 0, 0, 255, 255, 255 )
setVehicleColor(vehicle,255,255,255, 101, 0, 0)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:rank", 1)
setElementData(vehicle,"vehicle:desc","["..i.."]Jednostka Patrolowa\nSan Andreas Medica Center")
addVehicleUpgrade(vehicle, 1025)
setElementData(vehicle, "vehicle:ogranicznik", 1)
end

for i,v in pairs(sultany) do
local vehicle=createVehicle(560, v[1], v[2], v[3])
setVehicleColor(vehicle,99 ,184, 255)
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
addVehicleSirens(vehicle, 2, 2, true, false, true, false )
setVehicleSirens(vehicle, 1, -0.400, 2.600, -0.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.400, 2.600, -0.200, 0, 0, 255, 255, 255 )
setVehicleColor(vehicle,255,255,255, 101, 0, 0)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:rank", 1)
setElementData(vehicle,"vehicle:desc","KMA -["..i.."] Zarzad")
addVehicleUpgrade(vehicle, 1025)
setElementData(vehicle, "vehicle:ogranicznik", 1)
end

for i,v in pairs(fbirancher) do
local vehicle=createVehicle(490, v[1], v[2], v[3])
setVehicleColor(vehicle,99 ,184, 255)
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementData(vehicle, "vehicle:ogranicznik", 1)
setElementFrozen(vehicle, true)
addVehicleSirens(vehicle, 2, 2, true, false, true, false )
setVehicleSirens(vehicle, 1, -0.400, 2.600, -0.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.400, 2.600, -0.200, 0, 0, 255, 255, 255 )
setVehicleColor(vehicle,255,255,255, 101, 0, 0)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:rank", 1)
setElementData(vehicle,"vehicle:desc","GOPR -" ..i)
addVehicleUpgrade(vehicle, 1025)
end

for i,v in pairs(rancher) do
local vehicle=createVehicle(489, v[1], v[2], v[3])
setVehicleColor(vehicle,99 ,184, 255)
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
addVehicleSirens(vehicle, 2, 2, true, false, true, false )
setVehicleSirens(vehicle, 1, -0.400, 2.600, -0.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.400, 2.600, -0.200, 0, 0, 255, 255, 255 )
setVehicleColor(vehicle,255,255,255, 101, 0, 0)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:rank", 1)
setElementData(vehicle,"vehicle:desc","sGOPR -" ..i)
addVehicleUpgrade(vehicle, 1025)
setElementData(vehicle, "vehicle:ogranicznik", 1)
end

for i,v in pairs(premiery) do
local vehicle=createVehicle(426, v[1], v[2], v[3])
setVehicleColor(vehicle,99 ,184, 255)
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
addVehicleSirens(vehicle, 2, 2, true, false, true, false )
setVehicleSirens(vehicle, 1, -0.400, 2.600, -0.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.400, 2.600, -0.200, 0, 0, 255, 255, 255 )
setVehicleColor(vehicle,255,255,255, 101, 0, 0)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:rank", 1)
setElementData(vehicle,"vehicle:desc","007-["..i.."]Jednostka Patrolowa\nSan Andreas Medica Center")
addVehicleUpgrade(vehicle, 1025)
setElementData(vehicle, "vehicle:ogranicznik", 1)
end

addEventHandler("onVehicleEnter", resourceRoot, function(plr,seat,jacked)
if seat == 0 then
setElementFrozen(source,false)
setElementData(source,"use:player",true)
triggerClientEvent(plr,"onClientAddNotification",plr,"Zostawianie pojazdów frakcyjnych może skutować banem na koncie!","info")
triggerClientEvent(plr,"onClientAddNotification",plr,"Wszedłeś/aś do pojazdu frakcyjnego, dbaj o niego i odstaw na miejsce!","info")
end
end)

setTimer(function()
for i,vehicle in pairs(getElementsByType("vehicle", resourceRoot)) do
local x,y,z = getElementPosition(vehicle)
local r1,r2,r3 = getElementRotation(vehicle)
setVehicleRespawnPosition(vehicle,x,y,z,r1,r2,r3)
toggleVehicleRespawn(vehicle,true)
setVehicleIdleRespawnDelay(vehicle,3600000)
setVehicleHandling(vehicle, "driveType", "awd")
setElementData(vehicle,"vehicle:duty","SAMC")
end
end,1000,1)

-- naprawa

local marker = createMarker(-2592.87, 613.30, 14.45, "cylinder", 2, 255, 255, 255)

addEventHandler("onMarkerHit", marker, function(veh)
if getElementType(veh) ~= "vehicle" then return end
if getElementData(veh, "vehicle:rank") then
fixVehicle(veh)
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-16, 09:18


Wilq







Wiek: 18
Na forum: 2506 dni
Posty: 3292

Piwa: 624

Respekt: 1175,8
Respekt: 1175,8



   Moderator: Cześć, pamiętaj, aby Twoje posty zawierały argumentację zgodną z regulaminem.
Link niepoprawny, użyj funkcji

Więcej informacji znajdziesz w Wikipedii MTA:

setElementInterior


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-16, 12:13


Matikmontana

Modern Stories






Wiek: 17
Na forum: 551 dni
Posty: 278
Nick w MP: Mazeusz*

Piwa: 384

Respekt: 70


Ostrzeżeń: 60%
https://imgur.com/a/WpYpHmV
nadal nic


for i,v in pairs(karetki_2) do
local vehicle=createVehicle(416, v[1], v[2], v[3])
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
addVehicleSirens(vehicle, 6, 2, true, false, false, true )
setVehicleSirens(vehicle, 1, -0.400, 0.900, 1.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.000, 0.900, 1.200, 255, 255, 255, 255, 255 )
setVehicleSirens(vehicle, 3, 0.400, 0.900, 1.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 4, 0.900, -3.700, 1.400, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 5, -0.900, -3.700, 1.400, 255, 0, 0, 255, 255 )
setElementData(vehicle,"vehicle:rank",1)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:desc","KWA\nSan Andreas Medica Center - " ..i)
setVehicleHandling(vehicle,"maxVelocity", 200)
setVehicleHandling(vehicle,"engineAcceleration", 15)
setVehicleHandling(vehicle,"driveType", rwd)
setElementData(vehicle, "vehicle:ogranicznik", 1)
setElementInterior (karetki_2, 18 )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-16, 12:52


Qwertick

Coming soon...






Wiek: 17
Na forum: 1655 dni
Posty: 480
Nick w MP: Qwertick

Piwa: 2425

Respekt: 205,8
Respekt: 205,8Respekt: 205,8




for i,v in pairs(karetki_2) do
local vehicle=createVehicle(416, v[1], v[2], v[3])
setElementRotation(vehicle, v[4], v[5], v[6])
setElementData(vehicle, "vehicle:dzwiek", true)
setVehicleEngineState(vehicle, false)
setElementFrozen(vehicle, true)
addVehicleSirens(vehicle, 6, 2, true, false, false, true )
setVehicleSirens(vehicle, 1, -0.400, 0.900, 1.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 2, 0.000, 0.900, 1.200, 255, 255, 255, 255, 255 )
setVehicleSirens(vehicle, 3, 0.400, 0.900, 1.200, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 4, 0.900, -3.700, 1.400, 255, 0, 0, 255, 255 )
setVehicleSirens(vehicle, 5, -0.900, -3.700, 1.400, 255, 0, 0, 255, 255 )
setElementData(vehicle,"vehicle:rank",1)
setElementData(vehicle,"vehicle:fuel", 220)
setElementData(vehicle,"bak", 220)
setElementData(vehicle,"vehicle:paliwo", "benzyna")
setElementData(vehicle,"vehicle:desc","KWA\nSan Andreas Medica Center - " ..i)
setVehicleHandling(vehicle,"maxVelocity", 200)
setVehicleHandling(vehicle,"engineAcceleration", 15)
setVehicleHandling(vehicle,"driveType", rwd)
setElementData(vehicle, "vehicle:ogranicznik", 1)
setElementInterior (vehicle, 18 )


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Matikmontana
Tagi: auta :: frakcyjne :: interiorze
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:








Wyświetl posty z ostatnich:   

Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku

Skocz do: