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

Wysłany: 2021-04-13, 08:16


_Dlek_

vifon'ik






Wiek: 18
Na forum: 2329 dni
Posty: 57
Nick w MP: vifon'ik

Piwa: 1967

Respekt: 60

Siemka, czy kto? pomo?e ogarn?? aby w salonie by?y varianty aut i aby po zakupie by?y te varianty na zawsze. Wiem jaki kod ale nie wiem gdzie doda? dodawa?em prawie wsz?dzie ale nic i jestem pewny ?e to ten variant.

KOD VARIANTU:

Kod:

local wariant = getElementModel(veh)
if wariant == 405 then
setVehicleVariant(veh, 0, 0)
end



KOD SALONU:

Kod:

addEvent("zakupPojazdSalon", true)
addEventHandler("zakupPojazdSalon", root, function(id, nazwa, cena, pos, poj, przeb, naped, biznes)
local x,y,z,rx,ry,rz = 179.05,-312.05,1.57
for i,v in ipairs(pos) do
x,y,z,rx,ry,rz = unpack(v)
end
local hajs = getPlayerMoney(source)
if tonumber(cena) < tonumber(hajs) then
takePlayerMoney(source,cena)
triggerEvent("biznes:wplac", source, cena/5, biznes)
local query, _, id = exports.mysql:wykonaj("INSERT INTO pystories_vehicles SET model=?, parking=1, ownedPlayer=?, fuel=50, mileage=?, registered=?, naped=?, pojemnosc=?", id, getElementData(source,"player:sid"),przeb,"true",naped,poj)
exports['yd-noti']:noti(source,"Zakupi?‚e?› samochĂłd o marce: "..nazwa.." za cen?™ "..cena.." PLN","success")
local result = exports.mysql:wykonaj("SELECT * FROM pystories_vehicles WHERE id=?", id)
if #result > 0 then
for i,v in ipairs(result) do
exports["pystories-vehicles"]:onRespawnVehicles(v, id, {x, y, z, rx,ry,rz})
setElementPosition(source,x,y,z+1)
end
end
else
exports['yd-noti']:noti(source,"Brak wystarczaj?…cych ?›rodkĂłw.","error")
end
end)

addEvent("zakupPojazdSalon:karta", true)
addEventHandler("zakupPojazdSalon:karta", root, function(id, nazwa, cena, pos, poj, przeb, naped, biznes)
local x,y,z,rx,ry,rz = 179.05,-312.05,1.57
for i,v in ipairs(pos) do
x,y,z,rx,ry,rz = unpack(v)
end
local check = exports['mysql']:wykonaj("select * from pystories_users where id=?", getElementData(source, "player:sid"))
if tonumber(cena) < tonumber(check[1].bank_money) then
exports['mysql']:wykonaj("update pystories_users set bank_money=bank_money-? where id=?", cena, getElementData(source, "player:sid"))
triggerEvent("biznes:wplac", source, cena/5, biznes)
local query, _, id = exports.mysql:wykonaj("INSERT INTO pystories_vehicles SET model=?, parking=1, ownedPlayer=?, fuel=50, mileage=?, registered=?, naped=?, pojemnosc=?", id, getElementData(source,"player:sid"),przeb,"true",naped,poj)
exports['yd-noti']:noti(source,"Zakupi?‚e?› samochĂłd o marce: "..nazwa.." za cen?™ "..cena.." PLN","success")
local result = exports.mysql:wykonaj("SELECT * FROM pystories_vehicles WHERE id=?", id)
if #result > 0 then
for i,v in ipairs(result) do
exports["pystories-vehicles"]:onRespawnVehicles(v, id, {x, y, z, rx,ry,rz})
setElementPosition(source,x,y,z+1)
end
end
else
exports['yd-noti']:noti(source,"Brak wystarczaj?…cych ?›rodkĂłw na koncie.","error")
end
end)

local los = math.random(1,2)

if los == 1 then

