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

Wysłany: 2018-08-16, 00:02


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

Witam bawi? si? w dodanie dost?pnych sztuk i nie rozumiem jednego b??du a mianowicie
attempt to concatenate field 'sell' (a nil value)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 01:05


IgorPL222

LUA






Wiek: 26
Na forum: 3112 dni
Posty: 133
Nick w MP: mxgvr

Piwa: 746

Respekt: 55,3

Podaj kod. B??d ten oznacza, ?e nie istnieje data 'sell', a zamiast tego jest nil.

Podpis
discord: mxgvr
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 05:26


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

"IgorPL222" napisał/a:

Podaj kod. B??d ten oznacza, ?e nie istnieje data 'sell', a zamiast tego jest nil.


createBlip(2159.99, -1796.7813.3655,2,0,0,0,0,0,275) --- ls motory
createBlip(2928.03, -797.1611.5355,2,0,0,0,0,0,275) --- ls sportowy
createBlip(2126.78, -1130.2525.5255,2,0,0,0,0,0,275) --- ls terenowe
createBlip(-79.37, -1575.672.6155,2,0,0,0,0,0,275) --- ls cygan
createBlip(1605.93, -2174.9013.5955,2,0,0,0,0,0,275)
createBlip(-72.90, -1130.971.1255,2,0,0,0,0,0,275)


local vehicles = {}
local komis_shapes = {}
local slots = {
    -- Doherty Diesel
    1581.42, -2170.1913.37244.8model=401dmax=0dmin=0price=math.random(2000000,2100000), gdzie="dohertysf"}, -- Bravura
    1581.68, -2179.7413.36296.4model=436dmax=0dmin=0price=math.random(1500000,1700000), gdzie="dohertysf"}, -- Previon
    1594.50, -2170.1013.21153.1model=565dmax=0dmin=0price=math.random(22300000,24500000), gdzie="dohertysf"}, -- flash
    1603.38, -2170.9113.39151.6model=475dmax=0dmin=0price=math.random(5300000,5700000), gdzie="dohertysf"}, -- Szabla
    1621.03, -2164.3613.42146.0model=402dmax=0dmin=0price=math.random(2400000,2500000), gdzie="dohertysf"}, -- Mg?awica
    1613.63, -2163.7213.44155.4model=517dmax=0dmin=0price=math.random(2100000,2200000), gdzie="dohertysf"}, -- majestic
    1630.04, -2179.8513.3541.9model=526dmax=0dmin=0price=math.random(4100000,4200000), gdzie="dohertysf"}, -- Fortuna
    1622.80, -2180.9013.2236.6model=529dmax=0dmin=0price=math.random(6900000,7000000), gdzie="dohertysf"}, -- Williard
    1627.87, -2164.0613.30141.6model=600dmax=0dmin=0price=math.random(1200000,1300000), gdzie="dohertysf"}, -- Picador
    1615.47, -2179.9913.3332.6model=426dmax=0dmin=0price=math.random(7500000,7600000), gdzie="dohertysf"}, -- Premier
    1615.01, -2150.0913.94182.6model=495dmax=0dmin=0price=math.random(4100000,4200000), gdzie="dohertysf"}, -- Sanking
    1608.54, -2180.5313.3949.6model=602dmax=0dmin=0price=math.random(15500000,15600000), gdzie="dohertysf"}, -- Alpha
    
        
    -- Doherty Indlewood
    2187.74, -1805.1812.940.1model=522dmax=0dmin=0price=math.random(31000000,32000000), gdzie="sf"}, -- NRG-500
    2181.77, -1805.3012.952.9model=461dmax=0dmin=0price=math.random(17000000,17000000), gdzie="sf"}, -- PCJ-600
    2175.15, -1805.8512.942.6model=521dmax=0dmin=0price=math.random(20000000,21000000), gdzie="sf"}, -- FCR-900
    2163.73, -1805.8613.04359.6model=468dmax=0dmin=0price=math.random(15523900,16152410), gdzie="sf"}, -- Sanchez
    2169.24, -1806.1112.970.4model=581dmax=0dmin=0price=math.random(12890000,13893000), gdzie="sf"}, -- Bf-400
    2157.95, -1806.1612.904.4model=586dmax=0dmin=0price=math.random(26000000,27972000), gdzie="sf"}, -- Wayfarer
    
    -- Cygan LPG
    {-101.63, -1586.672.27277.4model=410dmax=99343dmin=97323price=math.random(321000,322000), gdzie="cygan"}, -- manana
    {-82.04, -1551.392.49177.3model=458dmax=99343dmin=97323price=math.random(390000,400000), gdzie="cygan"}, -- Solair
    {-59.55, -1552.622.70120.5model=418dmax=100343dmin=97323price=math.random(150000,150000), gdzie="cygan"}, -- Moonbeam
    {-52.18, -1576.542.4827.9model=543dmax=101343dmin=97000price=math.random(520000,521000), gdzie="cygan"}, -- Sadler
    {-96.20, -1594.922.61277.3model=478dmax=111343dmin=107333price=math.random(112000,113000), gdzie="cygan"}, -- walton
    {-78.70, -1601.482.35278.8model=404dmax=118343dmin=116333price=math.random(600000,601000), gdzie="cygan"}, -- perek
    
    -- Salon Downtown SF Benzyna
    {2958.58, -783.8711.57137.6model=480dmax=0dmin=0price=math.random(27000000,28000000), gdzie="sf"}, -- Comet
    {2966.33, -784.1411.50148.8model=506dmax=0dmin=0price=math.random(30000000,31000000), gdzie="unikat"}, -- sgt
    {2945.67, -803.6111.45147.4model=559dmax=0dmin=0price=math.random(32000000,33000000), gdzie="sf"}, -- jester
    {2973.12, -832.8011.5063.9model=560dmax=0dmin=0price=math.random(58000000,59000000), gdzie="unikat"}, -- Su?tan
    {-1676.951207.0713.31,253model=587dmax=0dmin=0price=math.random(24000000,25111111), gdzie="sf"}, -- euros
    {2975.18, -783.9011.57146.0model=415dmax=0dmin=0price=math.random(70000000,71000000), gdzie="sf"}, --chetah
    {2954.17, -804.1311.48145.5model=429dmax=0dmin=0price=math.random(39000000,40000000), gdzie="sf"}, -- Bansheee
    {2945.96, -833.3111.46289.7model=562dmax=0dmin=0price=math.random(47000000,48000000), gdzie="sf"}, -- Elegy
    {2948.24, -783.7811.61140.4model=545dmax=0dmin=0price=math.random(62000000,63000000), gdzie="sf"}, -- Hustler

    -- Salon Jefferson
    2136.00, -1129.7725.5152.7model=567dmax=0dmin=0price=math.random(31000000,32000000), gdzie="dohertysf"}, -- Savanna
    2135.74, -1136.0225.2850.8model=576dmax=0dmin=0price=math.random(32750000,34000000), gdzie="dohertysf"}, -- Tornado
    2136.03, -1142.6224.8648.7model=419dmax=0dmin=0price=math.random(40000000,41000000), gdzie="dohertysf"}, -- Esperanto
    2118.77, -1130.1325.00314.7model=533dmax=0dmin=0price=math.random(34000000,35000000), gdzie="dohertysf"}, -- Feltzer
    2118.64, -1136.7324.85309.5model=518dmax=0dmin=0price=math.random(36999999,37500000), gdzie="dohertysf"}, -- Buccaneer
    2118.47, -1143.2724.50310.6model=467dmax=0dmin=0price=math.random(33500000,34200000), gdzie="dohertysf"}, -- Oceanic

    -- Salon Doherty SF
    { -1946.31265.1635.1842.4model=411dmax=0dmin=0price=math.random(75000000,76000000), gdzie="unikat3"}, -- infek
    { -1950.23258.6935.0727.0model=541dmax=0dmin=0price=math.random(64000000,65000000), gdzie="unikat3"}, -- turek
    { -1956.85259.0735.12349.2model=451dmax=0dmin=0price=math.random(55000000,56000000), gdzie="unikat3"}, -- bullet



    -- Salon ci??arowy LS
    { -30.03, -1123.271.27129.5model=456dmax=0dmin=0price=math.random(6400000,6600000), sell=10gdzie="dohertysf"}, -- yankee
    { -37.12, -1119.021.19130.5model=414dmax=0dmin=0price=math.random(5200000,5400000), gdzie="dohertysf"}, -- mule
    { -42.92, -1116.221.19131.5model=413dmax=0dmin=0price=math.random(3500000,3600000), gdzie="dohertysf"}, -- pony 
    { -49.41, -1114.031.24135.7model=482dmax=0dmin=0price=math.random(3500000,3600000), gdzie="dohertysf"}, -- burrito
     { -57.62, -1144.761.5615.6model=455dmax=0dmin=0price=math.random(11200000,11400000), gdzie="dohertysf"}, -- Flatbed
    { -66.51, -1143.571.1910.7model=609dmax=0dmin=0price=math.random(5200000,8400000), gdzie="dohertysf"}, -- Black Boxville


    { -75.82, -1108.102.14183.6model=515dmax=0dmin=0price=math.random(13200000,13400000), gdzie="dohertysf"}, -- Roadtrain
    { -60.37, -1112.501.71130.7model=514dmax=0dmin=0price=math.random(14200000,14300000), gdzie="dohertysf"}, -- tanker
    { -39.87, -1141.181.6865.1model=450dmax=0dmin=0price=math.random(8200000,9300000), gdzie="dohertysf"}, -- przyczepa
    { -42.60, -1147.601.6866.0model=591dmax=0dmin=0price=math.random(8200000,9300000), gdzie="dohertysf"}, -- przyczepa2







    -- Salon ariport
    1880.39, -2262.3414.23320.4model=487dmax=0dmin=0price=math.random(88000000,89000000), gdzie="unikat3"}, -- Maverick
    1861.67, -2262.3514.07320.8model=469dmax=0dmin=0price=math.random(86000000,87000000), gdzie="unikat3"}, -- sparrow
    1860.83, -2237.2714.52233.1model=593dmax=0dmin=0price=math.random(85000000,87000000), gdzie="unikat3"}, -- dodo
    1881.23, -2237.8014.60140.3model=513dmax=0dmin=0price=math.random(86000000,87000000), gdzie="unikat3"}, -- dodo


    
    
    
}

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 (plrcmd)
    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 s vehicles[slot].sell
    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
    if price s then
        triggerClientEvent(plr"onClientAddNotification"plr,"* Nie ma ju? dost?pnych aut. Wr?c p??niej!")
        return
    end
    takePlayerMoney(plrprices-1)

    local x,y,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,b1r2,g2,b2r3,g3,b3r4,g4,b4 getVehicleColor(vehtrue)
    local color r1..", "..g1..", "..b1..", "..r2..", "..g2..", "..b2

    local owner getElementData(plr"player:uid")
    local model getElementModel(veh)
    local dist vehicles[slot].mileage
    local poj vehicles[slot].poj
    local rodzaj vehicles[slot].rodzaj
    local gdzie vehicles[slot].gdzie

    destroyElement(veh)
    setElementData(shape"komis:veh"false)
    setElementData(shape"salonowe"false)

    local qnumid exports["tiyl-db"]:dbGet("INSERT INTO tiyl_pojazdy SET pos=?, fuel=15, gas=25, bak=100, mileage=?, ownedPlayer=?, parking=1, pojemnosc=?, rodzaj=?, color=?, model=?"posdistownerpojrodzajcolormodel)
    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, 250, 1, slot) return end

    vehicles[slot] = {}

    vehicles[slot].mileage math.random(slots[slot].dminslots[slot].dmax)
    vehicles[slot].price slots[slot].price

    vehicles[slot].veh createVehicle(slots[slot].modelslots[slot][1], slots[slot][2], slots[slot][3], 00slots[slot][4], slots[slot][5])
    setElementFrozen(vehicles[slot].vehtrue)
    setVehicleDamageProof(vehicles[slot].vehtrue)
    setVehicleLocked(vehicles[slot].vehtrue)

    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)
    setVehicleColor(vehicles[slot].vehmath.random(0,255),math.random(0,255),math.random(0,255))
    setVehicleHeadLightColor(vehicles[slot].veh255550)

    if slots[slot].gdzie == "dohertysf" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(3,4)
    vehicles[slot].gdzie "dohertysf"
    elseif slots[slot].gdzie == "dohertysf2" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(4,5)
    vehicles[slot].gdzie "dohertysf2"
    elseif slots[slot].gdzie == "cygan" then
    vehicles[slot].rodzaj "LPG"
    vehicles[slot].poj math.random(1,2)
    vehicles[slot].gdzie "cygan"
    elseif slots[slot].gdzie == "sf" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(5,6)
    vehicles[slot].gdzie "unikat"
    elseif slots[slot].gdzie == "unikat" then
    vehicles[slot].rodzaj "Benzyna"
    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,10)
    vehicles[slot].gdzie "unikat2"
    elseif slots[slot].gdzie == "unikat3" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(11,12)
    vehicles[slot].gdzie "unikat3"
    end

    if vehicles[slot].poj == 1 then
    vehicles[slot].poj2 1.2
    elseif vehicles[slot].poj == 2 then
    vehicles[slot].poj2 1.6
    elseif vehicles[slot].poj == 3 then
    vehicles[slot].poj2 1.8
    elseif vehicles[slot].poj == 4 then
    vehicles[slot].poj2 2.0
    elseif vehicles[slot].poj == 5 then
    vehicles[slot].poj2 2.2
    elseif vehicles[slot].poj == 6 then
    vehicles[slot].poj2 2.5
    elseif vehicles[slot].poj == 7 then
    vehicles[slot].poj2 2.6
    elseif vehicles[slot].poj == 8 then
    vehicles[slot].poj2 2.7
    elseif vehicles[slot].poj == 9 then
    vehicles[slot].poj2 2.8
    elseif vehicles[slot].poj == 10 then
    vehicles[slot].poj2 2.9
    elseif vehicles[slot].poj == 11 then
    vehicles[slot].poj2 3.0
    elseif vehicles[slot].poj == 12 then
    vehicles[slot].poj2 3.1
    end

    setElementData(vehicles[slot].veh"vehicle:desc""---------\nPojazd: "..getVehicleName(vehicles[slot].veh).."\nKoszt: "..slots[slot].price.." PLN\nPrzebieg: "..vehicles[slot].mileage.." km\nPojemno?? Silnika: "..vehicles[slot].poj2.." cm3\nRodzaj paliwa: "..vehicles[slot].rodzaj.."\nPojemno?? Baku: 100 L\nDost?pne Sztuki: "..vehicles[slot].sell.."\nZainteresowa? ci? ten pojazd? /kuppojazd\n---------")
