Witam, chcia?em zrobi? tak aby po wpisaniu w skrypcie id wariantu (np 255,255) on pokazywa? si? na aucie, oraz ?eby ten wariant by? po kupnie auta. To co zrobi?em wida? na przyk?adzie Manany
{ 1578.56 , - 1530.73 , 13.30 , 12.9 , model = 410 , dmax = 97343 , dmin = 96323 , price = math . random ( 2500 , 2600 ), gdzie = "cygan" , v1 = 255 , v2 = 255 }, -- manana
local v1 , v2 = vehicles [ slot ]. war
--[[
Komisy samochodowe
@ author value < value2k @ gmail . com >
@ Edit : DylemaT929 :)
@ Edit2 : Mazeusz * :)
Nie masz prawa u ? y ? tego kodu bez mojej zgody
]]
createBlip ( 1422.18 , - 1175.28 , 25.98 , 55 , 2 , 0 , 0 , 0 , 0 , 0 , 275 ) -- Salon zwykly
createBlip ( 1885.88 ,- 1864.87 , 13.58 , 55 , 2 , 0 , 0 , 0 , 0 , 0 , 275 ) -- cygan
-- createBlip ( 170.51 , 618.40 , 5.57 , 55 , 2 , 0 , 0 , 0 , 0 , 0 , 275 ) -- Salon offroad
createBlip (- 1974.28 , 288.13 , 34.88 , 55 , 2 , 0 , 0 , 0 , 0 , 0 , 275 ) -- salon sportowy wajrusa
createBlip ( 1504.46 , - 1466.23 , 25.93 , 55 , 2 , 0 , 0 , 0 , 0 , 0 , 275 ) -- salon z premierkiem
createBlip (- 1664.90 , 1208.61 , 13.54 , 55 , 2 , 0 , 0 , 0 , 0 , 0 , 275 ) -- lowridery i motory
-- createBlip ( 1981.60 , 2373.23 , 11.10 , 55 , 2 , 0 , 0 , 0 , 0 , 0 , 275 ) -- Klasyki i sportowe
-- createBlip ( 2027.30 , 1008.06 , 11.16 , 55 , 2 , 0 , 0 , 0 , 0 , 0 , 275 ) -- Sandking
-- createBlip ( 932.09 , - 1442.32 , 13.55 , 39 , 0 , 0 , 0 , 0 , 0 , 39 ) -- URZ ? D
local object = createObject ( 1365 , 807.44 ,- 650.83 ,- 70.55 , 0 , 0 , 0 )
setElementDimension ( object , 1 )
local object2 = createObject ( 1365 , 807.44 ,- 650.83 ,- 68.55 , 0 , 0 , 0 )
setElementDimension ( object2 , 1 )
-- magazyn ^
-- salon lowrider
createObject ( 3578 , 1737.23 , 330.55 , 26.80 , 0 , 0 , 90 )
-- local t = createElement ( "text" )
-- setElementPosition ( t , 2501.54 ,- 1741.87 , 13.55 + 2 )
-- setElementInterior ( t , 0 )
-- setElementData ( t , "name" , "Wejscie z ty?u" )
local vehicles = {}
local komis_shapes = {}
local slots = {
-- Grotti
{ 556.57 , - 1305.72 , 16.98 , 26.2 , model = 411 , dmax = 50 , dmin = 0 , price = math . random ( 900000 , 1200000 ), gdzie = "grotti" }, -- Inf
{ 548.56 , - 1305.90 , 16.98 , 26.2 , model = 451 , dmax = 50 , dmin = 0 , price = math . random ( 800000 , 890000 ), gdzie = "grotti" }, -- Turek
{ 533.65 , - 1306.04 , 16.98 - 0.1 , 330.0 , model = 541 , dmax = 50 , dmin = 0 , price = math . random ( 750000 , 800000 ), gdzie = "grotti" }, -- bullet
{ 525.45 , - 1305.84 , 16.98 , 330.0 , model = 415 , dmax = 50 , dmin = 0 , price = math . random ( 615000 , 675000 ), gdzie = "grotti" }, -- cheeat
--- SF
{ - 1945.77 , 257.34 , 35.13 , 46.9 , model = 560 , dmax = 50 , dmin = 0 , price = math . random ( 450000 , 460000 ), gdzie = "sportowe" }, -- sult
{ - 1945.63 , 269.51 , 35.13 , 46.9 , model = 562 , dmax = 50 , dmin = 0 , price = math . random ( 350000 , 360000 ), gdzie = "unikat" }, -- elegy
--{ - 1954.50 , 304.18 , 35.13 , 133.4 , model = 559 , dmax = 50 , dmin = 0 , price = math . random ( 75000 , 475000 ), gdzie = "sportowe" }, -- jester / KOMIS
--{ 1800.15 , - 1195.96 , 41.90 , 295.6 , model = 477 , dmax = 0 , dmin = 0 , price = math . random ( 380000 , 480000 ), gdzie = "sportowe" }, -- zr - 350
{ - 1957.77 , 304.93 , 35.13 , 125.2 , model = 506 , dmax = 50 , dmin = 0 , price = math . random ( 200000 , 205000 ), gdzie = "sportowe" }, -- stg
{ - 1960.04 , 256.86 , 40.70 , 61.8 , model = 429 , dmax = 50 , dmin = 0 , price = math . random ( 250000 , 270000 ), gdzie = "sportowe" }, -- banshe
{ - 1960.04 , 269.43 , 40.70 + 0.1 , 61.7 , model = 480 , dmax = 0 , dmin = 0 , price = math . random ( 100000 , 150000 ), gdzie = "sportowe" }, -- comet
{ - 1960.04 , 282 , 40.70 , 61.7 , model = 565 , dmax = 50 , dmin = 0 , price = math . random ( 230000 , 240000 ), gdzie = "sportowe" }, -- flash
{ - 1960.49 , 303.58 , 40.70 , 127.4 , model = 517 , dmax = 50 , dmin = 0 , price = math . random ( 450000 , 460000 ), gdzie = "sportowe" }, -- majestic merc gt
--{ - 1945.92 , 257.30 , 41 , 32.6 , model = 579 , dmax = 0 , dmin = 0 , price = math . random ( 420000 , 440000 ), gdzie = "sportowe" }, -- Huntley
-- Salon motory / lowrider
{ - 1660.41 , 1221.41 , 20.75 , 284.0 , model = 462 , dmax = 0 , dmin = 0 , price = math . random ( 25000 , 26000 ), gdzie = "moto" }, -- Faggi
{ - 1657.02 , 1217.84 , 20.76 , 284.0 , model = 463 , dmax = 0 , dmin = 0 , price = math . random ( 20000 , 252000 ), gdzie = "moto" }, -- freeway
{ - 1649.52 , 1210.83 , 20.76 , 284.0 , model = 468 , dmax = 0 , dmin = 0 , price = math . random ( 123000 , 140000 ), gdzie = "moto" }, -- sanchez
{ - 1646.99 , 1204.53 , 20.76 , 284.0 , model = 581 , dmax = 0 , dmin = 0 , price = math . random ( 403000 , 440000 ), gdzie = "moto" }, -- BF
--{ 2569.45 , 989.38 , 10.42 , 90 , model = 521 , dmax = 0 , dmin = 0 , price = math . random ( 430000 , 434000 ), gdzie = "moto" }, -- FCR
--{ 2569.49 , 992.96 , 10.43 , 90 , model = 522 , dmax = 0 , dmin = 0 , price = math . random ( 523000 , 540000 ), gdzie = "moto" }, -- NRG
--{ 2569.27 , 996.22 , 10.08 , 90 , model = 471 , dmax = 0 , dmin = 0 , price = math . random ( 33000 , 340000 ), gdzie = "moto" }, -- quad
-- Cygany LS / Most
{ 1578.56 , - 1530.73 , 13.30 , 12.9 , model = 410 , dmax = 97343 , dmin = 96323 , price = math . random ( 2500 , 2600 ), gdzie = "cygan" , v1 = 255 , v2 = 255 }, -- manana
{ 1894.25 , - 1852.29 , 13.2 + 0.1 , 125.2 , model = 401 , dmax = 97343 , dmin = 92323 , price = math . random ( 4750 , 4800 ), gdzie = "cygan" }, -- Brabura
--{ 1896.15 , - 1857.61 , 13.34 - 0.1 , 131 , model = 436 , dmax = 99999 , dmin = 90000 , price = math . random ( 25000 , 35000 ), gdzie = "cygan" }, -- Previon
{ 1596.90 , - 1500.72 , 13.33 + 0.3 , 121.7 , model = 418 , dmax = 97000 , dmin = 92323 , price = math . random ( 1550 , 1600 ), gdzie = "cygan" }, -- Moonbeam
{ 1870.77 , - 1857.59 , 13.40 , 343.8 , model = 543 , dmax = 97998 , dmin = 90000 , price = math . random ( 3500 , 3600 ), gdzie = "cygan" }, -- Sadler
{ 1885.49 , - 1862.07 , 13.23 + 0.3 , 212.8 , model = 478 , dmax = 97998 , dmin = 97333 , price = math . random ( 2990 , 3500 ), gdzie = "cygan" }, -- walton
{ 1587.72 , - 1499.22 , 13.31 , 230.3 , model = 404 , dmax = 97000 , dmin = 90333 , price = math . random ( 1560 , 1660 ), gdzie = "cygan" }, -- perek
-- Zwyk ? e
{ 1390.54 , - 1219.24 , 74.68 , 38.6 , model = 558 , dmax = 100 , dmin = 0 , price = math . random ( 195000 , 255000 ), gdzie = "zwykle" }, -- urans
{ 1403.26 , - 1208.36 , 74.89 , 114.1 , model = 603 , dmax = 100 , dmin = 0 , price = math . random ( 130000 , 150000 ), gdzie = "zwykle" }, -- pohiniex
{ 1403.37 , - 1201.65 , 74.81 , 110.8 , model = 602 , dmax = 100 , dmin = 0 , price = math . random ( 105000 , 115000 ), gdzie = "zwykle" }, -- alha
{ 1400.76 , - 1218.71 , 74.78 , 41.8 , model = 587 , dmax = 100 , dmin = 0 , price = math . random ( 105000 , 115000 ), gdzie = "zwykle" }, -- euroski
{ 1380.25 , - 1219.07 , 74.86 , 37.3 , model = 475 , dmax = 100 , dmin = 0 , price = math . random ( 37000 , 37500 ), gdzie = "zwykle" }, -- sabre
--{ 1371.02 , - 1217.91 , 74.74 , 302.0 , model = 555 , dmax = 0 , dmin = 0 , price = math . random ( 530000 , 640000 ), gdzie = "zwykle" }, -- winsor
--{ 1371.33 , - 1207.93 , 74.91 , 300.6 , model = 517 , dmax = 0 , dmin = 0 , price = math . random ( 110000 , 130000 ), gdzie = "zwykle" }, -- majestic
--{ 1377.28 , - 1200.73 , 74.88 , 219.2 , model = 402 , dmax = 0 , dmin = 0 , price = math . random ( 215000 , 299000 ), gdzie = "zwykle" }, -- Buffalo / Komis
--{ 2963.58 , - 804.17 , 11.48 , 297.2 , model = 555 , dmax = 0 , dmin = 0 , price = math . random ( 449000 , 500000 ), gdzie = "zwykle" }, -- Windsor
--{ 2636.39 , 1199.71 , 10.81 , 294.4 , model = 477 , dmax = 0 , dmin = 0 , price = math . random ( 410000 , 520000 ), gdzie = "zwykle" }, -- zr - 350
-- Zwyk ? e / offrad
--{ 190.43 , 593.62 , 5.68 , 62.7 , model = 500 , dmax = 500 , dmin = 0 , price = math . random ( 45000 , 155000 ), gdzie = "zwykle" }, -- mesa
--{ 182.98 , 588.95 , 5.73 - 0.2 , 331.6 , model = 554 , dmax = 500 , dmin = 0 , price = math . random ( 80000 , 90000 ), gdzie = "zwykle" }, -- yose
--{ 160.41 , 613.17 , 5.72 - 0.1 , 346.0 , model = 422 , dmax = 500 , dmin = 0 , price = math . random ( 15000 , 120000 ), gdzie = "zwykle" }, -- bobkat / KOMIS
--{ 164.31 , 633.79 , 5.77 - 0.2 , 165.3 , model = 470 , dmax = 500 , dmin = 0 , price = math . random ( 450000 , 460000 ), gdzie = "unikat2" }, -- pat
--{ 150.78 , 626.91 , 5.69 , 256.9 , model = 482 , dmax = 500 , dmin = 0 , price = math . random ( 47500 , 48000 ), gdzie = "zwykle" }, -- burrit
--{ 170.47 , 624.40 , 5.35 , 163.4 , model = 424 , dmax = 500 , dmin = 0 , price = math . random ( 227500 , 247500 ), gdzie = "zwykle" }, -- bf
--{ 171.66 , 605.69 , 5.43 , 335.9 , model = 568 , dmax = 500 , dmin = 0 , price = math . random ( 227500 , 247500 ), gdzie = "zwykle" }, -- bantitotot
{ 1504.75 , - 1458.55 , 25.96 , 270.0 , model = 426 , dmax = 100 , dmin = 0 , price = math . random ( 30000 , 40000 ), gdzie = "zwykle" }, -- premir
--{ 1513.15 , - 1472.71 , 26.10 , 0.6 , model = 445 , dmax = 0 , dmin = 0 , price = math . random ( 110000 , 130000 ), gdzie = "zwykle" }, -- adam / Komis
{ 1529.84 , - 1472.40 , 26.03 , 90.2 , model = 561 , dmax = 100 , dmin = 0 , price = math . random ( 85000 , 99000 ), gdzie = "zwykle" }, -- starataum
--{ 1521.51 , - 1472.62 , 26.10 , 0.8 , model = 405 , dmax = 0 , dmin = 0 , price = math . random ( 145000 , 155000 ), gdzie = "zwykle" }, -- sent
{ 1530.28 , - 1465.62 , 26.22 - 0.39 , 90.8 , model = 589 , dmax = 100 , dmin = 0 , price = math . random ( 55000 , 65000 ), gdzie = "zwykle" }, -- klub
--{ 1521.51 , - 1472.62 , 26.10 , 0 , model = 540 , dmax = 0 , dmin = 0 , price = math . random ( 127500 , 147500 ), gdzie = "zwykle" }, -- vic
--{ 1529.52 , - 1458.74 , 25.96 , 90.0 , model = 542 , dmax = 0 , dmin = 0 , price = math . random ( 330000 , 340000 ), gdzie = "zwykle" }, -- clower / komis
{ 1504.17 , - 1471.71 , 25.94 , 270.6 , model = 496 , dmax = 100 , dmin = 0 , price = math . random ( 30000 , 40000 ), gdzie = "zwykle" }, -- blista
--{ 1504.46 , - 1466.23 , 25.93 , 270.2 , model = 533 , dmax = 0 , dmin = 0 , price = math . random ( 185000 , 199000 ), gdzie = "zwykle" }, -- feltzer
-- Salon Motory / lowrider SF
{ - 1660.80 , 1213.22 , 7.12 , 273.1 , model = 567 , dmax = 50 , dmin = 0 , price = math . random ( 150000 , 175000 ), gdzie = "sportowe" }, -- Savanna 567 / tornadto 576
{ - 1648.43 , 1207.75 , 13.54 - 0.1 , 230.4 , model = 536 , dmax = 50 , dmin = 0 , price = math . random ( 260000 , 270000 ), gdzie = "sportowe" }, -- blade 536 / broodway 575
{ - 1661.54 , 1221.32 , 13.54 - 0.1 , 273.7 , model = 535 , dmax = 50 , dmin = 0 , price = math . random ( 200000 , 270000 ), gdzie = "sportowe" }, -- slawek 535 / voodo 412
{ - 1664.90 , 1208.61 , 13.54 - 0.1 , 303.8 , model = 534 , dmax = 50 , dmin = 0 , price = math . random ( 110000 , 140000 ), gdzie = "sportowe" }, -- remek
-- Salon Podmianek
--{ 2001.77 , 2368.97 , 10.99 , 64 , model = 494 , dmax = 0 , dmin = 0 , price = math . random ( 7500000 , 8000000 ), gdzie = "unikat3" }, -- gt
--{ 2001.63 , 2377.90 , 10.82 - 0.1 , 105 , model = 503 , dmax = 0 , dmin = 0 , price = math . random ( 30000000 , 31000000 ), gdzie = "unikat2" }, -- ferrarka
--{ 1966.23 , 2361.88 , 16.59 - 0.1 , 324 , model = 566 , dmax = 0 , dmin = 0 , price = math . random ( 5500000 , 5500500 ), gdzie = "unikat3" }, -- Cadilak
--{ 1971.12 , 2378.10 , 10.62 , 256 , model = 551 , dmax = 0 , dmin = 0 , price = math . random ( 5750000 , 6000000 ), gdzie = "unikat3" }, -- m5
--{{ 1982.73 , 2378.74 , 10.87 , 258 , model = 516 , dmax = 0 , dmin = 0 , price = math . random ( 6500000 , 6700000 ), gdzie = "unikat2" }, -- rs6
--{{ 1956.67 , 2372.36 , 11.16 , 270 , model = 579 , dmax = 0 , dmin = 0 , price = math . random ( 35000000 , 36000000 ), gdzie = "unikat2" }, -- g500
--{{ 1978.64 , 2368.29 , 10.86 - 0.2 , 74 , model = 421 , dmax = 0 , dmin = 0 , price = math . random ( 20000000 , 25000000 ), gdzie = "unikat2" }, -- camaro / mercedes
--{{ 1969.54 , 2362.51 , 10.72 , 334 , model = 547 , dmax = 0 , dmin = 0 , price = math . random ( 14500000 , 15500000 ), gdzie = "unikat2" }, -- e30
--{{ 2001.27 , 2368.97 , 16.57 , 78 , model = 585 , dmax = 0 , dmin = 0 , price = math . random ( 15500000 , 15600000 ), gdzie = "unikat3" }, -- 300sel
--{{ 2001.03 , 2373.66 , 16.19 , 102 , model = 507 , dmax = 0 , dmin = 0 , price = math . random ( 20000000 , 21000000 ), gdzie = "unikat2" }, -- 300sl
--{{ 1992.52 , 2368.28 , 16.13 , 70 , model = 550 , dmax = 0 , dmin = 0 , price = math . random ( 25500500 , 25600500 ), gdzie = "unikat3" }, -- deluxe
--{{ 1959.92 , 2378.32 , 11.02 , 258 , model = 489 , dmax = 0 , dmin = 0 , price = math . random ( 45500500 , 55600500 ), gdzie = "unikat2" }, -- Barabus ten lepszy
--{{ 1958.55 , 2364.13 , 10.61 + 0.4 , 303 , model = 400 , dmax = 0 , dmin = 0 , price = math . random ( 39000000 , 45000000 ), gdzie = "unikat2" }, -- barabus gorszy
--{{ 1956.00 , 2372.73 , 16.60 , 240.3 , model = 405 , dmax = 0 , dmin = 0 , price = math . random ( 4000000 , 6000000 ), gdzie = "unikat2" }, -- Bmw m5
-- Lotnisko LV
{ 1342.17 , 1295.28 , 11.2 , 0 , model = 593 , dmax = 0 , dmin = 0 , price = math . random ( 500000 , 510000 ), gdzie = "unikat3" }, -- DODO
{ 1321.59 , 1295.12 , 11.2 + 0.1 , 0 , model = 513 , dmax = 0 , dmin = 0 , price = math . random ( 1500000 , 1528000 ), gdzie = "unikat3" }, -- stunt
{ 1289.64 , 1276.04 , 10.82 , - 45 , model = 469 , dmax = 0 , dmin = 0 , price = math . random ( 500000 , 528000 ), gdzie = "unikat3" }, -- sees
{ 1278.44 , 1323.85 , 10.82 + 1 , 270 , model = 519 , dmax = 0 , dmin = 0 , price = math . random ( 10280000 , 10290000 ), gdzie = "unikat3" }, -- premium
{ 1289.99 , 1298.31 , 10.82 , 270 , model = 487 , dmax = 0 , dmin = 0 , price = math . random ( 1280000 , 1328000 ), gdzie = "unikat3" }, -- mav
-- ARKADJA CZ ? STO ODSWIESZA ? XD !!!!
{ 2848.31 , - 2383.41 , 12.79 , 90.5 , model = 492 , dmax = 90000 , dmin = 0 , price = math . random ( 22000 , 35200 ), gdzie = "zwykle" }, -- Greenwod
{ 2848.56 , - 2393.02 , 12.84 , 90.5 , model = 549 , dmax = 90000 , dmin = 0 , price = math . random ( 12000 , 22200 ), gdzie = "zwykle" }, -- TAMPA
{ 2843.74 , - 2403.37 , 12.94 , 50.9 , model = 540 , dmax = 90000 , dmin = 0 , price = math . random ( 12000 , 22200 ), gdzie = "zwykle" }, -- VIC
{ 2828.13 , - 2407.77 , 12.89 , 1 , model = 458 , dmax = 90000 , dmin = 0 , price = math . random ( 22000 , 40200 ), gdzie = "zwykle" }, -- STOLARIS
}
addEventHandler ( "onResourceStart" , resourceRoot , function ()
for i , v in ipairs ( slots ) do
komis_shapes [ i ] = createColSphere ( v [ 1 ], v [ 2 ], v [ 3 ], 3 )
setElementData ( komis_shapes [ i ], "i" , i )
createKomisVehicle ( i )
addEventHandler ( "onColShapeHit" , komis_shapes [ i ], function ( hit , dim )
if getElementType ( hit ) == "player" and getElementData ( komis_shapes [ i ], "komis:veh" ) then
triggerClientEvent ( hit , "onClientAddNotification" , hit , "Zainteresowa? ci? ten pojazd? /kuppojazd" )
end
end )
end
end )
addCommandHandler ( "kuppojazd" , function ( plr , cmd )
local shape = isPlayerInVehicleColShape ( plr )
if not shape then return end
local veh = getElementData ( shape , "komis:veh" )
if not veh then return end
local slot = getElementData ( shape , "komis:slot" )
local price = vehicles [ slot ]. price
local money = getPlayerMoney ( plr )
if price > money then
triggerClientEvent ( plr , "onClientAddNotification" , plr , "* Nie sta? ci? na kupno tego pojazdu. Id? zar?b na pracach dorywczych i wr?c p??niej!" )
return
end
takePlayerMoney ( plr , price )
local x , y , z = getElementPosition ( veh )
local rx , ry , rz = getElementRotation ( veh )
local i = getElementInterior ( veh )
local d = getElementDimension ( veh )
local pos = x .. ", " .. y .. ", " .. z .. ", " .. rx .. ", " .. ry .. ", " .. rz .. ", " .. i .. ", " .. d
local r1 , g1 , b1 , r2 , g2 , b2 , r3 , g3 , b3 , r4 , g4 , b4 = getVehicleColor ( veh , true )
local color = r1 .. ", " .. g1 .. ", " .. b1 .. ", " .. r2 .. ", " .. g2 .. ", " .. b2
local owner = getElementData ( plr , "player:sid" )
local model = getElementModel ( veh )
local dist = vehicles [ slot ]. mileage
local poj = vehicles [ slot ]. poj
local rodzaj = vehicles [ slot ]. rodzaj
local gdzie = vehicles [ slot ]. gdzie
local v1 , v2 = vehicles [ slot ]. war
destroyElement ( veh )
setElementData ( shape , "komis:veh" , false )
setElementData ( shape , "salonowe" , false )
local q , num , id = exports [ "pystories-db" ]: dbGet ( "INSERT INTO pystories_vehicles SET pos=?, fuel=50, bak=50, mileage=?, ownedPlayer=?, parking=1, pojemnosc=?, rodzaj=?, color=?, model=?, v1=?, v2=?" , pos , dist , owner , poj , rodzaj , color , model , v1 , v2 )
if q then
createKomisVehicle ( slot )
triggerClientEvent ( plr , "onClientAddNotification" , plr , "Gratulacje! Zakupi?e? sw?j pierwszy lub kolejny pojazd na serwerze! Pojazd zosta? przeniesiony do przechowywalni" )
setElementData ( plr , "vehicle:desc" , false )
setElementData ( plr , "vehicle:mileage" , vehicles [ slot ]. mileage )
setElementData ( plr , "vehicle:rodzaj" , vehicles [ slot ]. rodzaj )
setElementData ( plr , "vehicle:poj" , vehicles [ slot ]. poj2 )
else
triggerClientEvent ( plr , "onClientAddNotification" , plr , " Wyst?pi? problem z kupnem pojazdu! Zg?o? to administracji serwera!" )
end
end )
function createKomisVehicle ( slot )
if #getElementsWithinColShape(komis_shapes[slot]) > 0 then setTimer(createKomisVehicle, 3600000, 1, slot) return end
vehicles [ slot ] = {}
vehicles [ slot ]. mileage = math . random ( slots [ slot ]. dmin , slots [ slot ]. dmax )
vehicles [ slot ]. price = slots [ slot ]. price
vehicles [ slot ]. veh = createVehicle ( slots [ slot ]. model , slots [ slot ][ 1 ], slots [ slot ][ 2 ], slots [ slot ][ 3 ], 0 , 0 , slots [ slot ][ 4 ])
setElementFrozen ( vehicles [ slot ]. veh , true )
setVehicleDamageProof ( vehicles [ slot ]. veh , true )
setVehicleLocked ( vehicles [ slot ]. veh , true )
setElementData ( vehicles [ slot ]. veh , "komis:veh" , true )
setElementData ( vehicles [ slot ]. veh , "recznySalonData" , true )
addEventHandler ( "onVehicleStartEnter" , resourceRoot , function()
cancelEvent ()
end )
setElementData ( komis_shapes [ slot ], "komis:veh" , vehicles [ slot ]. veh )
setElementData ( komis_shapes [ slot ], "komis:slot" , slot )
setElementData ( vehicles [ slot ]. veh , "komis:veh" , true )
setElementData ( vehicles [ slot ]. veh , "salonowe" , true )
setVehicleOverrideLights ( vehicles [ slot ]. veh , 2 )
setVehicleColor ( vehicles [ slot ]. veh , 255 , 255 , 255 )
setVehicleHeadLightColor ( vehicles [ slot ]. veh , 255 , 255 , 255 )
if slots [ slot ]. gdzie == "sportowe" then
vehicles [ slot ]. rodzaj = "Benzyna"
vehicles [ slot ]. poj = math . random ( 6 , 11 )
vehicles [ slot ]. gdzie = "sportowe"
elseif slots [ slot ]. gdzie == "dohertysf2" then
vehicles [ slot ]. rodzaj = "Diesel"
vehicles [ slot ]. poj = math . random ( 4 , 6 )
vehicles [ slot ]. gdzie = "dohertysf2"
elseif slots [ slot ]. gdzie == "cygan" then
vehicles [ slot ]. rodzaj = "Benzyna"
vehicles [ slot ]. poj = math . random ( 1 , 5 )
vehicles [ slot ]. gdzie = "cygan"
elseif slots [ slot ]. gdzie == "zwykle" then
vehicles [ slot ]. rodzaj = "Diesel"
vehicles [ slot ]. poj = math . random ( 3 , 8 )
elseif slots [ slot ]. gdzie == "xd" then
vehicles [ slot ]. rodzaj = "Diesel"
vehicles [ slot ]. poj = math . random ( 6 , 7 )
vehicles [ slot ]. gdzie = "unikat"
elseif slots [ slot ]. gdzie == "unikat" then
vehicles [ slot ]. rodzaj = "Diesel"
vehicles [ slot ]. poj = math . random ( 7 , 8 )
vehicles [ slot ]. gdzie = "unikat"
elseif slots [ slot ]. gdzie == "unikat2" then
vehicles [ slot ]. rodzaj = "Benzyna"
vehicles [ slot ]. poj = math . random ( 9 , 12 )
vehicles [ slot ]. gdzie = "unikat2"
elseif slots [ slot ]. gdzie == "unikat3" then
vehicles [ slot ]. rodzaj = "Diesel"
vehicles [ slot ]. poj = math . random ( 9 , 12 )
vehicles [ slot ]. gdzie = "unikat3"
elseif slots [ slot ]. gdzie == "moto" then
vehicles [ slot ]. rodzaj = "Benzyna"
vehicles [ slot ]. poj = math . random ( 3 , 7 )
vehicles [ slot ]. gdzie = "moto"
elseif slots [ slot ]. gdzie == "off" then
vehicles [ slot ]. rodzaj = "Diesel"
vehicles [ slot ]. poj = math . random ( 11 , 13 )
vehicles [ slot ]. gdzie = "off"
elseif slots [ slot ]. gdzie == "grotti" then
vehicles [ slot ]. rodzaj = "Benzyna"
vehicles [ slot ]. poj = math . random ( 12 , 23 )
vehicles [ slot ]. gdzie = "grotti"
end
if vehicles [ slot ]. poj == 1 then
vehicles [ slot ]. poj2 = 1.2
elseif vehicles [ slot ]. poj == 2 then
vehicles [ slot ]. poj2 = 1.4
elseif vehicles [ slot ]. poj == 3 then
vehicles [ slot ]. poj2 = 1.6
elseif vehicles [ slot ]. poj == 4 then
vehicles [ slot ]. poj2 = 1.8
elseif vehicles [ slot ]. poj == 5 then
vehicles [ slot ]. poj2 = 1.9
elseif vehicles [ slot ]. poj == 6 then
vehicles [ slot ]. poj2 = 2.0
elseif vehicles [ slot ]. poj == 7 then
vehicles [ slot ]. poj2 = 2.2
elseif vehicles [ slot ]. poj == 8 then
vehicles [ slot ]. poj2 = 2.4
elseif vehicles [ slot ]. poj == 9 then
vehicles [ slot ]. poj2 = 2.6
elseif vehicles [ slot ]. poj == 10 then
vehicles [ slot ]. poj2 = 2.8
elseif vehicles [ slot ]. poj == 11 then
vehicles [ slot ]. poj2 = 2.9
elseif vehicles [ slot ]. poj == 12 then
vehicles [ slot ]. poj2 = 3.0
elseif vehicles [ slot ]. poj == 13 then
vehicles [ slot ]. poj2 = 3.2
elseif vehicles [ slot ]. poj == 14 then
vehicles [ slot ]. poj2 = 3.4
elseif vehicles [ slot ]. poj == 15 then
vehicles [ slot ]. poj2 = 3.5
elseif vehicles [ slot ]. poj == 16 then
vehicles [ slot ]. poj2 = 3.7
elseif vehicles [ slot ]. poj == 17 then
vehicles [ slot ]. poj2 = 3.9
elseif vehicles [ slot ]. poj == 18 then
vehicles [ slot ]. poj2 = 4.0
elseif vehicles [ slot ]. poj == 19 then
vehicles [ slot ]. poj2 = 4.2
elseif vehicles [ slot ]. poj == 20 then
vehicles [ slot ]. poj2 = 4.5
elseif vehicles [ slot ]. poj == 21 then
vehicles [ slot ]. poj2 = 4.8
elseif vehicles [ slot ]. poj == 22 then
vehicles [ slot ]. poj2 = 5.0
elseif vehicles [ slot ]. poj == 23 then
vehicles [ slot ]. poj2 = 5.2
elseif vehicles [ slot ]. poj == 24 then
vehicles [ slot ]. poj2 = 5.5
end
setElementData ( vehicles [ slot ]. veh , "vehicle:desc" , "Pojazd: #00ff00" .. getVehicleName ( vehicles [ slot ]. veh ).. "\n#ffffffKoszt: #00ff00" .. slots [ slot ]. price .. " PLN\n#ffffffPrzebieg: #00ff00" .. vehicles [ slot ]. mileage .. " km\n#ffffffPojemno?? Silnika: #00ff00" .. vehicles [ slot ]. poj2 .. " cm3\n#ffffffRodzaj paliwa: #00ff00" .. vehicles [ slot ]. rodzaj .. "\n#ffffffPojemno?? Baku: #00ff0050 L\n\n#ffffffZainteresowa? ci? ten pojazd?\nPodejdz i wpisz #00ff00/kuppojazd" )
end
function isPlayerInVehicleColShape ( player )
for i , v in ipairs ( komis_shapes ) do
if isElementWithinColShape ( player , v ) then return v end
end
return false
end
local t = createElement ( "text" )
setElementData ( t , "name" , "Zakaz parkowania na terenie cygana!" )
setElementData ( t , "scale" , 1.2 )
setElementPosition ( t , 1896.80 ,- 1879.49 , 13.50 + 1 )
local wejscie1 = createMarker ( 1421.94 , - 1180.18 , 25.99 + 0.8 , "arrow" , 1 , 255 , 153 , 51 )
local wyjscie1 = createMarker ( 1407.22 , - 1217.40 , 75.05 + 0.8 , "arrow" , 1 , 255 , 153 , 51 )
addEventHandler ( "onMarkerHit" , wejscie1 ,function( el , md )
if getElementType ( el ) == "vehicle" then return end
if getPedOccupiedVehicle ( el ) then return end
setElementPosition ( el , 1404.95 , - 1217.16 , 75.05 )
end )
addEventHandler ( "onMarkerHit" , wyjscie1 ,function( el , md )
if getElementType ( el ) == "vehicle" then return end
if getPedOccupiedVehicle ( el ) then return end
setElementPosition ( el , 1421.14 , - 1176.61 , 25.99 )
end )
--[[ local wejscie23 = createMarker ( 1800.27 , - 1253.78 , 13.65 + 0.8 , "arrow" , 1 , 255 , 153 , 51 )
local wyjscie23 = createMarker ( 1812.14 , - 1193.32 , 42.15 + 0.8 , "arrow" , 1 , 255 , 153 , 51 )
addEventHandler ( "onMarkerHit" , wejscie23 ,function( el , md )
if getElementType ( el ) == "vehicle" then return end
if getPedOccupiedVehicle ( el ) then return end
setElementPosition ( el , 1812.38 , - 1194.72 , 42.15 )
end )
addEventHandler ( "onMarkerHit" , wyjscie23 ,function( el , md )
if getElementType ( el ) == "vehicle" then return end
if getPedOccupiedVehicle ( el ) then return end
setElementPosition ( el , 1800.11 , - 1255.62 , 13.64 )
end )
]]
local wejscie233 = createMarker ( 1518.62 , - 1453.92 , 14.21 + 0.8 , "arrow" , 1 , 255 , 153 , 51 )
local wyjscie233 = createMarker ( 1517.37 , - 1454.90 , 26.22 + 0.8 , "arrow" , 1 , 255 , 153 , 51 )
setElementDimension ( wyjscie233 , 0 )
addEventHandler ( "onMarkerHit" , wejscie233 ,function( el , md )
if getElementType ( el ) == "vehicle" then return end
if getPedOccupiedVehicle ( el ) then return end
setElementPosition ( el , 1517.28 , - 1457.72 , 26.22 + 0.1 )
setElementDimension ( el , 0 )
end )
addEventHandler ( "onMarkerHit" , wyjscie233 ,function( el , md )
if getElementType ( el ) == "vehicle" then return end
if getPedOccupiedVehicle ( el ) then return end
setElementPosition ( el , 1518.69 , - 1450.16 , 13.55 + 0.1 )
setElementDimension ( el , 0 )
end )