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

Wysłany: 2021-09-22, 00:27


piotrek87411







Wiek: 26
Na forum: 1754 dni
Posty: 66
Nick w MP: piotrek84

Piwa: 173

Respekt: 50

Moge jechac autami z salonu jak to naprawic? gm navaxy 3.0 jak trzeba dam kod czy co tam potrzeba ;c

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-09-22, 00:52


NorbiTTT

Nbi#1824






Wiek: 27
Na forum: 3207 dni
Posty: 193
Nick w MP: Nbi

Piwa: 698

Respekt: 60

Na??? el date np vehicle:salon i w interakcji dodaj sobie if getElementData(veh(zalezy jak masz),"vehicle:salon") then return end ;D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-09-23, 15:20


piotrek87411







Wiek: 26
Na forum: 1754 dni
Posty: 66
Nick w MP: piotrek84

Piwa: 173

Respekt: 50

"NorbiTTT" napisał/a:

Na??? el date np vehicle:salon i w interakcji dodaj sobie if
getElementData(veh(zalezy jak masz),"vehicle:salon") then return end ;D


c.lua
https://www40.zippyshare.com/v/OuJewzWo/file.html
s.lua
https://www40.zippyshare.com/v/osqePG0I/file.html
s_vehbuy.lua
https://www40.zippyshare.com/v/kXMVebn4/file.html

moge dac tez kod bo nie rozumiem do konca zrobilem ale nie dziala.

salon

[ Dodano: 2021-09-23, 15:21 ]
Kod:

createBlip(-1953.37, 269.16, 35.47, 55,2,0,0,0,0,0,275) -- Salon pojazd?w Doherty | San Fierro.
createBlip(-1661.34, 1212.81, 13.67, 55,2,0,0,0,0,0,275) -- Salon pojazd?w sportowych Downtown | San Fierro.
createBlip(-1905.301, -516.346, 24.801, 43,2,0,0,0,0,0,275) -- Cygan SF
createBlip(-894.558, 1533.967, 25.851, 43,2,0,0,0,0,0,275) -- Cygan V2
createBlip(343.896, -1354.404, 14.508, 55,2,0,0,0,0,0,275) -- Salon motor?w LS
createBlip(2127.902, 2369.744, 10.82, 55,2,0,0,0,0,0,275) -- Salon Premium+
createBlip(541.409, -1300.156, 17.256, 55,2,0,0,0,0,0,275) -- Salon LS+
createBlip(-2626.569, 1362.466, 7.087, 55,2,0,0,0,0,0,275) -- Salon Off-Road chyba usune piotrek9
createBlip(2458.643, 1340.883, 10.977, 55,2,0,0,0,0,0,275) -- Salon Lowridery - Klasyki
createBlip(1871.408, -2208.774, 13.547, 55,2,0,0,0,0,0,275) -- Salon LS - Samoloty i Helki
createBlip(-2232.407, 2421.965, 4.964, 55,2,0,0,0,0,0,275) -- Salon BM - ?odzie
createBlip(-1985.049, -128.067, 35.919, 55,2,0,0,0,0,0,275) -- Salon SF+