end

function isPlayerInVehicleColShape(player)
    for i,v in ipairs(komis_shapes) do
        if isElementWithinColShape(playervthen return v end
    end
    return false
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 09:20


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Podaj linijk? gdzie ten b??d wyskakuje.

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 09:29


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

"Wercio." napisał/a:

Podaj linijk? gdzie ten b??d wyskakuje.


   setElementData(vehicles[slot].veh"vehicle:desc""---------\nPojazd: "..getVehicleName(vehicles[slot].veh).."\nKoszt: "..slots[slot].price.." PLN\nPrzebieg: "..vehicles[slot].mileage.." km\nPojemno?? Silnika: "..vehicles[slot].poj2.." cm3\nRodzaj paliwa: "..vehicles[slot].rodzaj.."\nPojemno?? Baku: 100 L\nDost?pne Sztuki: "..vehicles[slot].sell.."\nZainteresowa? ci? ten pojazd? /kuppojazd\n---------")
end

A dok?adniej to
\nDost?pne Sztuki"..vehicles[slot].sell.."


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 09:35


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

A pr?bowa?e?, w ka?dym poje?dzie da? to sell=ilo???

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 10:08


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

"Wercio." napisał/a:

A pr?bowa?e?, w ka?dym poje?dzie da? to sell=ilo???

zmieni?em jedn? rzecz i teraz wywala przy kupnie
komisy_server.lua:136attempt to compare nil with number

a linijka 136 to
if price s then


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 10:12


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Zobacz to
createBlip(2159.99, -1796.7813.3655,2,0,0,0,0,0,275) --- ls motory
createBlip(2928.03, -797.1611.5355,2,0,0,0,0,0,275) --- ls sportowy
createBlip(2126.78, -1130.2525.5255,2,0,0,0,0,0,275) --- ls terenowe
createBlip(-79.37, -1575.672.6155,2,0,0,0,0,0,275) --- ls cygan
createBlip(1605.93, -2174.9013.5955,2,0,0,0,0,0,275)
createBlip(-72.90, -1130.971.1255,2,0,0,0,0,0,275)


local vehicles = {}
local komis_shapes = {}
local slots = {
    -- Doherty Diesel
    1581.42, -2170.1913.37244.8model=401dmax=0dmin=0price=math.random(2000000,2100000), gdzie="dohertysf"}, -- Bravura
    1581.68, -2179.7413.36296.4model=436dmax=0dmin=0price=math.random(1500000,1700000), gdzie="dohertysf"}, -- Previon
    1594.50, -2170.1013.21153.1model=565dmax=0dmin=0price=math.random(22300000,24500000), gdzie="dohertysf"}, -- flash
    1603.38, -2170.9113.39151.6model=475dmax=0dmin=0price=math.random(5300000,5700000), gdzie="dohertysf"}, -- Szabla
    1621.03, -2164.3613.42146.0model=402dmax=0dmin=0price=math.random(2400000,2500000), gdzie="dohertysf"}, -- Mg?awica
    1613.63, -2163.7213.44155.4model=517dmax=0dmin=0price=math.random(2100000,2200000), gdzie="dohertysf"}, -- majestic
    1630.04, -2179.8513.3541.9model=526dmax=0dmin=0price=math.random(4100000,4200000), gdzie="dohertysf"}, -- Fortuna
    1622.80, -2180.9013.2236.6model=529dmax=0dmin=0price=math.random(6900000,7000000), gdzie="dohertysf"}, -- Williard
    1627.87, -2164.0613.30141.6model=600dmax=0dmin=0price=math.random(1200000,1300000), gdzie="dohertysf"}, -- Picador
    1615.47, -2179.9913.3332.6model=426dmax=0dmin=0price=math.random(7500000,7600000), gdzie="dohertysf"}, -- Premier
    1615.01, -2150.0913.94182.6model=495dmax=0dmin=0price=math.random(4100000,4200000), gdzie="dohertysf"}, -- Sanking
    1608.54, -2180.5313.3949.6model=602dmax=0dmin=0price=math.random(15500000,15600000), gdzie="dohertysf"}, -- Alpha
    
        
    -- Doherty Indlewood
    2187.74, -1805.1812.940.1model=522dmax=0dmin=0price=math.random(31000000,32000000), gdzie="sf"}, -- NRG-500
    2181.77, -1805.3012.952.9model=461dmax=0dmin=0price=math.random(17000000,17000000), gdzie="sf"}, -- PCJ-600
    2175.15, -1805.8512.942.6model=521dmax=0dmin=0price=math.random(20000000,21000000), gdzie="sf"}, -- FCR-900
    2163.73, -1805.8613.04359.6model=468dmax=0dmin=0price=math.random(15523900,16152410), gdzie="sf"}, -- Sanchez
    2169.24, -1806.1112.970.4model=581dmax=0dmin=0price=math.random(12890000,13893000), gdzie="sf"}, -- Bf-400
    2157.95, -1806.1612.904.4model=586dmax=0dmin=0price=math.random(26000000,27972000), gdzie="sf"}, -- Wayfarer
    
    -- Cygan LPG
    {-101.63, -1586.672.27277.4model=410dmax=99343dmin=97323price=math.random(321000,322000), gdzie="cygan"}, -- manana
    {-82.04, -1551.392.49177.3model=458dmax=99343dmin=97323price=math.random(390000,400000), gdzie="cygan"}, -- Solair
    {-59.55, -1552.622.70120.5model=418dmax=100343dmin=97323price=math.random(150000,150000), gdzie="cygan"}, -- Moonbeam
    {-52.18, -1576.542.4827.9model=543dmax=101343dmin=97000price=math.random(520000,521000), gdzie="cygan"}, -- Sadler
    {-96.20, -1594.922.61277.3model=478dmax=111343dmin=107333price=math.random(112000,113000), gdzie="cygan"}, -- walton
    {-78.70, -1601.482.35278.8model=404dmax=118343dmin=116333price=math.random(600000,601000), gdzie="cygan"}, -- perek
    
    -- Salon Downtown SF Benzyna
    {2958.58, -783.8711.57137.6model=480dmax=0dmin=0price=math.random(27000000,28000000), gdzie="sf"}, -- Comet
    {2966.33, -784.1411.50148.8model=506dmax=0dmin=0price=math.random(30000000,31000000), gdzie="unikat"}, -- sgt
    {2945.67, -803.6111.45147.4model=559dmax=0dmin=0price=math.random(32000000,33000000), gdzie="sf"}, -- jester
    {2973.12, -832.8011.5063.9model=560dmax=0dmin=0price=math.random(58000000,59000000), gdzie="unikat"}, -- Su?tan
    {-1676.951207.0713.31,253model=587dmax=0dmin=0price=math.random(24000000,25111111), gdzie="sf"}, -- euros
    {2975.18, -783.9011.57146.0model=415dmax=0dmin=0price=math.random(70000000,71000000), gdzie="sf"}, --chetah
    {2954.17, -804.1311.48145.5model=429dmax=0dmin=0price=math.random(39000000,40000000), gdzie="sf"}, -- Bansheee
    {2945.96, -833.3111.46289.7model=562dmax=0dmin=0price=math.random(47000000,48000000), gdzie="sf"}, -- Elegy
    {2948.24, -783.7811.61140.4model=545dmax=0dmin=0price=math.random(62000000,63000000), gdzie="sf"}, -- Hustler

    -- Salon Jefferson
    2136.00, -1129.7725.5152.7model=567dmax=0dmin=0price=math.random(31000000,32000000), gdzie="dohertysf"}, -- Savanna
    2135.74, -1136.0225.2850.8model=576dmax=0dmin=0price=math.random(32750000,34000000), gdzie="dohertysf"}, -- Tornado
    2136.03, -1142.6224.8648.7model=419dmax=0dmin=0price=math.random(40000000,41000000), gdzie="dohertysf"}, -- Esperanto
    2118.77, -1130.1325.00314.7model=533dmax=0dmin=0price=math.random(34000000,35000000), gdzie="dohertysf"}, -- Feltzer
    2118.64, -1136.7324.85309.5model=518dmax=0dmin=0price=math.random(36999999,37500000), gdzie="dohertysf"}, -- Buccaneer
    2118.47, -1143.2724.50310.6model=467dmax=0dmin=0price=math.random(33500000,34200000), gdzie="dohertysf"}, -- Oceanic

    -- Salon Doherty SF
    { -1946.31265.1635.1842.4model=411dmax=0dmin=0price=math.random(75000000,76000000), gdzie="unikat3"}, -- infek
    { -1950.23258.6935.0727.0model=541dmax=0dmin=0price=math.random(64000000,65000000), gdzie="unikat3"}, -- turek
    { -1956.85259.0735.12349.2model=451dmax=0dmin=0price=math.random(55000000,56000000), gdzie="unikat3"}, -- bullet



    -- Salon ci??arowy LS
    { -30.03, -1123.271.27129.5model=456dmax=0dmin=0price=math.random(6400000,6600000), sell=10gdzie="dohertysf"}, -- yankee
    { -37.12, -1119.021.19130.5model=414dmax=0dmin=0price=math.random(5200000,5400000), gdzie="dohertysf"}, -- mule
    { -42.92, -1116.221.19131.5model=413dmax=0dmin=0price=math.random(3500000,3600000), gdzie="dohertysf"}, -- pony 
    { -49.41, -1114.031.24135.7model=482dmax=0dmin=0price=math.random(3500000,3600000), gdzie="dohertysf"}, -- burrito
     { -57.62, -1144.761.5615.6model=455dmax=0dmin=0price=math.random(11200000,11400000), gdzie="dohertysf"}, -- Flatbed
    { -66.51, -1143.571.1910.7model=609dmax=0dmin=0price=math.random(5200000,8400000), gdzie="dohertysf"}, -- Black Boxville


    { -75.82, -1108.102.14183.6model=515dmax=0dmin=0price=math.random(13200000,13400000), gdzie="dohertysf"}, -- Roadtrain
    { -60.37, -1112.501.71130.7model=514dmax=0dmin=0price=math.random(14200000,14300000), gdzie="dohertysf"}, -- tanker
    { -39.87, -1141.181.6865.1model=450dmax=0dmin=0price=math.random(8200000,9300000), gdzie="dohertysf"}, -- przyczepa
    { -42.60, -1147.601.6866.0model=591dmax=0dmin=0price=math.random(8200000,9300000), gdzie="dohertysf"}, -- przyczepa2







    -- Salon ariport
    1880.39, -2262.3414.23320.4model=487dmax=0dmin=0price=math.random(88000000,89000000), gdzie="unikat3"}, -- Maverick
    1861.67, -2262.3514.07320.8model=469dmax=0dmin=0price=math.random(86000000,87000000), gdzie="unikat3"}, -- sparrow
    1860.83, -2237.2714.52233.1model=593dmax=0dmin=0price=math.random(85000000,87000000), gdzie="unikat3"}, -- dodo
    1881.23, -2237.8014.60140.3model=513dmax=0dmin=0price=math.random(86000000,87000000), gdzie="unikat3"}, -- dodo


    
    
    
}

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 (plrcmd)
    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 s vehicles[slot].sell
    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
    if price s then
        triggerClientEvent(plr"onClientAddNotification"plr,"* Nie ma ju? dost?pnych aut. Wr?c p??niej!")
        return
    end
    takePlayerMoney(plrprices-1)

    local x,y,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,b1r2,g2,b2r3,g3,b3r4,g4,b4 getVehicleColor(vehtrue)
    local color r1..", "..g1..", "..b1..", "..r2..", "..g2..", "..b2

    local owner getElementData(plr"player:uid")
    local model getElementModel(veh)
    local dist vehicles[slot].mileage
    local poj vehicles[slot].poj
    local slot vehicles[slot].sell
    local rodzaj vehicles[slot].rodzaj
    local gdzie vehicles[slot].gdzie

    destroyElement(veh)
    setElementData(shape"komis:veh"false)
    setElementData(shape"salonowe"false)

    local qnumid exports["tiyl-db"]:dbGet("INSERT INTO tiyl_pojazdy SET pos=?, fuel=15, gas=25, bak=100, mileage=?, ownedPlayer=?, parking=1, pojemnosc=?, rodzaj=?, color=?, model=?"posdistownerpojrodzajcolormodel)
    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, 250, 1, slot) return end

    vehicles[slot] = {}

    vehicles[slot].mileage math.random(slots[slot].dminslots[slot].dmax)
    vehicles[slot].price slots[slot].price

    vehicles[slot].veh createVehicle(slots[slot].modelslots[slot][1], slots[slot][2], slots[slot][3], 00slots[slot][4], slots[slot][5])
    setElementFrozen(vehicles[slot].vehtrue)
    setVehicleDamageProof(vehicles[slot].vehtrue)
    setVehicleLocked(vehicles[slot].vehtrue)

    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)
    setVehicleColor(vehicles[slot].vehmath.random(0,255),math.random(0,255),math.random(0,255))
    setVehicleHeadLightColor(vehicles[slot].veh255550)

    if slots[slot].gdzie == "dohertysf" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(3,4)
    vehicles[slot].gdzie "dohertysf"
    elseif slots[slot].gdzie == "dohertysf2" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(4,5)
    vehicles[slot].gdzie "dohertysf2"
    elseif slots[slot].gdzie == "cygan" then
    vehicles[slot].rodzaj "LPG"
    vehicles[slot].poj math.random(1,2)
    vehicles[slot].gdzie "cygan"
    elseif slots[slot].gdzie == "sf" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(5,6)
    vehicles[slot].gdzie "unikat"
    elseif slots[slot].gdzie == "unikat" then
    vehicles[slot].rodzaj "Benzyna"
    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,10)
    vehicles[slot].gdzie "unikat2"
    elseif slots[slot].gdzie == "unikat3" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(11,12)
    vehicles[slot].gdzie "unikat3"
    end

    if vehicles[slot].poj == 1 then
    vehicles[slot].poj2 1.2
    elseif vehicles[slot].poj == 2 then
    vehicles[slot].poj2 1.6
    elseif vehicles[slot].poj == 3 then
    vehicles[slot].poj2 1.8
    elseif vehicles[slot].poj == 4 then
    vehicles[slot].poj2 2.0
    elseif vehicles[slot].poj == 5 then
    vehicles[slot].poj2 2.2
    elseif vehicles[slot].poj == 6 then
    vehicles[slot].poj2 2.5
    elseif vehicles[slot].poj == 7 then
    vehicles[slot].poj2 2.6
    elseif vehicles[slot].poj == 8 then
    vehicles[slot].poj2 2.7
    elseif vehicles[slot].poj == 9 then
    vehicles[slot].poj2 2.8
    elseif vehicles[slot].poj == 10 then
    vehicles[slot].poj2 2.9
    elseif vehicles[slot].poj == 11 then
    vehicles[slot].poj2 3.0
    elseif vehicles[slot].poj == 12 then
    vehicles[slot].poj2 3.1
    end

    setElementData(vehicles[slot].veh"vehicle:desc""---------\nPojazd: "..getVehicleName(vehicles[slot].veh).."\nKoszt: "..slots[slot].price.." PLN\nPrzebieg: "..vehicles[slot].mileage.." km\nPojemno?? Silnika: "..vehicles[slot].poj2.." cm3\nRodzaj paliwa: "..vehicles[slot].rodzaj.."\nPojemno?? Baku: 100 L\nDost?pne Sztuki: "..vehicles[slot].sell.."\nZainteresowa? ci? ten pojazd? /kuppojazd\n---------")
