Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

Problem z skryptem ogrpg-salon


adikolos2000

Rekomendowane odpowiedzi

Opublikowano

witam mam problem z tym skryptem chce żeby się tpały do przecho ale jak kupie auto to nie mam w przecho proszę mi pomóc i coś w tym brakuje 

Spoiler

 

createBlip(1975.87, 2351.06, 10.82, 55,2,255,0,0,255,0,100)
createBlip(2230.36, 2043.48, 10.82, 55,2,255,0,0,255,0,100)
createBlip(173.23, 618.22, 5.56, 55,2,255,0,0,255,0,100)
createBlip(2119.67, 1397.23, 10.81, 55,2,255,0,0,255,0,100)
createBlip(2872.42, 2264.65, 10.81, 55,2,255,0,0,255,0,100)
createBlip(2560.42, 739.65, 10.81, 55,2,255,0,0,255,0,100)

local positionVehicles = {

      --{'NAZWA',ID, math.random(0,10), CENA, 2886.20, 2257.11, 10.75, 359.36, 359.93, 43.58},

--      CYGAN
      {'Moonbeam', 418, math.random(51718,82719), math.random(3800,4000), 2235.03, 2050.32, 10.91, 0.1, 0.0, 89.5},
      {'Walton', 478, math.random(51718,82719), math.random(3800,4000), 2235.07, 2042.38, 10.81, 359.2, 360.0, 89.9},
      {'Sadler', 543, math.random(51718,82719), math.random(8800,9000), 2246.52, 2042.51, 10.64, 359.0, 0.0, 269.8},
      {'Perennial', 404, math.random(51718,82719), math.random(3800,4000), 2235.24, 2034.73, 10.56, 359.7, 0.0, 90.1},
      {'Manana', 410, math.random(51718,82719), math.random(4800,5000), 2246.01, 2050.19, 10.47, 359.4, 0.0, 269.5}, 
      {'Nebula', 516, math.random(51718,82719), math.random(10000,10200), 2246.58, 2034.83, 10.65, 360.0, 0.0, 269.9},
      {'Oceanic', 467, math.random(51718,82719), math.random(14800,15000), 2233.08, 2063.76, 10.56, 0.0, 0.0, 179.9},
      {'Glendale', 466, math.random(51718,82719), math.random(11800,12000), 2241.49, 2063.93, 10.56, 0.0, 360.0, 180.1},
      {'Bobcat', 422, math.random(51718,82719), math.random(13800,14000), 2249.84, 2063.91, 10.80, 359.1, 360.0, 179.5},
      {'Picador', 600, math.random(31718,52719), math.random(19800,20000), 2258.31, 2063.99, 10.53, 359.1, 360.0, 180.7},
      {'Vincent', 540, math.random(31718,52719), math.random(23000,23200), 2217.24, 2059.46, 10.68, 359.72, 360.00, 270.37},
      {'Clover', 542, math.random(31718,52719), math.random(15000,15200), 2217.64, 2052.34, 10.56, 0.04, 360.00, 269.17},    
      {'Tampa', 549, math.random(31718,52719), math.random(16000,16200), 2217.35, 2045.34, 10.52, 359.97, 359.96, 270.44},          
      
--      SALON TERENOWY
      {'Huntley',579, math.random(0,10), 250000, 2886.20, 2257.11, 10.75, 359.36, 359.93, 43.58},
      {'Mesa', 500, math.random(0,10), 60000, 2887.43, 2268.03, 10.92, 358.56, 360.00, 102.69},
      {'Journey', 508, math.random(0,10), 500000,  2861.81, 2262.89, 11.19, 360.00, 359.79, 201.20},
      {'Sandking', 495, math.random(0,10), 400000,  2885.85, 2244.59, 12.33, 2.18, 2.03, 21.27},        
      {'Rancher', 505, math.random(0,10), 200000,  2868.83, 2243.04, 10.96, 359.67, 0.11, 309.80},
      {'Yosemite', 554, math.random(0,10), 150000,  2886.34, 2277.45, 10.90, 359.22, 359.89, 49.95},
      {'BF Injection', 424, math.random(0,10), 300000,  2871.04, 2280.26, 10.60, 358.78, 0.00, 218.70},
      {'Landstalker', 400, math.random(0,10), 50000,  2877.84, 2242.38, 10.91, 359.92, 0.13, 41.68},
      
--       SALON LOWRIDERÓW
      {'Savanna', 567, math.random(0,10), 320000,  2546.09, 746.63, 10.69, 0.46, 360.00, 206.21},
      {'Voodoo', 412, math.random(0,10), 180000,   2551.08, 746.77, 10.66, 0.19, 0.00, 202.95},
      {'Blade', 536, math.random(0,10), 350000, 2555.74, 747.18, 10.56, 0.00, 0.00, 206.76},
      {'Tornado', 576, math.random(0,10), 100000, 2560.30, 747.15, 10.43, 0.29, 0.00, 207.76},
      {'Broadway', 575, math.random(0,10), 200000, 2565.45, 747.22, 10.42, 359.72, 0.00, 213.69},
      {'Remington', 534, math.random(0,10), 400000,  2578.74, 745.82, 10.57, 0.34, 0.00, 152.15},
      {'Esperanto', 419, math.random(0,10), 150000,  2570.00, 747.73, 10.62, 0.00, 0.00, 217.77},

--      SALON NORMALNY
      {'Premier', 426, math.random(0,10), 55000, 1960.48, 2334.45, 10.60, 0.0, 0.0, 26.3},
      {'Blista Compact', 496, math.random(0,10), 80000, 1993.21, 2349.59, 10.65, 0.0, 360.0, 154.3},
      {'Sunrise', 550, math.random(0,10), 30000, 1999.11, 2349.63, 10.66, 359.6, 1.1, 155.0},
      {'Buffalo', 402, math.random(0,10), 150000, 1967.51, 2334.41, 10.68, 359.6, 0.5, 25.8},
      {'Sabre', 475, math.random(0,10), 60000, 1953.45, 2334.48, 10.66, 359.8, 360.0, 25.9},
      {'Admiral', 445, math.random(0,10), 50000, 1949.99, 2349.74, 10.72, 360.0, 0.0, 211.6},
      {'Sentinel', 405, math.random(0,10), 50000, 1956.09, 2349.67, 10.73, 0.0, 360.0, 212.6},
      {'Phoenix', 603, math.random(0,10), 120000, 1961.87, 2349.95, 10.67, 359.8, 0.4, 212.5},  
      {'Tahoma', 566, math.random(0,10), 45000, 1967.87, 2349.91, 10.62, 0.3, 1.1, 211.9},
      {'Majestic', 517, math.random(0,10), 25000, 1987.20, 2349.71, 10.71, 360.0, 360.0, 155.0},
      {'Cadrona', 527, math.random(0,10), 40000, 1981.18, 2349.79, 10.57, 360.0, 0.0, 154.9},       
      
      
--     SALON MOTOCYKLI
      {'Freeway', 463, math.random(0,10), 90000,  2103.88, 1398.39, 10.36, 360.0, 360.0, 180.6},
      {'Wayfarer', 586, math.random(0,10), 120000, 2113.67, 1398.09, 10.34, 359.9, 0.0, 180.6},
      {'Sanchez', 468, math.random(0,10), 60000, 2100.67, 1398.25, 10.49, 359.9, 360.0, 181.4},
      {'BF-400', 581, math.random(0,10), 80000,  2107.10, 1398.24, 10.42, 359.4, 0.0, 179.0},      
      {'PCJ-600', 461, math.random(0,10), 80000, 2116.72, 1398.27, 10.40, 358.9, 360.0, 179.5},
      {'Faggio', 462, math.random(0,10), 20000, 2110.24, 1397.92, 10.42, 359.5, 0.0, 178.8},
      {'Quad', 471, math.random(0,10), 35000, 2119.98, 1398.53, 10.29, 359.2, 0.0, 179.3},
      {'FCR-900', 521, math.random(0,10), 110000, 2123.21, 1398.39, 10.38, 359.1, 360.0, 180.4},       
      
--     SALON DOWNTOWN
      {'Cheetah', 415, math.random(0,10), 450000, 169.19, 626.65, 5.43, 0.3, 0.0, 87.5},
      {'Elegy', 562, math.random(0,10), 350000, 164.48, 633.81, 5.31, 359.5, 360.0, 165.3},
      {'Sultan', 560, math.random(0,10), 400000, 152.35, 627.17, 5.36, 359.9, 360.0, 254.4},
      {'Bullet', 541, math.random(0,10), 650000, 155.76, 619.62, 5.28, 359.5, 0.0, 300.5},
      {'Infernus', 411, math.random(0,10), 1000000, 160.65, 612.86, 5.38, 0.0, 0.0, 345.9},
      {'Comet', 480, math.random(0,10), 300000, 172.73, 620.10, 5.43, 359.7, 0.0, 147.3},
      {'Jester', 559, math.random(0,10), 220000, 170.13, 609.74, 5.31, 360.0, 360.0, 263.2},
      {'Turismo', 451, math.random(0,10), 850000, 174.46, 603.33, 5.36, 359.5, 360.0, 330.3},
      {'Super GT', 506, math.random(0,10), 400000, 178.63, 596.31, 5.36, 360.0, 360.0, 267.5},
      {'ZR-350', 477, math.random(0,10), 200000, 182.87, 588.73, 5.37, 359.7, 357.6, 328.9},     
      {'Banshee', 429, math.random(0,10), 450000, 188.93, 595.89, 5.33, 360.00, 0.00, 37.97},      

}
for i,v in pairs(positionVehicles) do
    local veh=createVehicle(v[2], v[5], v[6], v[7], v[8], v[9], v[10], v[11])
    setElementData(veh,'vehicle:desc','Pojazd: '..v[1]..'\nCena: '..v[4]..' PLN\nPrzebieg: '..v[3]..' km')
    setVehicleOverrideLights(veh, 1)
    setElementFrozen(veh,true)
    setVehicleColor(veh, 255,255,255)
    setVehicleDamageProof(veh, true)
    setElementData(veh,'vehicle.selling', true)

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