local positionVehicles = {

-- Salon LS - Samoloty i Helki
{'Maverick', 487, 0, 300000, 1889.408, -2192.821, 13.724, 0.269, 359.703, 180.038, "1.6", 255, 0},
{'Stuntplane', 513, 0, 400000, 1890.286, -2217.228, 14.1, 9.096, 0, 90.652, "1.6", 255, 0},
{'Shamal', 519, 0, 700000, 1853.062, -2191.964, 14.471, 0.502, 359.748, 180.205, "1.6", 255, 0},
{'Sparrow', 469, 0, 150000, 1871.198, -2192.823, 13.559, 0.296, 359.672, 180.144, "1.6", 255, 0},

-- Salon LV - Lowridery - Klasyki
{'Hustler', 545, 0, 6666666, -2622.47900, 1377.88049, 7.13840, 360, 359.993, 179.094, "2.2", 255, 255},
{'Broadway', 575, 0, 6666666, 2458.505, 1336.38, 10.423, 359.722, 0.007, 180.011, "1.6", 255, 255},
{'Blade', 536, 0, 6666666, 2452.101, 1336.196, 10.559, 0.002, 360, 179.863, "1.6", 255, 255},
{'Tornado', 576, 0, 6666666, 2464.909, 1346.156, 10.434, 0.355, 0.131, 359.83, "1.6", 255, 255},
{'Voodoo', 412, 0, 6666666, 2458.538, 1346.461, 10.661, 0.184, 0.002, 359.239, "1.6", 255, 255},
{'Tahoma', 566, 0, 6666666, 2452.088, 1346.041, 10.602, 0.316, 0, 359.66, "1.6", 255, 255},
{'Savanna', 567, 0, 6666666, 2441.471, 1339.016, 10.69, 0.47, 360, 269.861, "1.6", 255, 255},
{'Slamvan', 535, 0, 6666666, 2441.407, 1345.382, 10.585, 359.8, 359.978, 269.41, "1.6", 255, 255},
{'Remington', 534, 0, 6666666, 2441.425, 1351.835, 10.545, 0.467, 0, 269.39, "1.6", 255, 255},

-- Salon Premium LV+
{'Stretch', 409, 0, 650000, 2121.718, 2368.922, 10.655, 0.002, 360, 223.064, "1.8", 255, 0},
{'Hotknife', 434, 0, 500000, 2133.195, 2368.472, 10.787, 359.509, 0.001, 124.526, "1.8", 255, 0},
{'Patriot', 470, 0, 700000, 2132.782, 2375.354, 10.698, 359.731, 359.998, 129.655, "1.8", 255, 0},
{'Camper', 483, 0, 850000, 2122.012, 2376.037, 10.813, 359.897, 360, 221.88, "1.8", 255, 0},

-- Salon SF+
{'Rancher Long', 490, 0, 2500000, -1991.369, -114.976, 36.929, 341.625, 354.482, 211, "2.0", 25, 155, 25},
{'Deluxo', 502, 0, 3500000, -1992.317, -140.285, 35.635, 0.178, 0.06, 317.219, "2.0", 125, 245, 5},
{'Journey', 508, 0, 165000, -1977.524, -125.15, 36.299, 359.948, 359.911, 120.816, "1.8", 255, 255, 255},
{'Bloodring Banger', 504, 0, 2850000, -1991.929, -130.16, 35.708, 359.945, 0.083, 229.589, "2.0", 255, 255, 255},
{'Yankee', 456, 0, 345000, -1977.852, -139.044, 36.074, 0.006, 359.927, 44.453, "1.8", 85, 55, 255},

-- Salon LS+
{'Hermes', 474, 0, 580000, 534.941, -1307.214, 17.019, 359.977, 360, 329.505, "1.8", 255, 0},
{'Stafford', 580, 0, 950000, 528.612, -1306.658, 17.026, 360, 359.963, 325.576, "1.8", 255, 0},
{'Windsor', 555, 0, 205000, 521.716, -1305.953, 16.993, 0.104, 359.981, 326.161, "1.8", 255, 0},
{'ZR-350', 477, 0, 185000, 546.728, -1306.823, 17.038, 359.592, 359.921, 22.401, "1.8", 255, 0},
{'Super GT', 506, 0, 245000, 553.665, -1306.267, 16.961, 359.951, 359.999, 24.492, "1.8", 255, 0},
{'Buffalo', 402, 0, 150000, 561.218, -1306.713, 17.038, 359.964, 0, 27.304, "1.8", 255, 0},

-- Salon Off-Road
--[[{'Burrito', 482, 0, 80000, -2619.051, 1354.011, 7.25, 358.798, 0.56, 89.572, "1.6", 255, 0},
{'Pony', 413, 0, 145000, -2619.107, 1346.761, 7.274, 358.787, 0.123, 89.67, "1.6", 255, 0},
{'Bandito', 568, 0, 45000, -2619.163, 1377.96, 6.876, 357.552, 359.984, 178.272, "1.6", 255, 0},
{'Ford F-150 Raptor', 505, 0, 300000, -2632.819, 1377.377, 7.109, 358.717, 359.999, 180.011, "1.6", 255, 0},
{'Mesa', 500, 0, 30000 ,-2625.991, 1377.66, 7.215, 358.115, 359.995, 179.621, "1.6", 255, 0},
{'Yosemite', 554, 0, 50000,-2639.604, 1377.385, 7.229, 359.044, 359.875, 179.474, "1.6", 255, 0},
{'Rancher', 489, 0, 70000,-2646.501, 1377.547, 7.314, 359.742, 359.737, 179.654, "1.6", 255, 0},
{'Huntley', 579, 0, 200000,-2642.777, 1341.052, 7.088, 359.225, 0.127, 320.105, "1.6", 255, 0},
{'Sandking', 495, 0, 250000,-2633.458, 1343.654, 7.497, 0.544, 359.707, 359.187, "1.6", 255, 0},]]


-- Salon Downtown
-- {'Coquette', 491, 0, 650000, -1653.247, 1214.732, 6.9, 359.993, 0, 222.811, "1.6"},
{'Jester', 559, 0, 285000, -1667.404, 1216.059, 6.909, 0.085, 359.999, 261.193, "1.6", 255, 0},
{'Stinger', 558, 0, 750000, -1665.062, 1209.472, 6.956, 359.689, 359.999, 284.959, "1.6", 255, 0},
{'Sultan', 560, 0, 385000, -1649.422, 1207.885, 13.314, 359.812, 359.899, 52.083, "1.6", 255, 0},
--{'Elegy', 562, 0, 450000, -1663.261, 1222.003, 13.336, 359.483, 0.103, 200.712, "1.6"},
{'Banshee', 429, 0, 540000, -1655.926, 1216.334, 13.298, 359.999, 0, 102.478, "1.6", 255, 0},
{'Comet', 480, 0, 580000, -1671.098, 1205.549, 13.445, 359.743, 0, 292.197, "1.6", 255, 0},
--{'Cheetah', 415, 0, 950000, -1654.816, 1214.891, 20.892, 0.271, 359.999, 101.895, "1.6"},
{'Bullet', 541, 0, 1250000, -1663.992, 1222.554, 20.781, 359.514, 0, 191.186, "1.6", 255, 0},
{'Turismo', 451, 0, 2000000, -1649.147, 1206.426, 20.859, 359.389, 359.999, 62.784, "1.6", 255, 0},
{'Infernus', 411, 0, 2650000, -1664.479, 1205.84, 20.883, 0, 0, 296.506, "1.6", 255, 0},
--{'Sabre Sport', 475, 0, 1500000, -1676.709, 1208.306, 20.983, 359.809, 0, 238.43, "2.4"},

-- Salon doherty
{'Alpha', 602, 0, 18500, -1961.492, 303.237, 35.263, 359.268, 0.087, 194.618, "1.6", 255, 0},
{'Stanier', 604, 0, 15000, -1953.88, 303.317, 35.211, 359.987, 360, 164.356, "1.6", 255, 0},
{'Vincent', 540, 0, 25000, -1962.452, 285.467, 35.329, 359.722, 0, 359.861, "1.6", 255, 0},
{'Fortune', 526, 0, 30000, -1962.452, 271.887, 35.235, 359.999, 0, 359.651, "1.6", 255, 0},
{'Washington', 421, 0, 35000, -1962.452, 258.92, 35.353, 359.956, 0.101, 359.497, "1.6", 255, 0},
{'Admiral', 445, 0, 40000, -1946.005, 257.711, 35.35, 0.202, 359.523, 74.453, "1.6", 255, 0},
{'Club', 589, 0, 45000, -1945.816, 265.737, 35.132, 0.005, 360, 89.585, "1.6", 255, 0},
{'Benefactor S', 467, 0, 50000, -1945.944, 274.009, 35.241, 0.18, 0.021, 105.521, "1.6", 255, 0},
{'Elegant', 507, 0, 60000, -1946.044, 273.971, 40.876, 359.872, 0, 104.674, "1.6", 255, 0},
{'Premier', 426, 0, 65000, -1946.057, 265.693, 40.793, 0.005, 359.782, 89.792, "1.6", 255, 1},
{'Merit', 551, 0, 70000, -1945.983, 257.682, 40.857, 359.875, 0, 74.154, "1.6", 255, 0},
{'Stratum', 561, 0, 80000, -1962.454, 258.878, 40.861, 0.111, 0.039, 359.595, "1.6", 255, 0},
{'Sentinel', 405, 0, 85000, -1962.454, 271.713, 40.922, 0.002, 0, 179.797, "1.6", 255, 0},
{'Feltzer', 533, 0, 90000, -1962.454, 285.381, 40.762, 359.998, 0.002, 179.789, "1.6", 255, 0},
{'Euros', 587, 0, 100000, -1961.452, 303.223, 40.773, 359.66, 0.001, 195.435, "1.6", 255, 0},
{'Flash', 565, 0, 115000, -1953.807, 303.452, 40.671, 359.586, 0, 163.861, "1.6", 255, 0},
--{'Phoenix', 603, 0, 100000,-1961.689, 302.155, 40.885, 0.069, 0.004, 203.371, "1.6"},
--{'Clover', 542, 0, 125000,-1961.89, 290.753, 40.71, 359.705, 359.767, 309.895, "1.8"},
{'Tampa', 549, 0, 75000, -1928.528, 273.402, 40.565, 359.971, 360, 179.982, "2.0", 255, 0},



-- Salon motocykli

{'PCJ-600', 461, 0, 85000, 348.80, -1359.64, 14.09, 359.6, 360.0, 299.3, "1.6", 255, 0},
{'NRG-500', 522, 0, 500000, 346.16, -1354.92, 14.08, 359.8, 0.0, 300.4, "2.0", 255, 0},
{'Faggio', 462, 0, 10000, 343.44, -1349.88, 14.09, 359.1, 360.0, 298.5, "1.6", 255, 0},
{'Sanchez', 468, 0, 40000, 344.46, -1359.15, 14.11, 360.0, 0.2, 120.6, "1.6", 255, 0},
{'Wayfarer', 586, 0, 50000, 341.60, -1354.31, 14.03, 359.9, 0.0, 120.0, "1.6", 255, 0},
{'Quadbike', 471, 0, 25000, 339.00, -1349.46, 13.99, 359.2, 360.0, 118.8, "1.6", 255, 0},
{'FCR-900', 521, 0, 120000, 340.855, -1345.159, 14.076, 359.225, 360, 299.113, "1.6", 255, 0},
{'BF-400', 581, 0, 65000, 336.218, -1344.519, 14.103, 359.356, 0.003, 117.615, "1.6", 255, 0},
{'Freeway', 463, 0, 35000, 338.319, -1340.251, 14.048, 359.972, 360, 298.289, "1.6", 255, 0},

-- Cygan

{'Walton', 478, 24850, 2000, -1894.193, -529.473, 24.618, 358.93, 359.418, 122.103, "1.4", 255, 0},
{'Moonbeam', 418, 24850, 1350, -1895.182, -522.078, 24.806, 0.288, 359.368, 69.2, "1.4", 255, 0},
{'Sadler', 543, 24850, 5300, -1911.84, -488.275, 24.985, 358.963, 0, 249.394, "1.4", 255, 0},
{'Bobcat', 422, 24850, 3850, -1910.564, -516.154, 24.794, 358.113, 1.407, 231.845, "1.4", 255, 0},
{'Perennial', 404, 24850, 3150, -1908.597, -526.724, 24.421, 0.177, 0.421, 323.177, "1.4", 255, 0},
{'Manana', 410, 24850, 2500, -1907.615, -534.089, 24.249, 359.33, 0.155, 234.625, "1.4", 255, 0},
{'Previon', 436, 18500, 4780, -1894.379, -505.979, 24.887, 359.069, 358.282, 108.675, "1.4", 255, 0},
{'Schafter', 547, 18500, 9300, -1909.122, -470.177, 24.905, 359.81, 0.002, 218.022, "1.6", 255, 0},
{'Emperor', 585, 18500, 6400, -1894.757, -478.487, 24.818, 359.82, 359.997, 127.259, "1.6", 255, 0},
{'Cabbie', 438, 18500, 7800, -1910.66, -506.151, 25.111, 358.462, 0.548, 210.714, "1.6", 255, 0},
{'Victoria', 479, 18500, 12500, -1896.354, -471.194, 25.006, 359.653, 0.001, 130.346, "1.6", 255, 0},

-- Cygan v2

{'Ford Belina II', 419, 9850, 8500, -883.132, 1517.702, 25.67, 0.87, 359.991, 54.414, "1.6", 255, 0},
{'Schyster Deviant', 401, 9850, 16500, -882.765, 1524.984, 25.717, 359.67, 0, 111.699, "1.6", 255, 0},
{'Picador', 600, 9850, 9450, -904.778, 1535.901, 25.636, 359.127, 359.993, 244.718, "1.6", 255, 0},
{'Buccaneer', 518, 9850, 14500, -881.326, 1535.072, 25.584, 359.972, 359.828, 102.861, "1.6", 255, 0},
{'Greenwood', 492, 9850, 11000, -902.973, 1547.573, 25.693, 0.112, 359.819, 292.625, "1.6", 255, 0},
{'Sunrise', 550, 9850, 12000, -882.203, 1545.388, 25.731, 359.569, 359.999, 71.59, "1.6", 255, 0},
{'Solair', 458, 9850, 6450, -905.48, 1523.561, 25.733, 0.048, 0.001, 231.772, "1.6", 255, 0},
{'Stallion', 439, 9850, 13000, -882.543, 1557.861, 25.739, 359.911, 0, 112.84, "1.6", 255, 0},
{'Blista Compact', 496, 9850, 10500, -904.478, 1556.719, 25.466, 359.852, 359.674, 236.773, "1.6", 255, 0},


-- Salon ?odzi

{'Dinghy', 473, 0, 45000, -2250.126, 2429.356, -0.267, 5.111, 359.746, 223.185, "1.2", 255, 0},
{'Jetmax', 493, 0, 105000, -2221.856, 2400.971, -0.145, 3.061, 359.994, 43.833, "1.2", 255, 0},
{'Squalo', 446, 0, 180000, -2212.885, 2410.73, -0.562, 1.832, 359.989, 44.123, "1.2", 255, 0},
{'Marquis', 484, 0, 350000, -2241.738, 2439.385, 0.207, 1.369, 0.026, 224.559, "1.2", 255, 0},




}