end

function isPlayerInVehicleColShape(player)
    for i,v in ipairs(komis_shapes) do
        if isElementWithinColShape(playervthen return v end
    end
    return false
end


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 10:31


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

"Wercio." napisał/a:

Zobacz to
createBlip(2159.99, -1796.7813.3655,2,0,0,0,0,0,275) --- ls motory
createBlip(2928.03, -797.1611.5355,2,0,0,0,0,0,275) --- ls sportowy
createBlip(2126.78, -1130.2525.5255,2,0,0,0,0,0,275) --- ls terenowe
createBlip(-79.37, -1575.672.6155,2,0,0,0,0,0,275) --- ls cygan
createBlip(1605.93, -2174.9013.5955,2,0,0,0,0,0,275)
createBlip(-72.90, -1130.971.1255,2,0,0,0,0,0,275)


local vehicles = {}
local komis_shapes = {}
local slots = {
    -- Doherty Diesel
    1581.42, -2170.1913.37244.8model=401dmax=0dmin=0price=math.random(2000000,2100000), gdzie="dohertysf"}, -- Bravura
    1581.68, -2179.7413.36296.4model=436dmax=0dmin=0price=math.random(1500000,1700000), gdzie="dohertysf"}, -- Previon
    1594.50, -2170.1013.21153.1model=565dmax=0dmin=0price=math.random(22300000,24500000), gdzie="dohertysf"}, -- flash
    1603.38, -2170.9113.39151.6model=475dmax=0dmin=0price=math.random(5300000,5700000), gdzie="dohertysf"}, -- Szabla
    1621.03, -2164.3613.42146.0model=402dmax=0dmin=0price=math.random(2400000,2500000), gdzie="dohertysf"}, -- Mg?awica
    1613.63, -2163.7213.44155.4model=517dmax=0dmin=0price=math.random(2100000,2200000), gdzie="dohertysf"}, -- majestic
    1630.04, -2179.8513.3541.9model=526dmax=0dmin=0price=math.random(4100000,4200000), gdzie="dohertysf"}, -- Fortuna
    1622.80, -2180.9013.2236.6model=529dmax=0dmin=0price=math.random(6900000,7000000), gdzie="dohertysf"}, -- Williard
    1627.87, -2164.0613.30141.6model=600dmax=0dmin=0price=math.random(1200000,1300000), gdzie="dohertysf"}, -- Picador
    1615.47, -2179.9913.3332.6model=426dmax=0dmin=0price=math.random(7500000,7600000), gdzie="dohertysf"}, -- Premier
    1615.01, -2150.0913.94182.6model=495dmax=0dmin=0price=math.random(4100000,4200000), gdzie="dohertysf"}, -- Sanking
    1608.54, -2180.5313.3949.6model=602dmax=0dmin=0price=math.random(15500000,15600000), gdzie="dohertysf"}, -- Alpha
    
        
    -- Doherty Indlewood
    2187.74, -1805.1812.940.1model=522dmax=0dmin=0price=math.random(31000000,32000000), gdzie="sf"}, -- NRG-500
    2181.77, -1805.3012.952.9model=461dmax=0dmin=0price=math.random(17000000,17000000), gdzie="sf"}, -- PCJ-600
    2175.15, -1805.8512.942.6model=521dmax=0dmin=0price=math.random(20000000,21000000), gdzie="sf"}, -- FCR-900
    2163.73, -1805.8613.04359.6model=468dmax=0dmin=0price=math.random(15523900,16152410), gdzie="sf"}, -- Sanchez
    2169.24, -1806.1112.970.4model=581dmax=0dmin=0price=math.random(12890000,13893000), gdzie="sf"}, -- Bf-400
    2157.95, -1806.1612.904.4model=586dmax=0dmin=0price=math.random(26000000,27972000), gdzie="sf"}, -- Wayfarer
    
    -- Cygan LPG
    {-101.63, -1586.672.27277.4model=410dmax=99343dmin=97323price=math.random(321000,322000), gdzie="cygan"}, -- manana
    {-82.04, -1551.392.49177.3model=458dmax=99343dmin=97323price=math.random(390000,400000), gdzie="cygan"}, -- Solair
    {-59.55, -1552.622.70120.5model=418dmax=100343dmin=97323price=math.random(150000,150000), gdzie="cygan"}, -- Moonbeam
    {-52.18, -1576.542.4827.9model=543dmax=101343dmin=97000price=math.random(520000,521000), gdzie="cygan"}, -- Sadler
    {-96.20, -1594.922.61277.3model=478dmax=111343dmin=107333price=math.random(112000,113000), gdzie="cygan"}, -- walton
    {-78.70, -1601.482.35278.8model=404dmax=118343dmin=116333price=math.random(600000,601000), gdzie="cygan"}, -- perek
    
    -- Salon Downtown SF Benzyna
    {2958.58, -783.8711.57137.6model=480dmax=0dmin=0price=math.random(27000000,28000000), gdzie="sf"}, -- Comet
    {2966.33, -784.1411.50148.8model=506dmax=0dmin=0price=math.random(30000000,31000000), gdzie="unikat"}, -- sgt
    {2945.67, -803.6111.45147.4model=559dmax=0dmin=0price=math.random(32000000,33000000), gdzie="sf"}, -- jester
    {2973.12, -832.8011.5063.9model=560dmax=0dmin=0price=math.random(58000000,59000000), gdzie="unikat"}, -- Su?tan
    {-1676.951207.0713.31,253model=587dmax=0dmin=0price=math.random(24000000,25111111), gdzie="sf"}, -- euros
    {2975.18, -783.9011.57146.0model=415dmax=0dmin=0price=math.random(70000000,71000000), gdzie="sf"}, --chetah
    {2954.17, -804.1311.48145.5model=429dmax=0dmin=0price=math.random(39000000,40000000), gdzie="sf"}, -- Bansheee
    {2945.96, -833.3111.46289.7model=562dmax=0dmin=0price=math.random(47000000,48000000), gdzie="sf"}, -- Elegy
    {2948.24, -783.7811.61140.4model=545dmax=0dmin=0price=math.random(62000000,63000000), gdzie="sf"}, -- Hustler

    -- Salon Jefferson
    2136.00, -1129.7725.5152.7model=567dmax=0dmin=0price=math.random(31000000,32000000), gdzie="dohertysf"}, -- Savanna
    2135.74, -1136.0225.2850.8model=576dmax=0dmin=0price=math.random(32750000,34000000), gdzie="dohertysf"}, -- Tornado
    2136.03, -1142.6224.8648.7model=419dmax=0dmin=0price=math.random(40000000,41000000), gdzie="dohertysf"}, -- Esperanto
    2118.77, -1130.1325.00314.7model=533dmax=0dmin=0price=math.random(34000000,35000000), gdzie="dohertysf"}, -- Feltzer
    2118.64, -1136.7324.85309.5model=518dmax=0dmin=0price=math.random(36999999,37500000), gdzie="dohertysf"}, -- Buccaneer
    2118.47, -1143.2724.50310.6model=467dmax=0dmin=0price=math.random(33500000,34200000), gdzie="dohertysf"}, -- Oceanic

    -- Salon Doherty SF
    { -1946.31265.1635.1842.4model=411dmax=0dmin=0price=math.random(75000000,76000000), gdzie="unikat3"}, -- infek
    { -1950.23258.6935.0727.0model=541dmax=0dmin=0price=math.random(64000000,65000000), gdzie="unikat3"}, -- turek
    { -1956.85259.0735.12349.2model=451dmax=0dmin=0price=math.random(55000000,56000000), gdzie="unikat3"}, -- bullet



    -- Salon ci??arowy LS
    { -30.03, -1123.271.27129.5model=456dmax=0dmin=0price=math.random(6400000,6600000), sell=10gdzie="dohertysf"}, -- yankee
    { -37.12, -1119.021.19130.5model=414dmax=0dmin=0price=math.random(5200000,5400000), gdzie="dohertysf"}, -- mule
    { -42.92, -1116.221.19131.5model=413dmax=0dmin=0price=math.random(3500000,3600000), gdzie="dohertysf"}, -- pony 
    { -49.41, -1114.031.24135.7model=482dmax=0dmin=0price=math.random(3500000,3600000), gdzie="dohertysf"}, -- burrito
     { -57.62, -1144.761.5615.6model=455dmax=0dmin=0price=math.random(11200000,11400000), gdzie="dohertysf"}, -- Flatbed
    { -66.51, -1143.571.1910.7model=609dmax=0dmin=0price=math.random(5200000,8400000), gdzie="dohertysf"}, -- Black Boxville


    { -75.82, -1108.102.14183.6model=515dmax=0dmin=0price=math.random(13200000,13400000), gdzie="dohertysf"}, -- Roadtrain
    { -60.37, -1112.501.71130.7model=514dmax=0dmin=0price=math.random(14200000,14300000), gdzie="dohertysf"}, -- tanker
    { -39.87, -1141.181.6865.1model=450dmax=0dmin=0price=math.random(8200000,9300000), gdzie="dohertysf"}, -- przyczepa
    { -42.60, -1147.601.6866.0model=591dmax=0dmin=0price=math.random(8200000,9300000), gdzie="dohertysf"}, -- przyczepa2







    -- Salon ariport
    1880.39, -2262.3414.23320.4model=487dmax=0dmin=0price=math.random(88000000,89000000), gdzie="unikat3"}, -- Maverick
    1861.67, -2262.3514.07320.8model=469dmax=0dmin=0price=math.random(86000000,87000000), gdzie="unikat3"}, -- sparrow
    1860.83, -2237.2714.52233.1model=593dmax=0dmin=0price=math.random(85000000,87000000), gdzie="unikat3"}, -- dodo
    1881.23, -2237.8014.60140.3model=513dmax=0dmin=0price=math.random(86000000,87000000), gdzie="unikat3"}, -- dodo


    
    
    
}

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 (plrcmd)
    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 s vehicles[slot].sell
    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
    if price s then
        triggerClientEvent(plr"onClientAddNotification"plr,"* Nie ma ju? dost?pnych aut. Wr?c p??niej!")
        return
    end
    takePlayerMoney(plrprices-1)

    local x,y,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,b1r2,g2,b2r3,g3,b3r4,g4,b4 getVehicleColor(vehtrue)
    local color r1..", "..g1..", "..b1..", "..r2..", "..g2..", "..b2

    local owner getElementData(plr"player:uid")
    local model getElementModel(veh)
    local dist vehicles[slot].mileage
    local poj vehicles[slot].poj
    local slot vehicles[slot].sell
    local rodzaj vehicles[slot].rodzaj
    local gdzie vehicles[slot].gdzie

    destroyElement(veh)
    setElementData(shape"komis:veh"false)
    setElementData(shape"salonowe"false)

    local qnumid exports["tiyl-db"]:dbGet("INSERT INTO tiyl_pojazdy SET pos=?, fuel=15, gas=25, bak=100, mileage=?, ownedPlayer=?, parking=1, pojemnosc=?, rodzaj=?, color=?, model=?"posdistownerpojrodzajcolormodel)
    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, 250, 1, slot) return end

    vehicles[slot] = {}

    vehicles[slot].mileage math.random(slots[slot].dminslots[slot].dmax)
    vehicles[slot].price slots[slot].price

    vehicles[slot].veh createVehicle(slots[slot].modelslots[slot][1], slots[slot][2], slots[slot][3], 00slots[slot][4], slots[slot][5])
    setElementFrozen(vehicles[slot].vehtrue)
    setVehicleDamageProof(vehicles[slot].vehtrue)
    setVehicleLocked(vehicles[slot].vehtrue)

    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)
    setVehicleColor(vehicles[slot].vehmath.random(0,255),math.random(0,255),math.random(0,255))
    setVehicleHeadLightColor(vehicles[slot].veh255550)

    if slots[slot].gdzie == "dohertysf" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(3,4)
    vehicles[slot].gdzie "dohertysf"
    elseif slots[slot].gdzie == "dohertysf2" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(4,5)
    vehicles[slot].gdzie "dohertysf2"
    elseif slots[slot].gdzie == "cygan" then
    vehicles[slot].rodzaj "LPG"
    vehicles[slot].poj math.random(1,2)
    vehicles[slot].gdzie "cygan"
    elseif slots[slot].gdzie == "sf" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(5,6)
    vehicles[slot].gdzie "unikat"
    elseif slots[slot].gdzie == "unikat" then
    vehicles[slot].rodzaj "Benzyna"
    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,10)
    vehicles[slot].gdzie "unikat2"
    elseif slots[slot].gdzie == "unikat3" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(11,12)
    vehicles[slot].gdzie "unikat3"
    end

    if vehicles[slot].poj == 1 then
    vehicles[slot].poj2 1.2
    elseif vehicles[slot].poj == 2 then
    vehicles[slot].poj2 1.6
    elseif vehicles[slot].poj == 3 then
    vehicles[slot].poj2 1.8
    elseif vehicles[slot].poj == 4 then
    vehicles[slot].poj2 2.0
    elseif vehicles[slot].poj == 5 then
    vehicles[slot].poj2 2.2
    elseif vehicles[slot].poj == 6 then
    vehicles[slot].poj2 2.5
    elseif vehicles[slot].poj == 7 then
    vehicles[slot].poj2 2.6
    elseif vehicles[slot].poj == 8 then
    vehicles[slot].poj2 2.7
    elseif vehicles[slot].poj == 9 then
    vehicles[slot].poj2 2.8
    elseif vehicles[slot].poj == 10 then
    vehicles[slot].poj2 2.9
    elseif vehicles[slot].poj == 11 then
    vehicles[slot].poj2 3.0
    elseif vehicles[slot].poj == 12 then
    vehicles[slot].poj2 3.1
    end

    setElementData(vehicles[slot].veh"vehicle:desc""---------\nPojazd: "..getVehicleName(vehicles[slot].veh).."\nKoszt: "..slots[slot].price.." PLN\nPrzebieg: "..vehicles[slot].mileage.." km\nPojemno?? Silnika: "..vehicles[slot].poj2.." cm3\nRodzaj paliwa: "..vehicles[slot].rodzaj.."\nPojemno?? Baku: 100 L\nDost?pne Sztuki: "..vehicles[slot].sell.."\nZainteresowa? ci? ten pojazd? /kuppojazd\n---------")
