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

Wysłany: 2019-07-25, 11:54


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

Witam mam problem z salonami z paczki PSRPG. Gdy ustawiam auta w nowym miejsu one przestawiaj? si? jak chc? a nie jak ja im daje kordy :/ a 2 powodem jest to ?e gdy daje przebieg wy?szy ni? 50k salon nie dzia?a :/

SALON.lua
--[[
    Komisy samochodowe
    @author value <value2k@gmail.com>
    @EditDylemaT929 :)
    Nie masz prawa u?ytego kodu bez mojej zgody
]]
createBlip(-1959.59285.9135.4755,2,0,0,0,0,0,275) --- sf doherty zwykly
createBlip(-1641.251203.887.2555,2,0,0,0,0,0,275) --- sf downtown sportowy
createBlip(-1.061364.949.1755,2,0,0,0,0,0,275) --- cygan

local vehicles = {}
local komis_shapes = {}
local slots = {
--[[    
    {-1953.35306.5540.64537.40.0179.6model=521dmax=0dmin=0price=(25000000), gdzie="sf"}, -- FCR 900
    {-1956.45306.2840.64537.40.0179.8model=581dmax=0dmin=0price=(23000000), gdzie="sf"}, -- BF
    {-1952.58300.2640.5989.10.091.0model=463dmax=0dmin=0price=(4000000), gdzie="sf"}, -- Freeway
    {-1952.72295.7940.5989.10.088.4model=471dmax=0dmin=0price=(5000000), gdzie="sf"}, -- QuadBike
    {-1952.91291.2840.5989.10.091.0model=461dmax=0dmin=0price=(3200000), gdzie="sf"}, -- PCJ
    
    -- Salon LV Sportowy
    {-1662.961221.6513.2623000model=415dmax=0dmin=0,   price=(79000000), gdzie="dohertysf2"}, -- cheetah
    {-1649.001207.8913.34,650.00.0model=404dmax=0dmin=0price=(45500000), gdzie="dohertysf2"}, -- Sultan
    {-1649.991207.6020.78,650.00.0model=541dmax=0dmin=0price=(83200000), gdzie="dohertysf2"}, -- hto
    {-1663.461221.5020.86,2300.00.0model=451dmax=0dmin=0,price=(80200000), gdzie="dohertysf2"}, -- Turismo
    {-1665.561206.1420.98310.8360.0306.6model=587dmax=0dmin=0price=(51000000), gdzie="dohertysf2"}, -- euros
    {-1673.031206.3513.38310.8360.0300.6model=562dmax=0dmin=0price=(61500000), gdzie="dohertysf2"}, -- elegy
--]]

    -- Cygan 
    {4.651347.628.83359.40.0329.7model=410dmax=40000dmin=40000price=(3051), gdzie="cygan"}, -- Manana
    {25.041363.298.91359.7360.0103.4model=404dmax=40000dmin=40000price=(1985), gdzie="cygan"}, -- Solair
    {-26.341358.529.16359.2360.0132.2model=478dmax=40000dmin=40000price=(1512), gdzie="cygan"}, -- Walton
    {-21.051343.509.270.10.098.5model=418dmax=40000dmin=40000price=(1169), gdzie="cygan"}, -- Moonbeam
    {0.491388.789.00359.1360.0162.2model=543dmax=40000dmin=40000price=(4032), gdzie="cygan"}, -- Sadler
    {7.231376.039.08360.00.0134.7model=540dmax=40000dmin=40000price=(8135), gdzie="cygan"}, -- Vincent
    {-16.171385.118.89359.10.0144.4model=600dmax=40000dmin=40000price=(12314), gdzie="cygan"}, -- Picador
    
    -- Salon LV zwykly
    {-1.031227.7219.180.4360.0, -180model=445dmax=0dmin=0price=(35000000), gdzie="dohertysf"}, -- Admiral
    {-52.971226.3418.99359.6360.0268.2model=565dmax=0dmin=0price=(25000000), gdzie="dohertysf"}, -- Bravura
    {2.231227.5818.96359.7360.0180.3model=575dmax=0dmin=0price=(3700000), gdzie="dohertysf"}, -- brodway
    {5.461227.8019.13359.2360.0180.6model=518dmax=0dmin=0price=(45000000), gdzie="dohertysf"}, -- Buccaneer
    --{-1959.99304.1735.35537.4359.8180.5model=603dmax=0dmin=0price=(41000000), gdzie="dohertysf"}, -- phoenix
    --{-1955.37304.2135.35537.40.0179.4model=580dmax=0dmin=0price=(53000000), gdzie="dohertysf"}, -- stafford
    --{-1945.77273.3435.2989.1360.089.7model=561dmax=0dmin=0price=(35500000), gdzie="dohertysf"}, -- Stratum
    --{-1946.16268.8135.2989.1360.089.8model=495dmax=0dmin=0price=(60000000), gdzie="dohertysf"}, -- Sandking
    {-16.311211.8519.140.0360.01.7model=589dmax=0dmin=0price=(38500000), gdzie="dohertysf"}, -- Club
    {-19.501211.7719.15360.00.00.4model=551dmax=0dmin=0price=(47550000), gdzie="dohertysf"}, -- Merit
    --{-1953.90254.6335.2189.10.088.1model=536dmax=0dmin=0price=(43000000), gdzie="dohertysf"}, -- Blade
    {-29.491211.7519.17359.7360.0359.1model=507dmax=0dmin=0price=(40000000), gdzie="dohertysf"}, -- Elegant
    {-39.371211.4819.140.00.10.3model=474dmax=0dmin=0price=(38000000), gdzie="dohertysf"}, -- Hermes
    {-52.171216.4519.170.0360.0269.8model=545dmax=0dmin=0price=(35000000), gdzie="dohertysf"}, -- Hustler
    {-33.091226.5220.02344.813.3189.4model=475dmax=0dmin=0price=(40000000), gdzie="dohertysf"}, -- Sabre
    {-23.521226.8820.16340.6359.7179.2model=559dmax=0dmin=0price=(38000000), gdzie="dohertysf"}, -- Jester
    {-13.431228.0220.30343.7348.3176.2model=402dmax=0dmin=0price=(35000000), gdzie="dohertysf"}, -- Buffalo

}

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""info")
            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 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!""error")
        return
    end
    takePlayerMoney(plrprice)

    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: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

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

    local qnumid exports["pystories-db"]:dbGet("INSERT INTO pystories_vehicles SET pos=?, fuel=100, bak=100, mileage=?, ownedPlayer=?, parking=1, pojemnosc_silnika=?, rodzaj=?, color=?, model=?"posdistownerpojrodzajcolormodel)
    if q then
        createKomisVehicle(slot)
        triggerClientEvent(plr"onClientAddNotification"plr,"Gratulacje!\nZakupi?e? sw?j pierwszy lub kolejny pojazd na serwerze!\nPojazd zosta? przeniesiony do przechowywalni""info")
        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!""error")
    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])
    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].veh0,90,242)
    setVehicleHeadLightColor(vehicles[slot].veh255255255)

    if slots[slot].gdzie == "dohertysf" then --zwykly salon
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(2,3)
    vehicles[slot].gdzie "dohertysf"
    elseif slots[slot].gdzie == "dohertysf2" then -- sportowy salon
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(3,4)
    vehicles[slot].gdzie "dohertysf2"
    elseif slots[slot].gdzie == "cygan" then -- salon cygan
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(1,2)
    vehicles[slot].gdzie "cygan"
    elseif slots[slot].gdzie == "sf" then -- salon motory
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(2,3)
    elseif slots[slot].gdzie == "sf" then
    vehicles[slot].rodzaj "Benzyna"
    vehicles[slot].poj math.random(6,7)
    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""Pojazd na sprzeda?!\n\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")
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: 2019-07-27, 01:52