function convertNumber ( number )
local formatted = number
while true do
formatted, k = string.gsub(formatted, "^(-?%d+)(%d%d%d)", '%1,%2')
if ( k==0 ) then
break
end
end
return formatted
end

for i,v in pairs(positionVehicles) do
local veh=createVehicle(v[2], v[5], v[6], v[7], v[8], v[9], v[10])
--[[local wariant = getElementModel(veh)
if wariant == 410 then
setVehicleVariant(veh, 2, 2)
end
if wariant == 404 then
setVehicleVariant(veh, 2, 2)
end
if wariant == 543 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 436 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 585 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 496 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 526 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 421 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 542 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 561 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 405 then
setVehicleVariant(veh, 0, 0) -- sedan
--setVehicleVariant(veh, 1, 1) -- combi
end
if wariant == 587 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 533 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 603 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 565 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 402 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 559 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 477 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 560 then
setVehicleVariant(veh, 0, 0) -- sedan
--setVehicleVariant(veh, 1, 2) -- combi
end
if wariant == 562 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 429 then
setVehicleVariant(veh, 2, 2)
end
if wariant == 480 then
setVehicleVariant(veh, 0, 2)
end
if wariant == 415 then
setVehicleVariant(veh, 1, 2)
end
if wariant == 541 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 411 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 475 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 521 then
setVehicleVariant(veh, 4, 4)
end
if wariant == 522 then
setVehicleVariant(veh, 4, 4)
end
if wariant == 483 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 482 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 500 then
setVehicleVariant(veh, 0, 2)
end
if wariant == 554 then
setVehicleVariant(veh, 0, 2)
end
if wariant == 489 then
setVehicleVariant(veh, 3, 3)
end
if wariant == 579 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 506 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 502 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 586 then
setVehicleVariant(veh, 2, 2)
end
if wariant == 478 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 422 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 517 then
setVehicleVariant(veh, 4, 4)
end
if wariant == 567 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 534 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 535 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 490 then
setVehicleVariant(veh, 1, 0)
end
if wariant == 504 then
setVehicleVariant(veh, 5, 5)
end
if wariant == 456 then
setVehicleVariant(veh, 5, 5)
end
if wariant == 439 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 401 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 600 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 507 then
setVehicleVariant(veh, 2, 2)
end
if wariant == 418 then
setVehicleVariant(veh, 0, 0)
end
if wariant == 426 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 495 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 491 then
setVehicleVariant(veh, 0, 3)
end
if wariant == 540 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 508 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 458 then
setVehicleVariant(veh, 4, 4)
end
if wariant == 445 then
setVehicleVariant(veh, 1, 1)
end
if wariant == 470 then
setVehicleVariant(veh, 2, 2)
end ]]
local k**** = v[4]
setElementData(veh,"vehicle:desc", '#ffffffKup Teraz!\nPojazd: #005AFF'..v[1]..'\n#ffffffCena:#005AFF '..convertNumber(math.floor(k****))..'#ffffff $\n#ffffffPrzebieg: #005AFF'..v[3]..' #ffffffkm\n#ffffffPojemno?? Silnika: #005AFF'..v[11]..'#ffffff dm3\n\n#ffffffAby zakupi? pojazd, wpisz #005AFF/kuppojazd#ffffff\nPieni?dze pobierane s? z bankomatu.')
setVehicleOverrideLights(veh, 1)
setElementFrozen(veh,true)
setVehicleColor(veh, 255,140,0, 0, 0, 0, 0, 0, 0, 255, 255, 255)
setVehicleVariant(veh, v[11], v[12])
--addVehicleUpgrade(veh, 1073)
setVehiclePlateText(veh," SALON ")
setVehicleDamageProof(veh, true)
setElementData(veh,'recznySalonData', true)