end

function isPlayerInVehicleColShape(player)
    for i,v in ipairs(komis_shapes) do
        if isElementWithinColShape(playervthen return v end
    end
    return false
end

Mam inny problem, ?e po kupnie nie zmniejszaj? si? sztuki aut

--[[
    Komisy samochodowe
    @author value <value2k@gmail.com>
    @EditDylemaT929 :)
    Nie masz prawa u?ytego kodu bez mojej zgody
]]
createBlip(2159.99, -1796.7813.3655,2,0,0,0,0,0,275) --- ls motory
createBlip(2928.03, -797.1611.5355,2,0,0,0,0,0,275) --- ls sportowy
createBlip(2126.78, -1130.2525.5255,2,0,0,0,0,0,275) --- ls terenowe
createBlip(-79.37, -1575.672.6155,2,0,0,0,0,0,275) --- ls cygan
createBlip(1605.93, -2174.9013.5955,2,0,0,0,0,0,275)
createBlip(-72.90, -1130.971.1255,2,0,0,0,0,0,275)


local vehicles = {}
local komis_shapes = {}
local slots = {
    -- Doherty Diesel
    1581.42, -2170.1913.37244.8model=401dmax=0dmin=0price=math.random(2000000,2100000), sell=10gdzie="dohertysf"}, -- Bravura
    1581.68, -2179.7413.36296.4model=436dmax=0dmin=0price=math.random(1500000,1700000), sell=10gdzie="dohertysf"}, -- Previon
    1594.50, -2170.1013.21153.1model=565dmax=0dmin=0price=math.random(22300000,24500000), sell=10gdzie="dohertysf"}, -- flash
    1603.38, -2170.9113.39151.6model=475dmax=0dmin=0price=math.random(5300000,5700000), sell=10gdzie="dohertysf"}, -- Szabla
    1621.03, -2164.3613.42146.0model=402dmax=0dmin=0price=math.random(2400000,2500000), sell=10gdzie="dohertysf"}, -- Mg?awica
    1613.63, -2163.7213.44155.4model=517dmax=0dmin=0price=math.random(2100000,2200000), sell=10gdzie="dohertysf"}, -- majestic
    1630.04, -2179.8513.3541.9model=526dmax=0dmin=0price=math.random(4100000,4200000), sell=10gdzie="dohertysf"}, -- Fortuna
    1622.80, -2180.9013.2236.6model=529dmax=0dmin=0price=math.random(6900000,7000000), sell=10gdzie="dohertysf"}, -- Williard
    1627.87, -2164.0613.30141.6model=600dmax=0dmin=0price=math.random(1200000,1300000), sell=10gdzie="dohertysf"}, -- Picador
    1615.47, -2179.9913.3332.6model=426dmax=0dmin=0price=math.random(7500000,7600000), sell=10gdzie="dohertysf"}, -- Premier
    1615.01, -2150.0913.94182.6model=495dmax=0dmin=0price=math.random(4100000,4200000), sell=10gdzie="dohertysf"}, -- Sanking
    1608.54, -2180.5313.3949.6model=602dmax=0dmin=0price=math.random(15500000,15600000), sell=10gdzie="dohertysf"}, -- Alpha
    
        
    -- Doherty Indlewood
    2187.74, -1805.1812.940.1model=522dmax=0dmin=0price=math.random(31000000,32000000), sell=10gdzie="sf"}, -- NRG-500
    2181.77, -1805.3012.952.9model=461dmax=0dmin=0price=math.random(17000000,17000000), sell=10gdzie="sf"}, -- PCJ-600
    2175.15, -1805.8512.942.6model=521dmax=0dmin=0price=math.random(20000000,21000000), sell=10gdzie="sf"}, -- FCR-900
    2163.73, -1805.8613.04359.6model=468dmax=0dmin=0price=math.random(15523900,16152410), sell=10gdzie="sf"}, -- Sanchez
    2169.24, -1806.1112.970.4model=581dmax=0dmin=0price=math.random(12890000,13893000), sell=10gdzie="sf"}, -- Bf-400
    2157.95, -1806.1612.904.4model=586dmax=0dmin=0price=math.random(26000000,27972000), sell=10gdzie="sf"}, -- Wayfarer
    
    -- Cygan LPG
    {-101.63, -1586.672.27277.4model=410dmax=99343dmin=97323price=math.random(321000,322000), sell=10gdzie="cygan"}, -- manana
    {-82.04, -1551.392.49177.3model=458dmax=99343dmin=97323price=math.random(390000,400000), sell=10gdzie="cygan"}, -- Solair
    {-59.55, -1552.622.70120.5model=418dmax=100343dmin=97323price=math.random(150000,150000), sell=10gdzie="cygan"}, -- Moonbeam
    {-52.18, -1576.542.4827.9model=543dmax=101343dmin=97000price=math.random(520000,521000), sell=10gdzie="cygan"}, -- Sadler
    {-96.20, -1594.922.61277.3model=478dmax=111343dmin=107333price=math.random(112000,113000), sell=10gdzie="cygan"}, -- walton
    {-78.70, -1601.482.35278.8model=404dmax=118343dmin=116333price=math.random(600000,601000), sell=10gdzie="cygan"}, -- perek
    
    -- Salon Downtown SF Benzyna
    {2958.58, -783.8711.57137.6model=480dmax=0dmin=0price=math.random(27000000,28000000), sell=10gdzie="sf"}, -- Comet
    {2966.33, -784.1411.50148.8model=506dmax=0dmin=0price=math.random(30000000,31000000), sell=10gdzie="unikat"}, -- sgt
    {2945.67, -803.6111.45147.4model=559dmax=0dmin=0price=math.random(32000000,33000000), sell=10gdzie="sf"}, -- jester
    {2973.12, -832.8011.5063.9model=560dmax=0dmin=0price=math.random(58000000,59000000), sell=10gdzie="unikat"}, -- Su?tan
    {-1676.951207.0713.31,253model=587dmax=0dmin=0price=math.random(24000000,25111111), sell=10gdzie="sf"}, -- euros
    {2975.18, -783.9011.57146.0model=415dmax=0dmin=0price=math.random(70000000,71000000), sell=10gdzie="sf"}, --chetah
    {2954.17, -804.1311.48145.5model=429dmax=0dmin=0price=math.random(39000000,40000000), sell=10gdzie="sf"}, -- Bansheee
    {2945.96, -833.3111.46289.7model=562dmax=0dmin=0price=math.random(47000000,48000000), sell=10gdzie="sf"}, -- Elegy
    {2948.24, -783.7811.61140.4model=545dmax=0dmin=0price=math.random(62000000,63000000), sell=10gdzie="sf"}, -- Hustler

    -- Salon Jefferson
    2136.00, -1129.7725.5152.7model=567dmax=0dmin=0price=math.random(31000000,32000000), sell=10gdzie="dohertysf"}, -- Savanna
    2135.74, -1136.0225.2850.8model=576dmax=0dmin=0price=math.random(32750000,34000000), sell=10gdzie="dohertysf"}, -- Tornado
    2136.03, -1142.6224.8648.7model=419dmax=0dmin=0price=math.random(40000000,41000000), sell=10gdzie="dohertysf"}, -- Esperanto
    2118.77, -1130.1325.00314.7model=533dmax=0dmin=0price=math.random(34000000,35000000), sell=10gdzie="dohertysf"}, -- Feltzer
    2118.64, -1136.7324.85309.5model=518dmax=0dmin=0price=math.random(36999999,37500000), sell=10gdzie="dohertysf"}, -- Buccaneer
    2118.47, -1143.2724.50310.6model=467dmax=0dmin=0price=math.random(33500000,34200000), sell=10gdzie="dohertysf"}, -- Oceanic

    -- Salon Doherty SF
    { -1946.31265.1635.1842.4model=411dmax=0dmin=0price=math.random(75000000,76000000), sell=10gdzie="unikat3"}, -- infek
    { -1950.23258.6935.0727.0model=541dmax=0dmin=0price=math.random(64000000,65000000), sell=10gdzie="unikat3"}, -- turek
    { -1956.85259.0735.12349.2model=451dmax=0dmin=0price=math.random(55000000,56000000), sell=10gdzie="unikat3"}, -- bullet



    -- Salon ci??arowy LS
    { -30.03, -1123.271.27129.5model=456dmax=0dmin=0price=math.random(6400000,6600000), sell=10gdzie="dohertysf"}, -- yankee
    { -37.12, -1119.021.19130.5model=414dmax=0dmin=0price=math.random(5200000,5400000), sell=10gdzie="dohertysf"}, -- mule
    { -42.92, -1116.221.19131.5model=413dmax=0dmin=0price=math.random(3500000,3600000), sell=10gdzie="dohertysf"}, -- pony 
    { -49.41, -1114.031.24135.7model=482dmax=0dmin=0price=math.random(3500000,3600000), sell=10gdzie="dohertysf"}, -- burrito
     { -57.62, -1144.761.5615.6model=455dmax=0dmin=0price=math.random(11200000,11400000), sell=10gdzie="dohertysf"}, -- Flatbed
    { -66.51, -1143.571.1910.7model=609dmax=0dmin=0price=math.random(5200000,8400000), sell=10gdzie="dohertysf"}, -- Black Boxville


    { -75.82, -1108.102.14183.6model=515dmax=0dmin=0price=math.random(13200000,13400000), sell=10gdzie="dohertysf"}, -- Roadtrain
    { -60.37, -1112.501.71130.7model=514dmax=0dmin=0price=math.random(14200000,14300000), sell=10gdzie="dohertysf"}, -- tanker
    { -39.87, -1141.181.6865.1model=450dmax=0dmin=0price=math.random(8200000,9300000), sell=10gdzie="dohertysf"}, -- przyczepa
    { -42.60, -1147.601.6866.0model=591dmax=0dmin=0price=math.random(8200000,9300000), sell=10gdzie="dohertysf"}, -- przyczepa2







    -- Salon ariport
    1880.39, -2262.3414.23320.4model=487dmax=0dmin=0price=math.random(88000000,89000000), sell=10gdzie="unikat3"}, -- Maverick
    1861.67, -2262.3514.07320.8model=469dmax=0dmin=0price=math.random(86000000,87000000), sell=10gdzie="unikat3"}, -- sparrow
    1860.83, -2237.2714.52233.1model=593dmax=0dmin=0price=math.random(85000000,87000000), sell=10gdzie="unikat3"}, -- dodo
    1881.23, -2237.8014.60140.3model=513dmax=0dmin=0price=math.random(86000000,87000000), sell=10gdzie="unikat3"}, -- dodo


    
    
    
}

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 (plrcmd)
    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 s vehicles[slot].sell
    local price vehicles[slot].price
    local money getPlayerMoney(plr)
    if price money  then
    if price s-1  then
        triggerClientEvent(plr"onClientAddNotification"plr,"* Nie sta? ci? na kupno tego pojazdu. Id? zar?b na pracach dorywczych i wr?c p??niej!")
        else
        triggerClientEvent(plr"onClientAddNotification"plr,"* Nie ma ju? dost?pnych aut. Wr?c p??niej!")
        return
    end