auta = {
--cygan
{"Previon",436,math.random(1500000, 1700000),math.random(0,0),"1.4",-578.53, -179.76, 78.53, 357.6, 355.3, 205.1, 21.5,"cygan"},
{"Sadler",543,math.random(1300000, 1500000),math.random(0,0),"1.2",-499.42, -196.35, 78.23, 359.1, 0.0, 339.1,"cygan"},
{"Manana",410,math.random(900000, 1000000),math.random(0,0),"1.2",-558.31, -181.08, 78.06, 359.4, 0.0, 161.3,"cygan"},
{"Perennial",404,math.random(900000, 1000000),math.random(0,0),"1.2",-482.46, -196.52, 78.07, 0.1, 1.5, 15.8,"cygan"},
{"Solair",458,math.random(900000, 1000000),math.random(0,0),"1.2",-466.89, -180.99, 77.94, 0.1, 357.5, 156.3,"cygan"},
{"Stallion",439,math.random(800000, 1000000),math.random(0,0),"1.2",-534.70,-178.86, 78.30, 0.1, 360.0, 166.5,"cygan"},
{"Walton",478,math.random(800000, 1000000),math.random(0,0),"1.2",-562.86, -195.67, 78.53, 358.3, 1.4, 344.4,"cygan"},
{"Moonbeam",418,math.random(800000, 1000000),math.random(0,0),"1.2",-494.48, -181.50, 78.36, 1.4, 1.0, 206.8,"cygan"},


--zwykly
{"Elegant",507,math.random(7000000, 7200000), math.random(0,0),"1.4",-1957.34,303.82,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Alpha",602,math.random(7500000, 7700000), math.random(0,0),"1.4",-1962.49,271.43,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Admiral",445,math.random(6500000, 6700000), math.random(0,0),"1.4",-1961.84,258.68,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Sentinel",405,math.random(5000000, 5200000), math.random(0,0),"1.4",-1950.97,257.30,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Comet",480,math.random(25000000, 27000000), math.random(0,0),"1.4",-1945.91,263.23,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Club",589,math.random(5500000, 5700000), math.random(0,0),"1.4",-1945.24,271.30,40.70, 359.0, 360.0, 136.9,"zwykly"},
{"Stratum",561,math.random(10000000, 12000000), math.random(0,0),"1.4",-1945.54,261.91,41, 359.0, 360.0, 136.9,"zwykly"},
{"Uranus",558,math.random(10000000, 12000000), math.random(0,0),"1.4",-1950.27,256.21,41, 359.0, 360.0, 136.9,"zwykly"},
{"Tahoma",566,math.random(4500000, 4700000), math.random(0,0),"1.4",-1956.73,262.03,41, 359.0, 360.0, 136.9,"zwykly"},
{"Windsor",555,math.random(6000000, 6200000), math.random(0,0),"1.4",-1955.04,304.18,41, 359.0, 360.0, 136.9,"zwykly"},
{"Mercedes Benz E-Class",426,math.random(8000000, 8200000), math.random(0,0),"1.4",-1945.63, 272.36, 35.39, 0.2, 359.9, 135.3,"zwykly"},

--sport
{"ZR-350",477,math.random(70000000, 72000000), math.random(0,0),"1.8",-1652.27,1211.00,7, 359.9, 359.9, 135.1,"sportowy"},
{"Elegy",562,math.random(87000000, 89000000), math.random(0,0),"1.8",-1659,1214.53,7, 0.0, 0.0, 325.2,"sportowy"},
{"Infernus",411,math.random(97900000, 99900000), math.random(0,0),"1.8",-1668.97,1205.35,7, 0.0, 360.0, 323.7,"sportowy"},
{"Banshee",429,math.random(83000000, 85000000), math.random(0,0),"1.8",-1666.21,1215.47,7, 0.0, 360.0, 32.7,"sportowy"},
{"Cheetah",415,math.random(84000000, 86000000), math.random(0,0),"1.8",-1675.29,1216.31,7, 0.0, 360.0, 235.7 ,"sportowy"},

--motory
{"NRG-500", 522, math.random(50000000, 52000000), math.random(100,1000), "1.4", -2118.28, -1.60, 40.75, 359.1, 360.0, 284.9, "motorki"},
{"Sanchez", 468, math.random(50000000, 62000000), math.random(100,1000), "1.4", -2109.53, -34.07, 40.84, 359.9, 360.0, 335.7, "motorki"},
{"Wayfarer", 586, math.random(20000000, 22000000), math.random(100,1000), "1.4",-2111.46, -31.97, 35.12, 359.9, 360.0, 306.6, "motorki"},
{"PCJ-600", 461, math.random(30000000, 32000000), math.random(100,1000), "1.4", -2101.63, -1.74, 35.20, 359.1, 0.0, 120.2, "motorki"},
{"Freeway", 463, math.random(25000000, 27000000), math.random(100,1000), "1.4", -2119.06, 14.59, 40.71, 360.0, 0.0, 221.8, "motorki"},


--terenowki
{"Sandking", 495, math.random(40000000, 42000000), math.random(50,200), "1.4", -1825.30, -1320.74, 39.60, 1.1, 0.0, 133.5, "terenowki"},
{"Huntley", 579, math.random(45000000, 47000000), math.random(50,200), "1.4", -1825.88, -1309.36, 39.19, 359.4, 359.9, 138.3, "terenowki"},
{"Landstalker", 400 , math.random(25000000, 27000000), math.random(50,200), "1.4", -1835.88, -1308.65, 39.35, 360.0, 0.0, 143.8, "terenowki"},
{"Rancher", 489, math.random(27500000, 29500000), math.random(50, 200), "1.4", -1846.26, -1309.15, 39.35, 360.0, 0.0, 150.4, "terenowki"},
{"Yosemite", 554, math.random(30000000, 32000000), math.random(50,200), "1.4", -1861.81, -1319.72, 39.34, 359.2, 0.0, 305.2, "terenowki"},
{"Mesa", 500, math.random(20000000, 22000000), math.random(50,200), "1.4", -1862.61, -1333.89, 39.36, 358.5, 360.0, 303.3, "terenowki"},
{"Quadbike", 471, math.random(12500000, 14500000), math.random(50,200), "1.4", -1854.34, -1343.56, 38.74, 359.3, 0.0, 356.9, "terenowki"},

--lodzie
{"Dinghy", 473, math.random(150000000, 155000000), 0, 1.2, -2230.72, 2389.61, -0.26, 5.1, 359.7, 47.3, "lodzie"},
{"Jetmax", 493, math.random(110000000, 115000000), 0, 1.2, -2228.26, 2454.07, -0.13, 3.0, 360.0, 227.5, "lodzie"},
{"Tropic", 454, math.random(250000000, 255000000), 0, 1.2, -2201.59, 2427.84, 0.16, 1.9, 0.1, 45.5, "lodzie"},
{"Launch", 595, math.random(170000000, 175000000), 0, 1.2, -2261.48, 2416.70, 0.21, 2.6, 0.1, 225.3, "lodzie"},

--samoloty
{"Maverick", 487, math.random(200000000, 205000000), 0, 1.2, 81.60, 1159.11, 18.84, 0.3, 359.8, 29.1, "helki"},
{"Sparrow", 469, math.random(120000000, 125000000), 0, 1.2, 65.82, 1161.08, 18.68, 0.3, 359.7, 319.1, "helki"},
{"Cropduster", 512, math.random(185000000, 190000000), 0, 1.2, 79.65, 1176.30, 18.94, 7.6, 360.0, 161.9, "helki"},
{"Stuntplane", 513, math.random(210000000, 215000000), 0, 1.2, 50.11, 1173.11, 19.23, 8.9, 360.0, 230.4, "helki"},
}

elseif los == 2 then

auta = {
--cygan
{"Vincent",540,math.random(1500000, 1700000),math.random(0,0),"1.4",-2742.75,1261.67,11.55, 359.1, 359.8, 21.5,"cygan"},
{"Sadler",543,math.random(1300000, 1500000),math.random(0,0),"1.2",-2742.26,1250.92,11.60, 359.1, 359.8, 74.3,"cygan"},
{"Willard",529,math.random(900000, 1000000),math.random(0,0),"1.2",-2730.61,1255.04,11.50, 359.1, 0.0, 158.0,"cygan"},
{"Walton",478,math.random(750000, 770000),math.random(0,0),"1.2",-2727.19,1243.48,11.70, 358.4, 359.6, 243.9,"cygan"},
{"Primo",547,math.random(900000, 1000000),math.random(0,0),"1.2",-2757.00,1245.67,11.55, 359.0, 360.0, 136.9,"cygan"},
{"Moonbeam",418,math.random(900000, 1000000),math.random(0,0),"1.2",-2737.54,1239.44,11.64, 359.0, 360.0, 136.9,"cygan"},

--zwykly
{"Sabre",475,math.random(7000000, 7200000), math.random(0,0),"1.4",-1957.34,303.82,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Stalion",439,math.random(7500000, 7700000), math.random(0,0),"1.4",-1962.49,271.43,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Sentinel",405,math.random(5000000, 5200000), math.random(0,0),"1.4",-1950.97,257.30,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Blista Compact",496,math.random(6500000, 6700000), math.random(0,0),"1.4",-1961.84,258.68,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Cadrona",527,math.random(5000000, 5200000), math.random(0,0),"1.4",-1950.97,257.30,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Comet",480,math.random(25000000, 27000000), math.random(0,0),"1.4",-1945.91,263.23,35.30, 359.0, 360.0, 136.9,"zwykly"},
{"Euros",587,math.random(5500000, 5700000), math.random(0,0),"1.4",-1945.24,271.30,40.70, 359.0, 360.0, 136.9,"zwykly"},
{"Feltzer",533,math.random(10000000, 12000000), math.random(0,0),"1.4",-1945.54,261.91,41, 359.0, 360.0, 136.9,"zwykly"},
{"Uranus",558,math.random(10000000, 12000000), math.random(0,0),"1.4",-1950.27,256.21,41, 359.0, 360.0, 136.9,"zwykly"},
{"Fortune",526,math.random(4500000, 4700000), math.random(0,0),"1.4",-1956.73,262.03,41, 359.0, 360.0, 136.9,"zwykly"},
{"Windsor",555,math.random(6000000, 6200000), math.random(0,0),"1.4",-1955.04,304.18,41, 359.0, 360.0, 136.9,"zwykly"},
{"Mercedes Benz E-Class",426,math.random(8000000, 8200000), math.random(0,0),"1.4",-1945.63, 272.36, 35.39, 0.2, 359.9, 135.3,"zwykly"},

--sport
{"Turismo",451,math.random(80000000, 82000000), math.random(0,0),"1.8",-1652.27,1211.00,7, 359.9, 359.9, 135.1,"sportowy"},
{"Sultan",560,math.random(87000000, 89000000), math.random(0,0),"1.8",-1659,1214.53,7, 0.0, 0.0, 325.2,"sportowy"},
{"Jester",559,math.random(77900000, 79900000), math.random(0,0),"1.8",-1668.97,1205.35,7, 0.0, 360.0, 323.7,"sportowy"},
{"Flash",565,math.random(63000000, 65000000), math.random(0,0),"1.8",-1666.21,1215.47,7, 0.0, 360.0, 32.7,"sportowy"},
{"Bullet",541,math.random(84000000, 86000000), math.random(0,0),"1.8",-1675.29,1216.31,7, 0.0, 360.0, 235.7 ,"sportowy"},

--motory
{"NRG-500", 522, math.random(50000000, 52000000), math.random(100,1000), "1.4", -2118.35, 0.14, 40.74, 359.1, 0.0, 290.3, "motorki"},
{"Sanchez", 468, math.random(40000000, 42000000), math.random(100,1000), "1.4", -2120.78, 4.52, 34.89, 359.0, 0.0, 239.9, "motorki"},
{"Wayfarer", 586, math.random(20000000, 22000000), math.random(100,1000), "1.4", -2120.35, 17.00, 34.89, 359.0, 360.0, 227.2, "motorki"},
{"PCJ-600", 461, math.random(30000000, 32000000), math.random(100,1000), "1.4", -2109.52, 17.14, 34.89, 359.0, 0.0, 149.5, "motorki"},
{"Freeway", 463, math.random(25000000, 27000000), math.random(100,1000), "1.4", -2110.61, -3.62, 34.89, 359.0, 0.0, 17.2, "motorki"},

--terenowki
{"Sandking", 495, math.random(40000000, 42000000), math.random(50,200), "1.4", -1825.30, -1320.74, 39.60, 1.1, 0.0, 133.5, "terenowki"},
{"Huntley", 579, math.random(45000000, 47000000), math.random(50,200), "1.4", -1825.88, -1309.36, 39.19, 359.4, 359.9, 138.3, "terenowki"},
{"Landstalker", 400 , math.random(25000000, 27000000), math.random(50,200), "1.4", -1835.88, -1308.65, 39.35, 360.0, 0.0, 143.8, "terenowki"},
{"Rancher", 489, math.random(27500000, 29500000), math.random(50, 200), "1.4", -1846.26, -1309.15, 39.35, 360.0, 0.0, 150.4, "terenowki"},
{"Yosemite", 554, math.random(30000000, 32000000), math.random(50,200), "1.4", -1861.81, -1319.72, 39.34, 359.2, 0.0, 305.2, "terenowki"},
{"Mesa", 500, math.random(20000000, 22000000), math.random(50,200), "1.4", -1862.61, -1333.89, 39.36, 358.5, 360.0, 303.3, "terenowki"},
{"Quadbike", 471, math.random(12500000, 14500000), math.random(50,200), "1.4", -1854.34, -1343.56, 38.74, 359.3, 0.0, 356.9, "terenowki"},

--lodzie
{"Dinghy", 473, math.random(150000000, 155000000), 0, 1.2, -2230.72, 2389.61, -0.26, 5.1, 359.7, 47.3, "lodzie"},
{"Jetmax", 493, math.random(110000000, 115000000), 0, 1.2, -2228.26, 2454.07, -0.13, 3.0, 360.0, 227.5, "lodzie"},
{"Tropic", 454, math.random(250000000, 255000000), 0, 1.2, -2201.59, 2427.84, 0.16, 1.9, 0.1, 45.5, "lodzie"},
{"Launch", 595, math.random(170000000, 175000000), 0, 1.2, -2261.48, 2416.70, 0.21, 2.6, 0.1, 225.3, "lodzie"},

--samoloty
{"Maverick", 487, math.random(200000000, 205000000), 0, 1.2, 81.60, 1159.11, 18.84, 0.3, 359.8, 29.1, "helki"},
{"Sparrow", 469, math.random(120000000, 125000000), 0, 1.2, 65.82, 1161.08, 18.68, 0.3, 359.7, 319.1, "helki"},
{"Cropduster", 512, math.random(185000000, 190000000), 0, 1.2, 79.65, 1176.30, 18.94, 7.6, 360.0, 161.9, "helki"},
{"Stuntplane", 513, math.random(210000000, 215000000), 0, 1.2, 50.11, 1173.11, 19.23, 8.9, 360.0, 230.4, "helki"},
}

end

local blipy = {
{-513.42, -187.88, 78.12}, -- cygan
{-1652.27,1211.00,7.15}, -- sportowy
{-1956.73,262.03,41}, -- zwykly
{-2110.61, -3.62, 34.89}, -- motorki
{-1863.23,-1318.37,39.25}, -- terenowki
{-2229.98,2420.61,9.00}, -- lodzie
{62.78,1166.09,18.66}, -- helki
}

for index,value in ipairs(blipy) do
local blip = createBlip(value[1],value[2],value[3],55)
setBlipVisibleDistance(blip, 250)
end

for i,v in ipairs(auta) do
local vehicle = createVehicle(v[2],v[6],v[7],v[8],v[9],v[10],v[11])
setElementData(vehicle,"obracanie",true)
setVehicleDamageProof(vehicle, true)
if v[12] == "zwykly" then
v[13],v[14],v[15],v[16],v[17],v[18] = -1936.01, 272.26, 40.70, 359.4, 0.0, 180.3
idb = 2
elseif v[12] == "cygan" then
v[13],v[14],v[15],v[16],v[17],v[18] = -513.90, -180.16, 77.02, 352.7, 1.9, 359.7
idb = 9
elseif v[12] == "sportowy" then
v[13],v[14],v[15],v[16],v[17],v[18] = -1639.52, 1198.34, 6.84, 359.5, 0.1, 268.5
idb = 10
elseif v[12] == "motorki" then
v[13],v[14],v[15],v[16],v[17],v[18] = -2127.43, -4.38, 41.40, 358.9, 0.0, 0.3
idb = 3
elseif v[12] == "terenowki" then
v[13],v[14],v[15],v[16],v[17],v[18] = -1856.26, -1308.38, 39.34, 359.2, 360.0, 139.1
idb = 14
elseif v[12] == "lodzie" then
v[13],v[14],v[15],v[16],v[17],v[18] = -2299.83, 2477.64, -0.13, 3.0, 0.8, 344.0
elseif v[12] == "helki" then
v[13],v[14],v[15],v[16],v[17],v[18] = -1503.03, -223.64, 14.28, 0.3, 359.4, 23.4
end

local colshape = createColSphere(v[6], v[7], v[8], 3.5)
local handling = getModelHandling(tonumber(v[2]))
local naped = handling["driveType"]
if naped == "rwd" then naped = "rwd" elseif naped == "fwd" then naped = "fwd" elseif naped == "awd" then naped = "awd" end
setVehiclePlateText(vehicle, "DemonRPG")
setVehicleColor(vehicle, 255,255,255,200,200,200)
setElementData(vehicle, "wlasciciel", "DemonRPG")
setElementData(vehicle, "Pojemnosc", v[5])
setElementData(vehicle, "Przebieg", v[4])
setElementData(vehicle, "pojazd:salon", true)
setElementData(colshape, "salon", {
["model"] = v[2],
["name"] = v[1],
["cost"] = v[3],
["pojemnosc"] = v[5],
['naped'] = naped,
["przebieg"] = v[4],
["pozycja"] = {{v[13],v[14],v[15],v[16],v[17],v[18]}},
["biznes"] = idb,
})
setElementData(vehicle, "vehicle:desc", "Aby wy?›wietli?‡ informacje #3366ffpodejdĹş do pojazdu!")
setElementFrozen(vehicle, true)
end

addEventHandler("onVehicleStartEnter", root, function(player, seat)
if getElementData(source, "pojazd:salon") then
cancelEvent()
end
end)

setTimer(function()
restartResource(getThisResource())
end, 86400000, 0)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-13, 09:04


xyzzz^

A nic






Wiek: 18
Na forum: 1993 dni
Posty: 319
Nick w MP: Aspyk21

Piwa: 308

Respekt: 81

Ostrzeżeń: 100%
ja bym to zrobi? tak
podczas tworzenia pojazdu

local v getElementsByType('vehicle')
for _veh in ipairs(v) do 
if getElementModel(veh) == 411 then 
setVehicleVariant(veh00)
end
end


natomiast jak tworzysz pojazd za pomoca createVehicle, ma to powiedzmy nazwe veh

veh createVehicle(vehinfo[1], vehinfo[2], vehinfo[3], vehinfo[4])
 
if vehinfo[1] == 411 then
setVehicleVariant(veh00)
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-13, 12:33


_Dlek_

vifon'ik






Wiek: 18
Na forum: 2329 dni
Posty: 57
Nick w MP: vifon'ik

Piwa: 1967

Respekt: 60

"xyzzz^" napisał/a:

ja bym to zrobi? tak
podczas tworzenia pojazdu

local v getElementsByType('vehicle')
for _veh in ipairs(v) do 
if getElementModel(veh) == 411 then 
setVehicleVariant(veh00)
end
end


natomiast jak tworzysz pojazd za pomoca createVehicle, ma to powiedzmy nazwe veh

veh createVehicle(vehinfo[1], vehinfo[2], vehinfo[3], vehinfo[4])
 
if vehinfo[1] == 411 then
setVehicleVariant(veh00)
end


A pode?lesz pod m?j kod do salon?w?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-13, 17:40


xyzzz^

A nic






Wiek: 18
Na forum: 1993 dni
Posty: 319
Nick w MP: Aspyk21

Piwa: 308

Respekt: 81

Ostrzeżeń: 100%
"_Dlek_" napisał/a:

"xyzzz^" napisał/a:

ja bym to zrobi? tak
podczas tworzenia pojazdu

local v getElementsByType('vehicle')
for _veh in ipairs(v) do 
if getElementModel(veh) == 411 then 
setVehicleVariant(veh00)
end
end


natomiast jak tworzysz pojazd za pomoca createVehicle, ma to powiedzmy nazwe veh

veh createVehicle(vehinfo[1], vehinfo[2], vehinfo[3], vehinfo[4])
 
if vehinfo[1] == 411 then
setVehicleVariant(veh00)
end


A pode?lesz pod m?j kod do salon?w?


Tutaj mam nakierowa?, nie tworzy? masz dzia? od przer?bek

Podpis

Znajdź mnie na:
Steamie
GitHubie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-04-13, 20:32


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

getElementModel pobiera ID w tym przypadku pojazdu. Aby zrobi? ustawianie wariantu pojazdu przede wszystkim zr?b jego zapis i w GUI ( bo tak zapewne masz zrobiony salon ) ustaw do wyboru jeden z wariant?w, nic trudnego.

Postaw piwo autorowi tego posta
 

 
Tagi: varianty
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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