veh:setData('vehsell:info', {
['cost']=(v[4]),
['model']=v[2],
['mileage']=v[3],
['selling']=v[15],
['pojemnosc']=v[11]
}, false)
end

addEventHandler('onVehicleEnter', resourceRoot, function(plr, seat, jacked)
if seat~=0 then return end
if source:getData('vehsell:info') and source:getData('vehsell:info').selling==1 then
plr:outputChat('#ff0000✘ #ffffffPojazd nie jest dost?pny w sprzeda?y.', 255, 0, 0, true)
return
end

local data=source:getData('vehsell:info')
if not data then return end

plr:setData('vehsell:info', {
['cost']=data.cost,
['model']=data.model,
['mileage']=data.mileage,
['pojemnosc']=data.pojemnosc,
}, false)

plr:outputChat('#00FF00ⓘ #ffffffAby zakupi? ten pojazd wpisz /kuppojazd', 0, 0, 0, true)
end)

addEventHandler('onVehicleExit', resourceRoot, function(plr, seat, jacked)
if seat~=0 then return end

local data=plr:getData('vehsell:info')
if not data then return end

plr:removeData('vehsell:info')
end)

plrmoney = {}

addCommandHandler('kuppojazd', function(plr, cmd)
local data=plr:getData('vehsell:info')
if not data then return end
local bankmoney = exports["pystories-db"]:dbGet("SELECT `bank_money` FROM `pystories_users` WHERE `id` = ?", getElementData(plr, "player:sid"))
for i, v in ipairs(bankmoney) do
plrmoney[plr] = v["bank_money"]
end

if plrmoney[plr] < data.cost then
plr:outputChat('#ff0000✘ #ffffffNie posiadasz wystarczaj?cej kwoty pieni?dzy w bankomacie!', 255, 0, 0, true)
return
end

local vehicle=plr:getOccupiedVehicle()
if vehicle then
removePedFromVehicle(vehicle)
end

local cost=data.cost
local model=data.model
local mileage=data.mileage
local engine=data.pojemnosc
local sid=getElementData(plr,'player:sid') or 0
local v1,v2=getVehicleVariant(vehicle)
exports["pystories-db"]:dbSet("UPDATE `pystories_users` SET `bank_money` = `bank_money` - ? WHERE `pystories_users`.`id` = ?", cost, getElementData(plr, "player:sid"))
plr:outputChat('#00ff00✔ #ffffffZakupi?e?(a?) sw?j pojazd, znajdziesz go w przechowalni.', 255, 0, 0, true)
destroyElement(vehicle)


--exports["pystories-db"]:dbSet("INSERT INTO `pystories_vehicles` (`model`,`ownedPlayer`,`mileage`,`registered`,`parking`,wariant='%d,%d',`silnik`) VALUES (?,?,?,?,1,?,?)", model, getElementData(plr,"player:sid"),mileage,"true",v1,v2,""..engine.."")

exports["pystories-db"]:dbSet(string.format("INSERT INTO pystories_vehicles SET model='%d', mileage='%d', ownedPlayer='%d', silnik='%s', wariant='%d,%d' ,registered='true', parking='1'",
model, mileage, sid, engine, v1,v2))

end)