end
    takePlayerMoney(plrprices-1)

    local x,y,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,b1r2,g2,b2r3,g3,b3r4,g4,b4 getVehicleColor(vehtrue)
    local color r1..", "..g1..", "..b1..", "..r2..", "..g2..", "..b2

    local owner getElementData(plr"player:uid")
    local model getElementModel(veh)
    local dist vehicles[slot].mileage
    local poj vehicles[slot].poj
    local rodzaj vehicles[slot].rodzaj
    local gdzie vehicles[slot].gdzie

    destroyElement(veh)
    setElementData(shape"komis:veh"false)
    setElementData(shape"salonowe"false)

    local qnumid exports["tiyl-db"]:dbGet("INSERT INTO tiyl_pojazdy SET pos=?, fuel=15, gas=25, bak=100, mileage=?, ownedPlayer=?, parking=1, pojemnosc=?, rodzaj=?, color=?, model=?"posdistownerpojrodzajcolormodel)
    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, 250, 1, slot) return end

    vehicles[slot] = {}

    vehicles[slot].mileage math.random(slots[slot].dminslots[slot].dmax)
    vehicles[slot].price slots[slot].price
    vehicles[slot].sell slots[slot].sell

    vehicles[slot].veh createVehicle(slots[slot].modelslots[slot][1], slots[slot][2], slots[slot][3], 00slots[slot][4], slots[slot][5])
    setElementFrozen(vehicles[slot].vehtrue)
    setVehicleDamageProof(vehicles[slot].vehtrue)
    setVehicleLocked(vehicles[slot].vehtrue)

    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)
    setVehicleColor(vehicles[slot].vehmath.random(0,255),math.random(0,255),math.random(0,255))
    setVehicleHeadLightColor(vehicles[slot].veh255550)

    if slots[slot].gdzie == "dohertysf" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(3,4)
    vehicles[slot].gdzie "dohertysf"
    elseif slots[slot].gdzie == "dohertysf2" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(4,5)
    vehicles[slot].gdzie "dohertysf2"
    elseif slots[slot].gdzie == "cygan" then
    vehicles[slot].rodzaj "LPG"
    vehicles[slot].poj math.random(1,2)
    vehicles[slot].gdzie "cygan"
    elseif slots[slot].gdzie == "sf" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(5,6)
    vehicles[slot].gdzie "unikat"
    elseif slots[slot].gdzie == "unikat" then
    vehicles[slot].rodzaj "Benzyna"
    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,10)
    vehicles[slot].gdzie "unikat2"
    elseif slots[slot].gdzie == "unikat3" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(11,12)
    vehicles[slot].gdzie "unikat3"
    end

    if vehicles[slot].poj == 1 then
    vehicles[slot].poj2 1.2
    elseif vehicles[slot].poj == 2 then
    vehicles[slot].poj2 1.6
    elseif vehicles[slot].poj == 3 then
    vehicles[slot].poj2 1.8
    elseif vehicles[slot].poj == 4 then
    vehicles[slot].poj2 2.0
    elseif vehicles[slot].poj == 5 then
    vehicles[slot].poj2 2.2
    elseif vehicles[slot].poj == 6 then
    vehicles[slot].poj2 2.5
    elseif vehicles[slot].poj == 7 then
    vehicles[slot].poj2 2.6
    elseif vehicles[slot].poj == 8 then
    vehicles[slot].poj2 2.7
    elseif vehicles[slot].poj == 9 then
    vehicles[slot].poj2 2.8
    elseif vehicles[slot].poj == 10 then
    vehicles[slot].poj2 2.9
    elseif vehicles[slot].poj == 11 then
    vehicles[slot].poj2 3.0
    elseif vehicles[slot].poj == 12 then
    vehicles[slot].poj2 3.1
    end

    setElementData(vehicles[slot].veh"vehicle:desc""---------\nPojazd: "..getVehicleName(vehicles[slot].veh).."\nKoszt: "..slots[slot].price.." PLN\nPrzebieg: "..vehicles[slot].mileage.." km\nPojemno?? Silnika: "..vehicles[slot].poj2.." cm3\nRodzaj paliwa: "..vehicles[slot].rodzaj.."\nPojemno?? Baku: 100 L\nDost?pne Sztuki: "..vehicles[slot].sell.."\nZainteresowa? ci? ten pojazd? /kuppojazd\n---------")