killercycDDS

Migacz






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

Piwa: 1659

Respekt: 22

daj zamiast -1953.35, 306.55, 40.64, 537.4, 0.0, 179.6 to -1953.35, 306.55, 40.64, 179.6 + podaj kod b??du w db3 jak dajesz wi?cej przebiegu ni? 50k

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-07-27, 16:53


DylemaT929

Nikt






Wiek: 28
Na forum: 4041 dni
Posty: 333
Nick w MP: dylemat929

Piwa: 3195

Respekt: 165,8
Respekt: 165,8Respekt: 165,8

Wyt?umacz? jak dzia?a ten salon
[lua]
{-1953.35, 306.55, 40.64, 537.4, 0.0, 179.6, model=521, dmax=0, dmin=0, price=(25000000), gdzie="sf"}, -- FCR 900p/lua]

pierwsze trzy kordy to pozycja pojazdu(x,y,z), kolejne trzy to s? rotacje pojazdu(xx, xy, xz), model(czyli szukasz infernusa, a infernus to 411 id), dmax(maksymalny przebieg), dmin(minimalny przebieg), price(czyli ile ma kosztowa? pojazd i tutaj musisz wpisa? od do czyli price={10000,50000}, gdzie(to zaznaczone pojemno?ci auta kt?re masz przepisane ni?ej). Musisz zastosowa? si? do tego co ja pisz? bo inaczej salon nie b?dzie dzia?a?. Pami?taj aby sprawdza? zawsze /debugscript 3 b??d salonu.

wpisuj?c /gp b?dziesz mia? pozycj? i rotacj? pojazdu.

Postaw piwo autorowi tego posta
 

 
Tagi: salon :: psrpg
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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