[ Dodano: 2021-09-23, 15:21 ]
Kod:

addEvent("onInterakcjeWybierzAkcje", true)
addEventHandler("onInterakcjeWybierzAkcje", getRootElement(),
function(id, vehicle)
local veh = getPedOccupiedVehicle(source)
local c = getPedOccupiedVehicle(source)
local recznySalon = getElementData(veh,"recznySalonData")
local modele_zabronione = {

[463] = true,
[462] = true,
[461] = true,
[581] = true,
[448] = true,
[468] = true,
[471] = true,
[521] = true,
[522] = true,
[523] = true

}

if recznySalon then return end
if veh then
if getVehicleController(veh) == source then

if id == 1 then
setVehicleEngineState(veh, true)

elseif id == 2 then
setVehicleEngineState(veh, false)

elseif id == 3 then
setVehicleOverrideLights(veh, 2)

elseif id == 4 then
setVehicleOverrideLights(veh, 1)

elseif id == 5 then
if modele_zabronione[getElementModel(veh)] then return end
setVehicleLocked(veh, false)

elseif id == 6 then
if modele_zabronione[getElementModel(veh)] then return end
if recznySalon then return end
setVehicleLocked(veh, true)

elseif id == 7 then
if recznySalon then return end
if getElementData(veh, "blokada:kola") then outputChatBox("#ff0000✘#FFFFFF Tw?j pojazd posiada blokade na ko?a!", client, 255, 255, 255, true) return end
setElementFrozen(veh, false)

elseif id == 8 then
if recznySalon then return end
if getElementData(veh, "blokada:kola") then outputChatBox("#ff0000✘#FFFFFF Tw?j pojazd posiada blokade na ko?a!", client, 255, 255, 255, true) return end
setElementFrozen(veh, true)

elseif id == 9 then
setVehicleDoorOpenRatio(veh,0,1,2000)

elseif id == 10 then
setVehicleDoorOpenRatio(veh,0,0,2000)

elseif id == 11 then
setVehicleDoorOpenRatio(veh,1,1,2000)

elseif id == 12 then
setVehicleDoorOpenRatio(veh,1,0,2000)

elseif id == 20 then
triggerClientEvent(client, "wylaczlatanie", root)
setElementData(veh, "vehicle:latanie", false)

elseif id == 21 then
triggerClientEvent(client, "wlaczlatanie", resourceRoot)
setElementData(veh, "vehicle:latanie", true)

elseif id == 24 then
setElementData(veh, "vehicle:neon:state", false)

elseif id == 25 then
setElementData(veh, "vehicle:neon:state", true)

elseif id == 26 then
setElementData(veh, "vehicle:togglelpg", false)

elseif id == 27 then
setElementData(veh, "vehicle:togglelpg", true)


end
else
if vehicle then
if isElement(vehicle) then
if isVehicleLocked(vehicle) then
setVehicleLocked(vehicle, false)
else
setVehicleLocked(vehicle, false)
end
end
end
end
end
end)