end

function isPlayerInVehicleColShape(player)
    for i,v in ipairs(komis_shapes) do
        if isElementWithinColShape(playervthen return v end
    end
    return false
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 10:33


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

e-data "komis:slot" to jest e-data na te sztuki pojazd?w?

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 10:35


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

"Wercio." napisał/a:

e-data "komis:slot" to jest e-data na te sztuki pojazd?w?

nie. Tylko to vehicles[slot].sell

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 10:38


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Zobacz
--[[
    Komisy samochodowe
    @author value <value2k@gmail.com>
    @EditDylemaT929 :)
    Nie masz prawa u?ytego kodu bez mojej zgody
]]
createBlip(2159.99, -1796.7813.3655,2,0,0,0,0,0,275) --- ls motory
createBlip(2928.03, -797.1611.5355,2,0,0,0,0,0,275) --- ls sportowy
createBlip(2126.78, -1130.2525.5255,2,0,0,0,0,0,275) --- ls terenowe
createBlip(-79.37, -1575.672.6155,2,0,0,0,0,0,275) --- ls cygan
createBlip(1605.93, -2174.9013.5955,2,0,0,0,0,0,275)
createBlip(-72.90, -1130.971.1255,2,0,0,0,0,0,275)


local vehicles = {}
local komis_shapes = {}
local slots = {
    -- Doherty Diesel
    1581.42, -2170.1913.37244.8model=401dmax=0dmin=0price=math.random(2000000,2100000), sell=10gdzie="dohertysf"}, -- Bravura
    1581.68, -2179.7413.36296.4model=436dmax=0dmin=0price=math.random(1500000,1700000), sell=10gdzie="dohertysf"}, -- Previon
    1594.50, -2170.1013.21153.1model=565dmax=0dmin=0price=math.random(22300000,24500000), sell=10gdzie="dohertysf"}, -- flash
    1603.38, -2170.9113.39151.6model=475dmax=0dmin=0price=math.random(5300000,5700000), sell=10gdzie="dohertysf"}, -- Szabla
    1621.03, -2164.3613.42146.0model=402dmax=0dmin=0price=math.random(2400000,2500000), sell=10gdzie="dohertysf"}, -- Mg?awica
    1613.63, -2163.7213.44155.4model=517dmax=0dmin=0price=math.random(2100000,2200000), sell=10gdzie="dohertysf"}, -- majestic
    1630.04, -2179.8513.3541.9model=526dmax=0dmin=0price=math.random(4100000,4200000), sell=10gdzie="dohertysf"}, -- Fortuna
    1622.80, -2180.9013.2236.6model=529dmax=0dmin=0price=math.random(6900000,7000000), sell=10gdzie="dohertysf"}, -- Williard
    1627.87, -2164.0613.30141.6model=600dmax=0dmin=0price=math.random(1200000,1300000), sell=10gdzie="dohertysf"}, -- Picador
    1615.47, -2179.9913.3332.6model=426dmax=0dmin=0price=math.random(7500000,7600000), sell=10gdzie="dohertysf"}, -- Premier
    1615.01, -2150.0913.94182.6model=495dmax=0dmin=0price=math.random(4100000,4200000), sell=10gdzie="dohertysf"}, -- Sanking
    1608.54, -2180.5313.3949.6model=602dmax=0dmin=0price=math.random(15500000,15600000), sell=10gdzie="dohertysf"}, -- Alpha
    
        
    -- Doherty Indlewood
    2187.74, -1805.1812.940.1model=522dmax=0dmin=0price=math.random(31000000,32000000), sell=10gdzie="sf"}, -- NRG-500
    2181.77, -1805.3012.952.9model=461dmax=0dmin=0price=math.random(17000000,17000000), sell=10gdzie="sf"}, -- PCJ-600
    2175.15, -1805.8512.942.6model=521dmax=0dmin=0price=math.random(20000000,21000000), sell=10gdzie="sf"}, -- FCR-900
    2163.73, -1805.8613.04359.6model=468dmax=0dmin=0price=math.random(15523900,16152410), sell=10gdzie="sf"}, -- Sanchez
    2169.24, -1806.1112.970.4model=581dmax=0dmin=0price=math.random(12890000,13893000), sell=10gdzie="sf"}, -- Bf-400
    2157.95, -1806.1612.904.4model=586dmax=0dmin=0price=math.random(26000000,27972000), sell=10gdzie="sf"}, -- Wayfarer
    
    -- Cygan LPG
    {-101.63, -1586.672.27277.4model=410dmax=99343dmin=97323price=math.random(321000,322000), sell=10gdzie="cygan"}, -- manana
    {-82.04, -1551.392.49177.3model=458dmax=99343dmin=97323price=math.random(390000,400000), sell=10gdzie="cygan"}, -- Solair
    {-59.55, -1552.622.70120.5model=418dmax=100343dmin=97323price=math.random(150000,150000), sell=10gdzie="cygan"}, -- Moonbeam
    {-52.18, -1576.542.4827.9model=543dmax=101343dmin=97000price=math.random(520000,521000), sell=10gdzie="cygan"}, -- Sadler
    {-96.20, -1594.922.61277.3model=478dmax=111343dmin=107333price=math.random(112000,113000), sell=10gdzie="cygan"}, -- walton
    {-78.70, -1601.482.35278.8model=404dmax=118343dmin=116333price=math.random(600000,601000), sell=10gdzie="cygan"}, -- perek
    
    -- Salon Downtown SF Benzyna
    {2958.58, -783.8711.57137.6model=480dmax=0dmin=0price=math.random(27000000,28000000), sell=10gdzie="sf"}, -- Comet
    {2966.33, -784.1411.50148.8model=506dmax=0dmin=0price=math.random(30000000,31000000), sell=10gdzie="unikat"}, -- sgt
    {2945.67, -803.6111.45147.4model=559dmax=0dmin=0price=math.random(32000000,33000000), sell=10gdzie="sf"}, -- jester
    {2973.12, -832.8011.5063.9model=560dmax=0dmin=0price=math.random(58000000,59000000), sell=10gdzie="unikat"}, -- Su?tan
    {-1676.951207.0713.31,253model=587dmax=0dmin=0price=math.random(24000000,25111111), sell=10gdzie="sf"}, -- euros
    {2975.18, -783.9011.57146.0model=415dmax=0dmin=0price=math.random(70000000,71000000), sell=10gdzie="sf"}, --chetah
    {2954.17, -804.1311.48145.5model=429dmax=0dmin=0price=math.random(39000000,40000000), sell=10gdzie="sf"}, -- Bansheee
    {2945.96, -833.3111.46289.7model=562dmax=0dmin=0price=math.random(47000000,48000000), sell=10gdzie="sf"}, -- Elegy
    {2948.24, -783.7811.61140.4model=545dmax=0dmin=0price=math.random(62000000,63000000), sell=10gdzie="sf"}, -- Hustler

    -- Salon Jefferson
    2136.00, -1129.7725.5152.7model=567dmax=0dmin=0price=math.random(31000000,32000000), sell=10gdzie="dohertysf"}, -- Savanna
    2135.74, -1136.0225.2850.8model=576dmax=0dmin=0price=math.random(32750000,34000000), sell=10gdzie="dohertysf"}, -- Tornado
    2136.03, -1142.6224.8648.7model=419dmax=0dmin=0price=math.random(40000000,41000000), sell=10gdzie="dohertysf"}, -- Esperanto
    2118.77, -1130.1325.00314.7model=533dmax=0dmin=0price=math.random(34000000,35000000), sell=10gdzie="dohertysf"}, -- Feltzer
    2118.64, -1136.7324.85309.5model=518dmax=0dmin=0price=math.random(36999999,37500000), sell=10gdzie="dohertysf"}, -- Buccaneer
    2118.47, -1143.2724.50310.6model=467dmax=0dmin=0price=math.random(33500000,34200000), sell=10gdzie="dohertysf"}, -- Oceanic

    -- Salon Doherty SF
    { -1946.31265.1635.1842.4model=411dmax=0dmin=0price=math.random(75000000,76000000), sell=10gdzie="unikat3"}, -- infek
    { -1950.23258.6935.0727.0model=541dmax=0dmin=0price=math.random(64000000,65000000), sell=10gdzie="unikat3"}, -- turek
    { -1956.85259.0735.12349.2model=451dmax=0dmin=0price=math.random(55000000,56000000), sell=10gdzie="unikat3"}, -- bullet



    -- Salon ci??arowy LS
    { -30.03, -1123.271.27129.5model=456dmax=0dmin=0price=math.random(6400000,6600000), sell=10gdzie="dohertysf"}, -- yankee
    { -37.12, -1119.021.19130.5model=414dmax=0dmin=0price=math.random(5200000,5400000), sell=10gdzie="dohertysf"}, -- mule
    { -42.92, -1116.221.19131.5model=413dmax=0dmin=0price=math.random(3500000,3600000), sell=10gdzie="dohertysf"}, -- pony 
    { -49.41, -1114.031.24135.7model=482dmax=0dmin=0price=math.random(3500000,3600000), sell=10gdzie="dohertysf"}, -- burrito
     { -57.62, -1144.761.5615.6model=455dmax=0dmin=0price=math.random(11200000,11400000), sell=10gdzie="dohertysf"}, -- Flatbed
    { -66.51, -1143.571.1910.7model=609dmax=0dmin=0price=math.random(5200000,8400000), sell=10gdzie="dohertysf"}, -- Black Boxville


    { -75.82, -1108.102.14183.6model=515dmax=0dmin=0price=math.random(13200000,13400000), sell=10gdzie="dohertysf"}, -- Roadtrain
    { -60.37, -1112.501.71130.7model=514dmax=0dmin=0price=math.random(14200000,14300000), sell=10gdzie="dohertysf"}, -- tanker
    { -39.87, -1141.181.6865.1model=450dmax=0dmin=0price=math.random(8200000,9300000), sell=10gdzie="dohertysf"}, -- przyczepa
    { -42.60, -1147.601.6866.0model=591dmax=0dmin=0price=math.random(8200000,9300000), sell=10gdzie="dohertysf"}, -- przyczepa2







    -- Salon ariport
    1880.39, -2262.3414.23320.4model=487dmax=0dmin=0price=math.random(88000000,89000000), sell=10gdzie="unikat3"}, -- Maverick
    1861.67, -2262.3514.07320.8model=469dmax=0dmin=0price=math.random(86000000,87000000), sell=10gdzie="unikat3"}, -- sparrow
    1860.83, -2237.2714.52233.1model=593dmax=0dmin=0price=math.random(85000000,87000000), sell=10gdzie="unikat3"}, -- dodo
    1881.23, -2237.8014.60140.3model=513dmax=0dmin=0price=math.random(86000000,87000000), sell=10gdzie="unikat3"}, -- dodo


    
    
    
}

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 (plrcmd)
    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 s vehicles[slot].sell
    local price vehicles[slot].price
    local money getPlayerMoney(plr)
    if price money  then
    if price s-1  then
        triggerClientEvent(plr"onClientAddNotification"plr,"* Nie sta? ci? na kupno tego pojazdu. Id? zar?b na pracach dorywczych i wr?c p??niej!")
        else
        triggerClientEvent(plr"onClientAddNotification"plr,"* Nie ma ju? dost?pnych aut. Wr?c p??niej!")
        return
    end