addEventHandler('onVehicleEnter', resourceRoot, function(plr, seat, jacked)
    if seat~=0 then return end
    if source:getData('vehsell:info') and source:getData('vehsell:info').selling==1 then
        triggerClientEvent(plr,"addNotification",root,"#cc0000Pojazd nie jest dostępny w sprzedaży!","error")
        return
    end

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

    plr:setData('vehsell:info', {
        ['cost']=data.cost,
        ['model']=data.model,
        ['mileage']=data.mileage,
    }, false)
    
    triggerClientEvent(plr,"addNotification",root,"#00cc00Aby zakupić ten pojazd wpisz #00cccc/zakup","error")
end)

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

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

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

addCommandHandler('zakup', function(plr, cmd)
    local data=plr:getData('vehsell:info')
    if not data then return end

    if getPlayerMoney(plr) < data.cost then
        triggerClientEvent(plr,"addNotification",root,"#cc0000Nie posiadasz wystarczajacej kwoty pieniędzy!","error")
        return
    end

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

    local cost=data.cost
    local model=data.model
    local mileage=data.mileage
    local uid=getElementData(plr,'player:uid') or 0
    takePlayerMoney(plr, cost)
    if mileage <= 100 then
    exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_vehicles (model,ownedPlayer,mileage,registered,parking) VALUES (?,?,?,?,1)", model, getElementData(plr,"player:uid"),mileage,"false")
    else
    exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_vehicles (model,ownedPlayer,mileage,registered,parking) VALUES (?,?,?,?,1)", model, getElementData(plr,"player:uid"),mileage,"true")
    end
    triggerClientEvent(plr,"addNotification",root,string.format("#00cc00Zakupiłeś swój pojazd "..getVehicleNameFromModel(model)..", znajdziesz go w przechowywalni."),"info")
end)

 

 

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...