addEventHandler("onVehicleExit", getRootElement(),
function(player, seat)
if seat == 0 then
end
end)

addEventHandler("onVehicleStartExit", getRootElement(),
function(player)
local veh = getPedOccupiedVehicle(player)
triggerClientEvent(player, "wylaczlatanie", resourceRoot)
if isVehicleLocked(veh) then
cancelEvent()
end
end)

addEventHandler("onVehicleStartEnter", getRootElement(),
function(player)
triggerClientEvent(player, "wylaczlatanie", resourceRoot)
end)

addEvent("rh:wyzej", true)
addEventHandler("rh:wyzej", root, function()
local veh = getPedOccupiedVehicle(source)
local gora = getElementData(veh, "rh:up") or 0
local s = getVehicleHandlingProperty(veh, "suspensionLowerLimit")
local x = getVehicleHandlingProperty(veh, "suspensionForceLevel")
if tonumber(gora) == 4 then cancelEvent() return end
setVehicleHandling(veh, "suspensionLowerLimit", tonumber(s) - 0.03)
setVehicleHandling(veh, "suspensionForceLevel", tonumber(x) + 0.05)
setElementData(veh, "rh:up", gora+1)
end)

addEvent("rh:nizej", true)
addEventHandler("rh:nizej", root, function()
local veh = getPedOccupiedVehicle(source)
local gora = getElementData(veh, "rh:up") or 0
local s = getVehicleHandlingProperty(veh,"suspensionLowerLimit")
local x = getVehicleHandlingProperty(veh, "suspensionForceLevel")
if tonumber(gora) == -3 then cancelEvent() return end
setVehicleHandling(veh,"suspensionLowerLimit",tonumber(s) + 0.03)
setVehicleHandling(veh,"suspensionForceLevel",tonumber(x) - 0.05)
setElementData(veh, "rh:up", gora-1)
end)

addEvent("Naped:Zmien", true)
addEventHandler("Naped:Zmien", root, function()
local veh = getPedOccupiedVehicle(source)
local naped_lvl = getElementData(veh, "naped:lvl") or "RWD"
if naped_lvl == "RWD" then
setVehicleHandling(veh, "driveType", "fwd")
setElementData(veh, "naped:lvl", "FWD")
elseif naped_lvl == "FWD" then
setVehicleHandling(veh, "driveType", "awd")
setElementData(veh, "naped:lvl", "AWD")
elseif naped_lvl == "AWD" then
setVehicleHandling(veh, "driveType", "rwd")
setElementData(veh, "naped:lvl", "RWD")
--[[elseif naped_lvl == "RWD" then
setVehicleHandling(veh, "driveType", "rwd")
setElementData(veh, "naped:lvl", "RWD")]]
end
end)

function getVehicleHandlingProperty ( element, property )
if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string" then
local handlingTable = getVehicleHandling ( element )
local value = handlingTable[property]

if value then
return value
end
end

return false
end


[ Dodano: 2021-09-23, 22:26 ]
Mo?na usunac / naprawione

Postaw piwo autorowi tego posta
 

 
Tagi: moge :: jezdzic :: autami :: salonu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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