end
    takePlayerMoney(plrprices-1)

    local x,y,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,b1r2,g2,b2r3,g3,b3r4,g4,b4 getVehicleColor(vehtrue)
    local color r1..", "..g1..", "..b1..", "..r2..", "..g2..", "..b2

    local owner getElementData(plr"player:uid")
    local model getElementModel(veh)
    local dist vehicles[slot].mileage
    local poj vehicles[slot].poj
    local rodzaj vehicles[slot].rodzaj
    local gdzie vehicles[slot].gdzie

    destroyElement(veh)
    setElementData(shape"komis:veh"false)
    setElementData(shape"salonowe"false)

    local qnumid exports["tiyl-db"]:dbGet("INSERT INTO tiyl_pojazdy SET pos=?, fuel=15, gas=25, bak=100, mileage=?, ownedPlayer=?, parking=1, pojemnosc=?, rodzaj=?, color=?, model=?"posdistownerpojrodzajcolormodel)
    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)
        setElementData(plr"pojazd:sell"vehicles[slot].sell-1)
    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, 250, 1, slot) return end

    vehicles[slot] = {}

    vehicles[slot].mileage math.random(slots[slot].dminslots[slot].dmax)
    vehicles[slot].price slots[slot].price
    vehicles[slot].sell slots[slot].sell

    vehicles[slot].veh createVehicle(slots[slot].modelslots[slot][1], slots[slot][2], slots[slot][3], 00slots[slot][4], slots[slot][5])
    setElementFrozen(vehicles[slot].vehtrue)
    setVehicleDamageProof(vehicles[slot].vehtrue)
    setVehicleLocked(vehicles[slot].vehtrue)

    setElementData(komis_shapes[slot], "komis:veh"vehicles[slot].veh)
    setElementData(komis_shapes[slot], "komis:slot"slot)
    setElementData(komis_shapes[slot], "pojazd:slot"vehicles[slot].sell)
    setElementData(vehicles[slot].veh"komis:veh"true)
    setElementData(vehicles[slot].veh"salonowe"true)
    setVehicleOverrideLights vehicles[slot].veh)
    setVehicleColor(vehicles[slot].vehmath.random(0,255),math.random(0,255),math.random(0,255))
    setVehicleHeadLightColor(vehicles[slot].veh255550)

    if slots[slot].gdzie == "dohertysf" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(3,4)
    vehicles[slot].gdzie "dohertysf"
    elseif slots[slot].gdzie == "dohertysf2" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(4,5)
    vehicles[slot].gdzie "dohertysf2"
    elseif slots[slot].gdzie == "cygan" then
    vehicles[slot].rodzaj "LPG"
    vehicles[slot].poj math.random(1,2)
    vehicles[slot].gdzie "cygan"
    elseif slots[slot].gdzie == "sf" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(5,6)
    vehicles[slot].gdzie "unikat"
    elseif slots[slot].gdzie == "unikat" then
    vehicles[slot].rodzaj "Benzyna"
    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,10)
    vehicles[slot].gdzie "unikat2"
    elseif slots[slot].gdzie == "unikat3" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(11,12)
    vehicles[slot].gdzie "unikat3"
    end

    if vehicles[slot].poj == 1 then
    vehicles[slot].poj2 1.2
    elseif vehicles[slot].poj == 2 then
    vehicles[slot].poj2 1.6
    elseif vehicles[slot].poj == 3 then
    vehicles[slot].poj2 1.8
    elseif vehicles[slot].poj == 4 then
    vehicles[slot].poj2 2.0
    elseif vehicles[slot].poj == 5 then
    vehicles[slot].poj2 2.2
    elseif vehicles[slot].poj == 6 then
    vehicles[slot].poj2 2.5
    elseif vehicles[slot].poj == 7 then
    vehicles[slot].poj2 2.6
    elseif vehicles[slot].poj == 8 then
    vehicles[slot].poj2 2.7
    elseif vehicles[slot].poj == 9 then
    vehicles[slot].poj2 2.8
    elseif vehicles[slot].poj == 10 then
    vehicles[slot].poj2 2.9
    elseif vehicles[slot].poj == 11 then
    vehicles[slot].poj2 3.0
    elseif vehicles[slot].poj == 12 then
    vehicles[slot].poj2 3.1
    end

    setElementData(vehicles[slot].veh"vehicle:desc""---------\nPojazd: "..getVehicleName(vehicles[slot].veh).."\nKoszt: "..slots[slot].price.." PLN\nPrzebieg: "..vehicles[slot].mileage.." km\nPojemno?? Silnika: "..vehicles[slot].poj2.." cm3\nRodzaj paliwa: "..vehicles[slot].rodzaj.."\nPojemno?? Baku: 100 L\nDost?pne Sztuki: "..vehicles[slot].sell.."\nZainteresowa? ci? ten pojazd? /kuppojazd\n---------")
end

function isPlayerInVehicleColShape(player)
    for i,v in ipairs(komis_shapes) do
        if isElementWithinColShape(playervthen return v end
    end
    return false
end


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 10:41


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

"Wercio." napisał/a:

Zobacz
--[[
    Komisy samochodowe
    @author value <value2k@gmail.com>
    @EditDylemaT929 :)
    Nie masz prawa u?ytego kodu bez mojej zgody
]]
createBlip(2159.99, -1796.7813.3655,2,0,0,0,0,0,275) --- ls motory
createBlip(2928.03, -797.1611.5355,2,0,0,0,0,0,275) --- ls sportowy
createBlip(2126.78, -1130.2525.5255,2,0,0,0,0,0,275) --- ls terenowe
createBlip(-79.37, -1575.672.6155,2,0,0,0,0,0,275) --- ls cygan
createBlip(1605.93, -2174.9013.5955,2,0,0,0,0,0,275)
createBlip(-72.90, -1130.971.1255,2,0,0,0,0,0,275)


local vehicles = {}
local komis_shapes = {}
local slots = {
    -- Doherty Diesel
    1581.42, -2170.1913.37244.8model=401dmax=0dmin=0price=math.random(2000000,2100000), sell=10gdzie="dohertysf"}, -- Bravura
    1581.68, -2179.7413.36296.4model=436dmax=0dmin=0price=math.random(1500000,1700000), sell=10gdzie="dohertysf"}, -- Previon
    1594.50, -2170.1013.21153.1model=565dmax=0dmin=0price=math.random(22300000,24500000), sell=10gdzie="dohertysf"}, -- flash
    1603.38, -2170.9113.39151.6model=475dmax=0dmin=0price=math.random(5300000,5700000), sell=10gdzie="dohertysf"}, -- Szabla
    1621.03, -2164.3613.42146.0model=402dmax=0dmin=0price=math.random(2400000,2500000), sell=10gdzie="dohertysf"}, -- Mg?awica
    1613.63, -2163.7213.44155.4model=517dmax=0dmin=0price=math.random(2100000,2200000), sell=10gdzie="dohertysf"}, -- majestic
    1630.04, -2179.8513.3541.9model=526dmax=0dmin=0price=math.random(4100000,4200000), sell=10gdzie="dohertysf"}, -- Fortuna
    1622.80, -2180.9013.2236.6model=529dmax=0dmin=0price=math.random(6900000,7000000), sell=10gdzie="dohertysf"}, -- Williard
    1627.87, -2164.0613.30141.6model=600dmax=0dmin=0price=math.random(1200000,1300000), sell=10gdzie="dohertysf"}, -- Picador
    1615.47, -2179.9913.3332.6model=426dmax=0dmin=0price=math.random(7500000,7600000), sell=10gdzie="dohertysf"}, -- Premier
    1615.01, -2150.0913.94182.6model=495dmax=0dmin=0price=math.random(4100000,4200000), sell=10gdzie="dohertysf"}, -- Sanking
    1608.54, -2180.5313.3949.6model=602dmax=0dmin=0price=math.random(15500000,15600000), sell=10gdzie="dohertysf"}, -- Alpha
    
        
    -- Doherty Indlewood
    2187.74, -1805.1812.940.1model=522dmax=0dmin=0price=math.random(31000000,32000000), sell=10gdzie="sf"}, -- NRG-500
    2181.77, -1805.3012.952.9model=461dmax=0dmin=0price=math.random(17000000,17000000), sell=10gdzie="sf"}, -- PCJ-600
    2175.15, -1805.8512.942.6model=521dmax=0dmin=0price=math.random(20000000,21000000), sell=10gdzie="sf"}, -- FCR-900
    2163.73, -1805.8613.04359.6model=468dmax=0dmin=0price=math.random(15523900,16152410), sell=10gdzie="sf"}, -- Sanchez
    2169.24, -1806.1112.970.4model=581dmax=0dmin=0price=math.random(12890000,13893000), sell=10gdzie="sf"}, -- Bf-400
    2157.95, -1806.1612.904.4model=586dmax=0dmin=0price=math.random(26000000,27972000), sell=10gdzie="sf"}, -- Wayfarer
    
    -- Cygan LPG
    {-101.63, -1586.672.27277.4model=410dmax=99343dmin=97323price=math.random(321000,322000), sell=10gdzie="cygan"}, -- manana
    {-82.04, -1551.392.49177.3model=458dmax=99343dmin=97323price=math.random(390000,400000), sell=10gdzie="cygan"}, -- Solair
    {-59.55, -1552.622.70120.5model=418dmax=100343dmin=97323price=math.random(150000,150000), sell=10gdzie="cygan"}, -- Moonbeam
    {-52.18, -1576.542.4827.9model=543dmax=101343dmin=97000price=math.random(520000,521000), sell=10gdzie="cygan"}, -- Sadler
    {-96.20, -1594.922.61277.3model=478dmax=111343dmin=107333price=math.random(112000,113000), sell=10gdzie="cygan"}, -- walton
    {-78.70, -1601.482.35278.8model=404dmax=118343dmin=116333price=math.random(600000,601000), sell=10gdzie="cygan"}, -- perek
    
    -- Salon Downtown SF Benzyna
    {2958.58, -783.8711.57137.6model=480dmax=0dmin=0price=math.random(27000000,28000000), sell=10gdzie="sf"}, -- Comet
    {2966.33, -784.1411.50148.8model=506dmax=0dmin=0price=math.random(30000000,31000000), sell=10gdzie="unikat"}, -- sgt
    {2945.67, -803.6111.45147.4model=559dmax=0dmin=0price=math.random(32000000,33000000), sell=10gdzie="sf"}, -- jester
    {2973.12, -832.8011.5063.9model=560dmax=0dmin=0price=math.random(58000000,59000000), sell=10gdzie="unikat"}, -- Su?tan
    {-1676.951207.0713.31,253model=587dmax=0dmin=0price=math.random(24000000,25111111), sell=10gdzie="sf"}, -- euros
    {2975.18, -783.9011.57146.0model=415dmax=0dmin=0price=math.random(70000000,71000000), sell=10gdzie="sf"}, --chetah
    {2954.17, -804.1311.48145.5model=429dmax=0dmin=0price=math.random(39000000,40000000), sell=10gdzie="sf"}, -- Bansheee
    {2945.96, -833.3111.46289.7model=562dmax=0dmin=0price=math.random(47000000,48000000), sell=10gdzie="sf"}, -- Elegy
    {2948.24, -783.7811.61140.4model=545dmax=0dmin=0price=math.random(62000000,63000000), sell=10gdzie="sf"}, -- Hustler

    -- Salon Jefferson
    2136.00, -1129.7725.5152.7model=567dmax=0dmin=0price=math.random(31000000,32000000), sell=10gdzie="dohertysf"}, -- Savanna
    2135.74, -1136.0225.2850.8model=576dmax=0dmin=0price=math.random(32750000,34000000), sell=10gdzie="dohertysf"}, -- Tornado
    2136.03, -1142.6224.8648.7model=419dmax=0dmin=0price=math.random(40000000,41000000), sell=10gdzie="dohertysf"}, -- Esperanto
    2118.77, -1130.1325.00314.7model=533dmax=0dmin=0price=math.random(34000000,35000000), sell=10gdzie="dohertysf"}, -- Feltzer
    2118.64, -1136.7324.85309.5model=518dmax=0dmin=0price=math.random(36999999,37500000), sell=10gdzie="dohertysf"}, -- Buccaneer
    2118.47, -1143.2724.50310.6model=467dmax=0dmin=0price=math.random(33500000,34200000), sell=10gdzie="dohertysf"}, -- Oceanic

    -- Salon Doherty SF
    { -1946.31265.1635.1842.4model=411dmax=0dmin=0price=math.random(75000000,76000000), sell=10gdzie="unikat3"}, -- infek
    { -1950.23258.6935.0727.0model=541dmax=0dmin=0price=math.random(64000000,65000000), sell=10gdzie="unikat3"}, -- turek
    { -1956.85259.0735.12349.2model=451dmax=0dmin=0price=math.random(55000000,56000000), sell=10gdzie="unikat3"}, -- bullet



    -- Salon ci??arowy LS
    { -30.03, -1123.271.27129.5model=456dmax=0dmin=0price=math.random(6400000,6600000), sell=10gdzie="dohertysf"}, -- yankee
    { -37.12, -1119.021.19130.5model=414dmax=0dmin=0price=math.random(5200000,5400000), sell=10gdzie="dohertysf"}, -- mule
    { -42.92, -1116.221.19131.5model=413dmax=0dmin=0price=math.random(3500000,3600000), sell=10gdzie="dohertysf"}, -- pony 
    { -49.41, -1114.031.24135.7model=482dmax=0dmin=0price=math.random(3500000,3600000), sell=10gdzie="dohertysf"}, -- burrito
     { -57.62, -1144.761.5615.6model=455dmax=0dmin=0price=math.random(11200000,11400000), sell=10gdzie="dohertysf"}, -- Flatbed
    { -66.51, -1143.571.1910.7model=609dmax=0dmin=0price=math.random(5200000,8400000), sell=10gdzie="dohertysf"}, -- Black Boxville


    { -75.82, -1108.102.14183.6model=515dmax=0dmin=0price=math.random(13200000,13400000), sell=10gdzie="dohertysf"}, -- Roadtrain
    { -60.37, -1112.501.71130.7model=514dmax=0dmin=0price=math.random(14200000,14300000), sell=10gdzie="dohertysf"}, -- tanker
    { -39.87, -1141.181.6865.1model=450dmax=0dmin=0price=math.random(8200000,9300000), sell=10gdzie="dohertysf"}, -- przyczepa
    { -42.60, -1147.601.6866.0model=591dmax=0dmin=0price=math.random(8200000,9300000), sell=10gdzie="dohertysf"}, -- przyczepa2







    -- Salon ariport
    1880.39, -2262.3414.23320.4model=487dmax=0dmin=0price=math.random(88000000,89000000), sell=10gdzie="unikat3"}, -- Maverick
    1861.67, -2262.3514.07320.8model=469dmax=0dmin=0price=math.random(86000000,87000000), sell=10gdzie="unikat3"}, -- sparrow
    1860.83, -2237.2714.52233.1model=593dmax=0dmin=0price=math.random(85000000,87000000), sell=10gdzie="unikat3"}, -- dodo
    1881.23, -2237.8014.60140.3model=513dmax=0dmin=0price=math.random(86000000,87000000), sell=10gdzie="unikat3"}, -- dodo


    
    
    
}

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 (plrcmd)
    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 s vehicles[slot].sell
    local price vehicles[slot].price
    local money getPlayerMoney(plr)
    if price money  then
    if price s-1  then
        triggerClientEvent(plr"onClientAddNotification"plr,"* Nie sta? ci? na kupno tego pojazdu. Id? zar?b na pracach dorywczych i wr?c p??niej!")
        else
        triggerClientEvent(plr"onClientAddNotification"plr,"* Nie ma ju? dost?pnych aut. Wr?c p??niej!")
        return
    end
end
    takePlayerMoney(plrprices-1)

    local x,y,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,b1r2,g2,b2r3,g3,b3r4,g4,b4 getVehicleColor(vehtrue)
    local color r1..", "..g1..", "..b1..", "..r2..", "..g2..", "..b2

    local owner getElementData(plr"player:uid")
    local model getElementModel(veh)
    local dist vehicles[slot].mileage
    local poj vehicles[slot].poj
    local rodzaj vehicles[slot].rodzaj
    local gdzie vehicles[slot].gdzie

    destroyElement(veh)
    setElementData(shape"komis:veh"false)
    setElementData(shape"salonowe"false)

    local qnumid exports["tiyl-db"]:dbGet("INSERT INTO tiyl_pojazdy SET pos=?, fuel=15, gas=25, bak=100, mileage=?, ownedPlayer=?, parking=1, pojemnosc=?, rodzaj=?, color=?, model=?"posdistownerpojrodzajcolormodel)
    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)
        setElementData(plr"pojazd:sell"vehicles[slot].sell-1)
    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, 250, 1, slot) return end

    vehicles[slot] = {}

    vehicles[slot].mileage math.random(slots[slot].dminslots[slot].dmax)
    vehicles[slot].price slots[slot].price
    vehicles[slot].sell slots[slot].sell

    vehicles[slot].veh createVehicle(slots[slot].modelslots[slot][1], slots[slot][2], slots[slot][3], 00slots[slot][4], slots[slot][5])
    setElementFrozen(vehicles[slot].vehtrue)
    setVehicleDamageProof(vehicles[slot].vehtrue)
    setVehicleLocked(vehicles[slot].vehtrue)

    setElementData(komis_shapes[slot], "komis:veh"vehicles[slot].veh)
    setElementData(komis_shapes[slot], "komis:slot"slot)
    setElementData(komis_shapes[slot], "pojazd:slot"vehicles[slot].sell)
    setElementData(vehicles[slot].veh"komis:veh"true)
    setElementData(vehicles[slot].veh"salonowe"true)
    setVehicleOverrideLights vehicles[slot].veh)
    setVehicleColor(vehicles[slot].vehmath.random(0,255),math.random(0,255),math.random(0,255))
    setVehicleHeadLightColor(vehicles[slot].veh255550)

    if slots[slot].gdzie == "dohertysf" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(3,4)
    vehicles[slot].gdzie "dohertysf"
    elseif slots[slot].gdzie == "dohertysf2" then
    vehicles[slot].rodzaj "Diesel"
    vehicles[slot].poj math.random(4,5)
    vehicles[slot].gdzie "dohertysf2"
    elseif slots[slot].gdzie == "cygan" then
    vehicles[slot].rodzaj "LPG"
    vehicles[slot].poj math.random(1,2)
    vehicles[slot].gdzie "cygan"
    elseif slots[slot].gdzie == "sf" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(5,6)
    vehicles[slot].gdzie "unikat"
    elseif slots[slot].gdzie == "unikat" then
    vehicles[slot].rodzaj "Benzyna"
    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,10)
    vehicles[slot].gdzie "unikat2"
    elseif slots[slot].gdzie == "unikat3" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(11,12)
    vehicles[slot].gdzie "unikat3"
    end

    if vehicles[slot].poj == 1 then
    vehicles[slot].poj2 1.2
    elseif vehicles[slot].poj == 2 then
    vehicles[slot].poj2 1.6
    elseif vehicles[slot].poj == 3 then
    vehicles[slot].poj2 1.8
    elseif vehicles[slot].poj == 4 then
    vehicles[slot].poj2 2.0
    elseif vehicles[slot].poj == 5 then
    vehicles[slot].poj2 2.2
    elseif vehicles[slot].poj == 6 then
    vehicles[slot].poj2 2.5
    elseif vehicles[slot].poj == 7 then
    vehicles[slot].poj2 2.6
    elseif vehicles[slot].poj == 8 then
    vehicles[slot].poj2 2.7
    elseif vehicles[slot].poj == 9 then
    vehicles[slot].poj2 2.8
    elseif vehicles[slot].poj == 10 then
    vehicles[slot].poj2 2.9
    elseif vehicles[slot].poj == 11 then
    vehicles[slot].poj2 3.0
    elseif vehicles[slot].poj == 12 then
    vehicles[slot].poj2 3.1
    end

    setElementData(vehicles[slot].veh"vehicle:desc""---------\nPojazd: "..getVehicleName(vehicles[slot].veh).."\nKoszt: "..slots[slot].price.." PLN\nPrzebieg: "..vehicles[slot].mileage.." km\nPojemno?? Silnika: "..vehicles[slot].poj2.." cm3\nRodzaj paliwa: "..vehicles[slot].rodzaj.."\nPojemno?? Baku: 100 L\nDost?pne Sztuki: "..vehicles[slot].sell.."\nZainteresowa? ci? ten pojazd? /kuppojazd\n---------")
end

function isPlayerInVehicleColShape(player)
    for i,v in ipairs(komis_shapes) do
        if isElementWithinColShape(playervthen return v end
    end
    return false
end


Dalej nie zabiera sztuk auta

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 10:44


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Zrobi?em b??d zmie? to
setElementData(plr"pojazd:sell"vehicles[slot].sell-1)
na to
setElementData(plr"pojazd:slot"vehicles[slot].sell-1)


Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-16, 10:47


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

niestety dalej nic. Zastanawia mnie jedna rzecz. Gdy zrobi? tak vehicles[slot].sell = slots[slot].sell-1 na start zabiera jedn? sztuk?

Ostatnio zmieniony przez killercycDDS 2018-08-16, 10:48, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Tagi: dostępne :: sztuki :: salonie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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