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

Wysłany: 2020-03-19, 03:51


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2614 dni
Posty: 424
Nick w MP: Mazeusz*

Piwa: 1023

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Witam pr?bowa?em zablokowa? interakcje oraz wsiadanie do aut w salonie ale cos nie dzia?a.

db3: https://imgur.com/a/0kJDU31


salon:

--[[
    Komisy samochodowe
    @author value <value2k@gmail.com>
    @Edit: DylemaT929 :)
    @Edit2: Mazeusz* :)
    Nie masz prawa u?y? tego kodu bez mojej zgody
]]
createBlip(1422.18, -1175.28, 25.98, 55,2,0,0,0,0,0,275) -- Salon zwykly
createBlip(1885.88,-1864.87,13.58, 55,2,0,0,0,0,0,275) --cygan
createBlip(1090.82, -342.13, 73.99, 55,2,0,0,0,0,0,275) -- Salon offroad
createBlip(1800.32, -1255.04, 13.64,55,2,0,0,0,0,0,275) -- salon sportowy wajrusa
createBlip(1504.46, -1466.23, 25.93,55,2,0,0,0,0,0,275) -- salon z premierkiem
createBlip(2563.79, 970.34, 10.86,55,2,0,0,0,0,0,275) -- lowridery i motory
createBlip(1981.60, 2373.23, 11.10,55,2,0,0,0,0,0,275) -- Klasyki i sportowe
--createBlip(2027.30, 1008.06, 11.16,55,2,0,0,0,0,0,275) -- Sandking
createBlip(932.09, -1442.32, 13.55,39,0,0,0,0,0,39) -- URZ?D

local object=createObject(1365, 807.44,-650.83,-70.55, 0, 0, 0)
setElementDimension(object,1)
local object2=createObject(1365, 807.44,-650.83,-68.55, 0, 0, 0)
setElementDimension(object2,1)
-- magazyn ^
-- salon lowrider
createObject(3578,1737.23,330.55,26.80,0,0,90)
--local t=createElement("text")
--setElementPosition(t,2501.54,-1741.87,13.55+2)
--setElementInterior(t,0)
--setElementData(t,"name","Wejscie z ty?u")

local vehicles = {}
local komis_shapes = {}
local slots = {
    -- Sportowe Diesel
    { 1808.15, -1230.01, 41.85, 0, model=411, dmax=0, dmin=0, price=math.random(2800000,3000000), gdzie="sportowe"}, -- Inf
    { 1816.31, -1229.77, 41.83, 0, model=451, dmax=0, dmin=0, price=math.random(1700000,2000000), gdzie="sportowe"}, -- Turek
    { 1824.23, -1229.71, 41.75, 40.1, model=541, dmax=0, dmin=0, price=math.random(1550000,1950000), gdzie="sportowe"}, -- bullet
    { 1800.06, -1229.89, 41.89, 316.6, model=415, dmax=0, dmin=0, price=math.random(775000,775000), gdzie="sportowe"}, -- jester
    { 1800.06, -1221.17, 41.78, 310.0, model=560, dmax=0, dmin=0, price=math.random(550000,650000), gdzie="sportowe"}, -- sult
    { 1800.05, -1212.73, 41.86, 307.4, model=562, dmax=0, dmin=0, price=math.random(450000,550000), gdzie="unikat"}, -- elegy
    { 1800.16, -1204.22, 41.81, 300.9, model=559, dmax=0, dmin=0, price=math.random(375000,475000), gdzie="sportowe"}, -- cheeat
    { 1800.15, -1195.96, 41.90, 295.6, model=477, dmax=0, dmin=0, price=math.random(380000,480000), gdzie="sportowe"}, -- zr-350    
    { 1824.07, -1221.15, 41.82, 53.6, model=506, dmax=0, dmin=0, price=math.random(400000,450000), gdzie="sportowe"}, -- stg
    { 1824.19, -1212.94, 41.83, 61.6, model=429, dmax=0, dmin=0, price=math.random(500000,600000), gdzie="sportowe"}, -- banshe
    { 1824.25, -1204.42, 41.92, 63.6, model=480, dmax=0, dmin=0, price=math.random(300000,350000), gdzie="sportowe"}, -- comet
    { 1824.29, -1195.82, 41.77, 65, model=565, dmax=0, dmin=0, price=math.random(400000,450000), gdzie="sportowe"}, -- flash
    --{ -1945.92, 257.30, 41, 32.6, model=579, dmax=0, dmin=0, price=math.random(420000,440000), gdzie="sportowe"}, -- Huntley
    
        
    -- Salon motory/lowrider
    { 2568.79, 976.28, 10.44, 90, model=462, dmax=0, dmin=0, price=math.random(25000,26000), gdzie="moto"}, -- Faggi
    { 2569.11, 979.65, 10.40, 90, model=463, dmax=0, dmin=0, price=math.random(20000,252000), gdzie="moto"}, -- freeway
    { 2569.15, 983.00, 10.53, 90, model=468, dmax=0, dmin=0, price=math.random(123000,140000), gdzie="moto"}, -- sanchez
    { 2569.52, 986.28, 10.45, 90, model=581, dmax=0, dmin=0, price=math.random(403000,440000), gdzie="moto"}, -- BF
    { 2569.45, 989.38, 10.42, 90, model=521, dmax=0, dmin=0, price=math.random(430000,434000), gdzie="moto"}, -- FCR
    { 2569.49, 992.96, 10.43, 90, model=522, dmax=0, dmin=0, price=math.random(523000,540000), gdzie="moto"}, -- NRG
    { 2569.27, 996.22, 10.08, 90, model=471, dmax=0, dmin=0, price=math.random(33000,340000), gdzie="moto"}, -- quad
    
    -- Cygan LPG LV
    {1895.63, -1850.96, 13.23, 135.7, model=410, dmax=99343, dmin=97323, price=math.random(15500,22000), gdzie="cygan"}, -- manana
    {1871.67, -1844.76, 13.32, 189, model=401, dmax=99343, dmin=97323, price=math.random(47500,48000), gdzie="cygan"}, -- Brabura
    {1896.15, -1857.61, 13.34-0.1, 131, model=436, dmax=99999, dmin=90000, price=math.random(25000,35000), gdzie="cygan"}, -- Previon
    {1876.53, -1844.81, 13.29+0.3, 188.2, model=418, dmax=99000, dmin=97323, price=math.random(15500,16000), gdzie="cygan"}, -- Moonbeam
    {1887.27, -1877.82, 13.31, 275.7, model=543, dmax=101343, dmin=97000, price=math.random(30500,31000), gdzie="cygan"}, -- Sadler
    {1889.56, -1848.05, 13.35+0.2, 168, model=478, dmax=99343, dmin=97333, price=math.random(17000,25000), gdzie="cygan"}, -- walton
    {1897.79, -1865.49, 13.31, 125.2, model=404, dmax=99343, dmin=90333, price=math.random(15600,16600), gdzie="cygan"}, -- perek

    -- Zwyk?e 
    {1390.54, -1219.24, 74.68, 38.6, model=558, dmax=0, dmin=0, price=math.random(145000,155000), gdzie="zwykle"}, -- urans
    {1403.26, -1208.36, 74.89, 114.1, model=603, dmax=0, dmin=0, price=math.random(160000,180000), gdzie="zwykle"}, -- pohiniex
    {1403.37, -1201.65, 74.81, 110.8, model=602, dmax=0, dmin=0, price=math.random(145000,155000), gdzie="zwykle"}, -- alha
    {1400.76, -1218.71, 74.78, 41.8, model=587, dmax=0, dmin=0, price=math.random(125000,135000), gdzie="zwykle"}, -- euroski
    {1380.25, -1219.07, 74.86, 37.3, model=475, dmax=0, dmin=0, price=math.random(127500,147500), gdzie="zwykle"}, --sabre
    {1371.02, -1217.91, 74.74, 302.0, model=555, dmax=0, dmin=0, price=math.random(330000,340000), gdzie="zwykle"}, -- winsor
    {1371.33, -1207.93, 74.91, 300.6, model=517, dmax=0, dmin=0, price=math.random(110000,130000), gdzie="zwykle"}, -- majestic
    {1377.28, -1200.73, 74.88, 219.2, model=402, dmax=0, dmin=0, price=math.random(185000,199000), gdzie="zwykle"}, -- Buffalo
     --{2963.58, -804.17, 11.48, 297.2, model=555, dmax=0, dmin=0, price=math.random(449000,500000), gdzie="zwykle"}, -- Windsor
    --{2636.39, 1199.71, 10.81, 294.4, model=477, dmax=0, dmin=0, price=math.random(410000,520000), gdzie="zwykle"}, -- zr-350
    
    -- Zwyk?e/offrad
    --{1096.27, -362.79, 75.09, 326, model=500, dmax=0, dmin=0, price=math.random(145000,155000), gdzie="zwykle"}, -- mesa
    --{1070.73, -363.05, 75.17, 312.1, model=554, dmax=0, dmin=0, price=math.random(160000,180000), gdzie="zwykle"}, -- yose
    --{1061.63, -363.30, 75.15, 318.8, model=422, dmax=0, dmin=0, price=math.random(145000,155000), gdzie="zwykle"}, -- bobkat
    --{1079.27, -362.59, 75.01, 312.8, model=482, dmax=0, dmin=0, price=math.random(125000,135000), gdzie="zwykle"}, -- barabus xd
    --{1105.27, -362.90, 75.15, 325.3, model=482, dmax=0, dmin=0, price=math.random(127500,147500), gdzie="zwykle"}, --burrit
    {1504.75, -1458.55, 25.96, 270.0, model=426, dmax=0, dmin=0, price=math.random(330000,340000), gdzie="zwykle"}, -- premir
    {1513.15, -1472.71, 26.10, 0.6, model=445, dmax=0, dmin=0, price=math.random(110000,130000), gdzie="zwykle"}, -- adam
    {1529.84, -1472.40, 26.03, 90.2, model=561, dmax=0, dmin=0, price=math.random(185000,199000), gdzie="zwykle"}, -- starataum
    {1521.51, -1472.62, 26.10, 0.8, model=405, dmax=0, dmin=0, price=math.random(145000,155000), gdzie="zwykle"}, -- sent
    {1530.07, -1467.08, 25.88, 90.8, model=589, dmax=0, dmin=0, price=math.random(125000,135000), gdzie="zwykle"}, -- klub
    {1529.50, -1463.76, 26.08, 90.3, model=540, dmax=0, dmin=0, price=math.random(127500,147500), gdzie="zwykle"}, --vic
    {1529.52, -1458.74, 25.96, 90.0, model=542, dmax=0, dmin=0, price=math.random(330000,340000), gdzie="zwykle"}, -- clower
    {1504.17, -1471.71, 25.94, 270.6, model=496, dmax=0, dmin=0, price=math.random(110000,130000), gdzie="zwykle"}, -- blista
    {1504.46, -1466.23, 25.93, 270.2, model=533, dmax=0, dmin=0, price=math.random(185000,199000), gdzie="zwykle"}, -- feltzer
    
    -- Salon Motory/lowrider
    { 2572.76, 951.35, 10.75, 18, model=567, dmax=0, dmin=0, price=math.random(160000,175000), gdzie="sportowe"}, -- Savanna
    --{ 2499.27,-1755.83,13.54-0.3, 70, model=576, dmax=0, dmin=0, price=math.random(150000,165000), gdzie="sportowe"}, -- Tornado
    --{ 2466.19,-1747.49,13.54-0.3, 200, model=419, dmax=0, dmin=0, price=math.random(175000,177000), gdzie="sportowe"}, -- Esperanto
    --{ 2463.01,-1764.26,13.54-0.3, 295.9, model=533, dmax=0, dmin=0, price=math.random(160000,170000), gdzie="sportowe"}, -- Feltzer
    --{ 2490.35,-1747.51,13.54-0.2, 200, model=412, dmax=0, dmin=0, price=math.random(160000,170000), gdzie="sportowe"}, -- Vood
    { 2578.41, 965.66, 10.61, 131, model=536, dmax=0, dmin=0, price=math.random(160000,170000), gdzie="sportowe"}, -- blade
    { 2578.92, 955.65, 10.60, 57, model=535, dmax=0, dmin=0, price=math.random(60000,70000), gdzie="sportowe"}, -- slawek
    --{ 2461.68, 1357.82, 10.82, 180, model=575, dmax=0, dmin=0, price=math.random(60000,70000), gdzie="sportowe"}, -- brodway
    --{2249.96, 2063.48, 10.82-0.385, 180, model=529, dmax=0, dmin=0, price=math.random(100000,140000), gdzie="sportowe"}, -- wiladr
    --{2262.63, 2063.26, 10.82+0.1, 180, model=482, dmax=0, dmin=0, price=math.random(160000,170000), gdzie="sportowe"}, -- burito
    {2563.87, 953.66, 10.58, 321, model=534, dmax=0, dmin=0, price=math.random(110000,140000), gdzie="sportowe"}, -- remek
    --{2234.91, 2042.41, 10.82-0.35, 90, model=600, dmax=0, dmin=0, price=math.random(160000,170000), gdzie="sportowe"}, -- picador
    
    -- Salon Podmianek
    { 2001.77, 2368.97, 10.99, 64, model=494, dmax=0, dmin=0, price=math.random(7500000,8000000), gdzie="unikat2"}, -- gt
    { 2001.63, 2377.90, 10.82-0.1, 105, model=503, dmax=0, dmin=0, price=math.random(30000000,31000000), gdzie="unikat2"}, -- ferrarka
    { 1966.23, 2361.88, 16.59-0.1, 324, model=566, dmax=0, dmin=0, price=math.random(5500000,5500500), gdzie="unikat2"}, -- Cadilak
    { 1971.12, 2378.10, 10.62, 256, model=551, dmax=0, dmin=0, price=math.random(5750000,6000000), gdzie="unikat2"}, -- m5
    { 1982.73, 2378.74, 10.87, 258, model=516, dmax=0, dmin=0, price=math.random(6500000,6700000), gdzie="unikat2"}, -- rs6
    { 1956.67, 2372.36, 11.16, 270, model=579, dmax=0, dmin=0, price=math.random(35000000,36000000), gdzie="unikat2"}, -- g500
    { 1978.64, 2368.29, 10.86, 74, model=491, dmax=0, dmin=0, price=math.random(22000000,23000000), gdzie="unikat2"},    -- camaro
    { 1969.54, 2362.51, 10.72, 334, model=547, dmax=0, dmin=0, price=math.random(14500000,15500000), gdzie="unikat2"},  --e30
    { 2001.27, 2368.97, 16.57, 78, model=585, dmax=0, dmin=0, price=math.random(15500000,15600000), gdzie="unikat2"},  --300sel
    { 2001.03, 2373.66, 16.19, 102, model=507, dmax=0, dmin=0, price=math.random(20000000,21000000), gdzie="unikat2"},  --300sl
    { 1992.52, 2368.28, 16.13, 70, model=550, dmax=0, dmin=0, price=math.random(25500500,25600500), gdzie="unikat2"},  --deluxe
    --{ 1959.92, 2378.32, 11.02, 258, model=489, dmax=0, dmin=0, price=math.random(45500500,55600500), gdzie="unikat2"}, -- Barabus ten lepszy
    --{ 1958.55, 2364.13, 10.61+0.4, 303, model=400, dmax=0, dmin=0, price=math.random(3900000,4500000), gdzie="unikat2"}, -- barabus gorszy
    
    -- Lotnisko LV 
    { 1342.17, 1295.28, 11.2, 0, model=593, dmax=0, dmin=0, price=math.random(880000,1000000), gdzie="sportowe"},    -- DODO
    { 1321.59, 1295.12, 11.2+0.1, 0, model=513, dmax=0, dmin=0, price=math.random(3280000,5280000), gdzie="sportowe"}, -- stunt
    { 1289.64, 1276.04, 10.82, -45, model=469, dmax=0, dmin=0, price=math.random(1280000,2228000), gdzie="sportowe"}, -- sees
    { 1278.44, 1323.85, 10.82+1, 270, model=519, dmax=0, dmin=0, price=math.random(43280000,51228000), gdzie="sportowe"}, -- premium
    { 1289.99, 1298.31, 10.82, 270, model=487, dmax=0, dmin=0, price=math.random(3280000,4028000), gdzie="sportowe"}, -- mav
    
}

addEventHandler("onResourceStart", resourceRoot, function ()
    for i,v in ipairs(slots) do
        komis_shapes[i] = createColSphere(v[1], v[2], v[3], 3)
        setElementData(komis_shapes[i], "i", i)
        createKomisVehicle(i)

        addEventHandler("onColShapeHit", komis_shapes[i], function (hit,dim)
            if getElementType(hit) == "player" and getElementData(komis_shapes[i], "komis:veh") then
                triggerClientEvent(hit, "onClientAddNotification", hit,"Zainteresowa? ci? ten pojazd? /kuppojazd")
            end
        end)

    end
end)

addCommandHandler("kuppojazd", function (plr, cmd)
    local shape = isPlayerInVehicleColShape(plr)
    if not shape then return end
    local veh = getElementData(shape, "komis:veh")
    if not veh then return end
    local slot = getElementData(shape, "komis:slot")

    local price = vehicles[slot].price
    local money = getPlayerMoney(plr)
    if price > money then
        triggerClientEvent(plr, "onClientAddNotification", plr,"* Nie sta? ci? na kupno tego pojazdu. Id? zar?b na pracach dorywczych i wr?c p??niej!")
        return
    end
    takePlayerMoney(plr, price)

    local x,y,z = getElementPosition(veh)
    local rx,ry,rz = getElementRotation(veh)
    local i = getElementInterior(veh)
    local d = getElementDimension(veh)
    local pos = x..", "..y..", "..z..", "..rx..", "..ry..", "..rz..", "..i..", "..d

    local r1,g1,b1, r2,g2,b2, r3,g3,b3, r4,g4,b4 = getVehicleColor(veh, true)
    local color = r1..", "..g1..", "..b1..", "..r2..", "..g2..", "..b2

    local owner = getElementData(plr, "player:sid")
    local model = getElementModel(veh)
    local dist = vehicles[slot].mileage
    local poj = vehicles[slot].poj
    local engine = vehicles[slot].engine
    local gdzie = vehicles[slot].gdzie

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

    local q, num, id = exports["pystories-db"]:dbGet("INSERT INTO pystories_vehicles SET pos=?, fuel=50, bak=50, mileage=?, ownedPlayer=?, parking=1, pojemnosc=?, engine=?, color=?, model=?", pos, dist, owner, poj, engine, color, model)
    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:engine", vehicles[slot].engine)
        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, 250000, 1, slot) return end

    vehicles[slot] = {}
    
    vehicles[slot].mileage = math.random(slots[slot].dmin, slots[slot].dmax)
    vehicles[slot].price = slots[slot].price

    vehicles[slot].veh = createVehicle(slots[slot].model, slots[slot][1], slots[slot][2], slots[slot][3], 0, 0, slots[slot][4])
    setElementFrozen(vehicles[slot].veh, true)
    setVehicleDamageProof(vehicles[slot].veh, true)
    setVehicleLocked(vehicles[slot].veh, true)
    setElementData(vehicles, "komis:veh", true)

    setElementData(komis_shapes[slot], "komis:veh", vehicles[slot].veh)
    setElementData(komis_shapes[slot], "komis:slot", slot)
    setElementData(vehicles[slot].veh, "komis:veh", true)
    setElementData(vehicles[slot].veh, "salonowe", true)
    setVehicleOverrideLights ( vehicles[slot].veh, 2 )
    setVehicleColor(vehicles[slot].veh, 255,255,255)
    setVehicleHeadLightColor(vehicles[slot].veh, 255, 255, 255)

    if slots[slot].gdzie == "sportowe" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(5,9)
    vehicles[slot].gdzie = "sportowe"
    elseif slots[slot].gdzie == "dohertysf2" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(4,6)
    vehicles[slot].gdzie = "dohertysf2"
    elseif slots[slot].gdzie == "cygan" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(1,3)
    vehicles[slot].gdzie = "cygan"
    elseif slots[slot].gdzie == "zwykle" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(3,8)
    elseif slots[slot].gdzie == "xd" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(6,7)
    vehicles[slot].gdzie = "unikat"
    elseif slots[slot].gdzie == "unikat" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(7,8)
    vehicles[slot].gdzie = "unikat"
    elseif slots[slot].gdzie == "unikat2" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(9,12)
    vehicles[slot].gdzie = "unikat2"
    elseif slots[slot].gdzie == "unikat3" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(11,12)
    vehicles[slot].gdzie = "unikat3"
    elseif slots[slot].gdzie == "moto" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(3,7)
    vehicles[slot].gdzie = "moto"
    elseif slots[slot].gdzie == "off" then
    vehicles[slot].engine = "Diesel"
    vehicles[slot].poj = math.random(11,13)
    vehicles[slot].gdzie = "off"
    end

    if vehicles[slot].poj == 1 then
    vehicles[slot].poj2 = 1.2
    elseif vehicles[slot].poj == 2 then
    vehicles[slot].poj2 = 1.4
    elseif vehicles[slot].poj == 3 then
    vehicles[slot].poj2 = 1.6
    elseif vehicles[slot].poj == 4 then
    vehicles[slot].poj2 = 1.8
    elseif vehicles[slot].poj == 5 then
    vehicles[slot].poj2 = 2.0
    elseif vehicles[slot].poj == 6 then
    vehicles[slot].poj2 = 2.2
    elseif vehicles[slot].poj == 7 then
    vehicles[slot].poj2 = 3.0
    elseif vehicles[slot].poj == 8 then
    vehicles[slot].poj2 = 3.2
    elseif vehicles[slot].poj == 9 then
    vehicles[slot].poj2 = 4.0
    elseif vehicles[slot].poj == 10 then
    vehicles[slot].poj2 = 4.2
    elseif vehicles[slot].poj == 11 then
    vehicles[slot].poj2 = 5.2
    elseif vehicles[slot].poj == 12 then
    vehicles[slot].poj2 = 6.3
    elseif vehicles[slot].poj == 13 then
    vehicles[slot].poj2 = 7.2
    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].engine.."\nPojemno?? Baku: 50 L\nZainteresowa? ci? ten pojazd? /kuppojazd\n---------")
end

function isPlayerInVehicleColShape(player)
    for i,v in ipairs(komis_shapes) do
        if isElementWithinColShape(player, v) then return v end
    end
    return false
end
local t=createElement("text")
setElementData(t,"name","Zakaz parkowania na terenie cygana!")
setElementData(t,"scale",1.2)
setElementPosition(t,1896.80,-1879.49,13.50+1)

local wejscie1 = createMarker(1421.94, -1180.18, 25.99+0.8, "arrow", 1, 255, 153, 51)
local wyjscie1 = createMarker(1407.22, -1217.40, 75.05+0.8, "arrow", 1, 255, 153, 51)
addEventHandler("onMarkerHit",wejscie1,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(el) then return end
    setElementPosition(el,1404.95, -1217.16, 75.05)
end)
 
addEventHandler("onMarkerHit",wyjscie1,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(el) then return end
    setElementPosition(el,1421.14, -1176.61, 25.99)
end)

local wejscie23 = createMarker(1800.27, -1253.78, 13.65+0.8, "arrow", 1, 255, 153, 51)
local wyjscie23 = createMarker(1812.14, -1193.32, 42.15+0.8, "arrow", 1, 255, 153, 51)
addEventHandler("onMarkerHit",wejscie23,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(el) then return end
    setElementPosition(el,1812.38, -1194.72, 42.15)
end)
 
addEventHandler("onMarkerHit",wyjscie23,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(el) then return end
    setElementPosition(el,1800.11, -1255.62, 13.64)
end)

local wejscie233 = createMarker(1518.62, -1453.92, 14.21+0.8, "arrow", 1, 255, 153, 51)
local wyjscie233 = createMarker(1517.37, -1454.90, 26.22+0.8, "arrow", 1, 255, 153, 51)
setElementDimension(wyjscie233, 0)
addEventHandler("onMarkerHit",wejscie233,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(el) then return end
    setElementPosition(el,1517.28, -1457.72, 26.22+0.1)
        setElementDimension(el, 0)

end)



Interakcja serwer:
--[[
    licencja: Art. 67
        - 1. Tw?rca mo?e udzieli? upowa?nienia do korzystania z utworu na wymienionych w umowie polach eksploatacji z okre?leniem zakresu, miejsca i czasu tego korzystania.
        - 2. Je?eli umowa nie zastrzega wy??czno?ci korzystania z utworu w okre?lony spos?b (licencja wy??czna), udzielenie licencji nie ogranicza udzielenia przez tw?rc? upowa?nienia innym osobom do korzystania z utworu na tym samym polu eksploatacji (licencja niewy??czna).
        - 3. Je?eli umowa nie stanowi inaczej, licencjobiorca nie mo?e upowa?ni? innej osoby do korzystania z utworu w zakresie uzyskanej licencji.
        - 4. Je?eli umowa nie stanowi inaczej, uprawniony z licencji wy??cznej mo?e dochodzi? roszcze? z tytu?u naruszenia autorskich praw maj?tkowych, w zakresie obj?tym umow? licencyjn?.
        - 5. Umowa licencyjna wy??czna wymaga zachowania formy pisemnej pod rygorem niewa?no?ci.
]]

local tick = {}


addEvent("switchENGINE", true)
addEventHandler("switchENGINE", resourceRoot, function(veh)
    setVehicleEngineState(veh, not getVehicleEngineState(veh))

    if not tick[client] or tick[client] and (getTickCount() - tick[client]) > 3000 then
        tick[client] = getTickCount()
    elseif tick[client] and (getTickCount() - tick[client]) < 3000 then
        return
    end
    
    local text = getVehicleEngineState(veh) ~= true and "gasi" or "odpala"
end)

addEvent("switchLIGHT", true)
addEventHandler("switchLIGHT", resourceRoot, function(veh)
    setVehicleOverrideLights(veh, (getVehicleOverrideLights(veh) == 2 and 1 or 2))
end)

addEvent("switchHANDBRAKE", true)
addEventHandler("switchHANDBRAKE", resourceRoot, function(veh, _)
        if getElementData(veh, "vehicle:handbrake") and not _ then
            setControlState(client, "handbrake", false)
            setElementData(veh, "vehicle:handbrake", false)
            setElementFrozen(veh, false)
        
addEvent("r?cznysalon",true)
addEventHandler("r?cznysalon",root,function()
    local v = getPedOccupiedVehicle(source)
    if v then
        if not isVehicleOnGround(v) then return end
        if getElementData(v,"komis:veh") then triggerClientEvent(source, "onClientAddNotification", source, "Interakcja nie dzia?a na pojazd z salonu") return end
        if isElementFrozen(v) then
            setElementFrozen(v,false)
        else
            setElementFrozen(v,true)
        end
    end
end) 

            if not tick[client] or tick[client] and (getTickCount() - tick[client]) > 3000 then
                tick[client] = getTickCount()
            elseif tick[client] and (getTickCount() - tick[client]) < 3000 then
                return
            end
        else
            setControlState(client, "handbrake", true)
            setElementData(veh, "vehicle:handbrake", true)
            setElementFrozen(veh, true)

            if not tick[client] or tick[client] and (getTickCount() - tick[client]) > 3000 then
                tick[client] = getTickCount()
            elseif tick[client] and (getTickCount() - tick[client]) < 3000 then
                return
            end
    end
end)

addEvent("changeLOCKED", true)
addEventHandler("changeLOCKED", resourceRoot, function(veh)
    if isVehicleLocked(veh) == true then
        setVehicleLocked(veh, false)

        if not tick[client] or tick[client] and (getTickCount() - tick[client]) > 3000 then
            tick[client] = getTickCount()
        elseif tick[client] and (getTickCount() - tick[client]) < 3000 then
            return
        end

    else
        for i = 0,5 do
            setVehicleDoorOpenRatio(veh, i, 0, 2500)
        end

        setVehicleLocked(veh, true)

        if not tick[client] or tick[client] and (getTickCount() - tick[client]) > 3000 then
            tick[client] = getTickCount()
        elseif tick[client] and (getTickCount() - tick[client]) < 3000 then
            return
        end

    end
end)

addEvent("changeTYPE", true)
addEventHandler("changeTYPE", resourceRoot, function(veh)
    local newType = getElementData(veh, "vehicle:actualType") == "Benzyna" and "LPG" or "Benzyna"
    setElementData(veh, "vehicle:actualType", newType)
end)

addEvent("kickOCCUPANTS", true)
addEventHandler("kickOCCUPANTS", resourceRoot, function(veh)
    local occupants = getVehicleOccupants(veh)
    for i,v in pairs(occupants) do
        if v ~= client then
            setControlState(v, "enter_exit", true)
            setTimer(function()
                setControlState(v, "enter_exit", false)
            end, 200, 1)

            if not tick[client] or tick[client] and (getTickCount() - tick[client]) > 3000 then
                tick[client] = getTickCount()
            elseif tick[client] and (getTickCount() - tick[client]) < 3000 then
                return
            end

        end
    end
end)

addEventHandler("onVehicleEnter", root, function(player, seat)
    if seat ~= 0 then return end

    if getElementData(source, "vehicle:handbrake") then
        setControlState(player, "handbrake", true)
        setElementFrozen(source, false)
    end

    if getVehicleName(source) == "Bike" or getVehicleName(source) == "BMX" or getVehicleName(source) == "Mountain Bike" then
        setVehicleEngineState(source, true)
        setElementData(source, "vehicle:handbrake", false)
        setControlState(player, "handbrake", false)
    end
end)

addEventHandler("onVehicleStartEnter", root, function(player, seat)
    if seat ~= 0 then return end
    
    if getVehicleController(source) == player then
        setVehicleLocked(source, false)
    end
end)

addEventHandler("onVehicleExit", root, function(player, seat)
    for i = 0,5 do
        if i == 2 then
            setVehicleDoorOpenRatio(source, i, 0, 1000)
        end
    end

    if seat == 0 and getElementData(source, "vehicle:handbrake") then
        setControlState(player, "handbrake", false)
        setElementFrozen(source, true)
        setVehicleLocked(source, false)
    end
end)

addEvent("wiecejOpcji", true)
addEventHandler("wiecejOpcji", resourceRoot, function(veh, x)
    if x == 1 then
        if getVehicleDoorOpenRatio(veh, 0) == 0 then
            setVehicleDoorOpenRatio(veh, 0, 1, 500)
        else
            setVehicleDoorOpenRatio(veh, 0, 0, 500)
        end
    elseif x == 2 then
        if getVehicleDoorOpenRatio(veh, 1) == 0 then
            setVehicleDoorOpenRatio(veh, 1, 1, 500)
        else
            setVehicleDoorOpenRatio(veh, 1, 0, 500)
        end
    elseif x == 3 then
        if getVehicleDoorOpenRatio(veh, 2) == 0 then
            setVehicleDoorOpenRatio(veh, 2, 1, 500)
        else
            setVehicleDoorOpenRatio(veh, 2, 0, 500)
        end
    elseif x == 4 then
        if getVehicleDoorOpenRatio(veh, 3) == 0 then
            setVehicleDoorOpenRatio(veh, 3, 1, 500)
        else
            setVehicleDoorOpenRatio(veh, 3, 0, 500)
        end
    elseif x == 5 then
        if getVehicleDoorOpenRatio(veh, 4) == 0 then
            setVehicleDoorOpenRatio(veh, 4, 1, 500)
        else
            setVehicleDoorOpenRatio(veh, 4, 0, 500)
        end
    elseif x == 6 then
        if getVehicleDoorOpenRatio(veh, 5) == 0 then
            setVehicleDoorOpenRatio(veh, 5, 1, 500)
        else
            setVehicleDoorOpenRatio(veh, 5, 0, 500)
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 09:08


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Sprawdzaj element dat? "salonowe po kliencie w skrypcie od interakcji, wtedy po prostu interakcja nie b?dzie si? wy?wietla?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 11:31


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2614 dni
Posty: 424
Nick w MP: Mazeusz*

Piwa: 1023

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
setElementData(vehicles[slot].veh,"komis:veh",true)
chodzi o to?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 14:17


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Funkcja setElementData odpowiada za ustawienie elementowi jakich? danych.
Ty w interakcji musisz pobra? te dane, czyli u?ywasz getElementData.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 15:15


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2614 dni
Posty: 424
Nick w MP: Mazeusz*

Piwa: 1023

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Salon
function createKomisVehicle(slot)
    if #getElementsWithinColShape(komis_shapes[slot]) > 0 then setTimer(createKomisVehicle, 250000, 1, slot) return end

    vehicles[slot] = {}
    
    vehicles[slot].mileage = math.random(slots[slot].dmin, slots[slot].dmax)
    vehicles[slot].price = slots[slot].price

    vehicles[slot].veh = createVehicle(slots[slot].model, slots[slot][1], slots[slot][2], slots[slot][3], 0, 0, slots[slot][4])
    setElementFrozen(vehicles[slot].veh, true)
    setVehicleDamageProof(vehicles[slot].veh, true)
    setVehicleLocked(vehicles[slot].veh, true)
    setElementData(vehicles[slot].veh, "komis:veh", true)
    setElementData(veh,'recznySalonData', true)

    setElementData(komis_shapes[slot], "komis:veh", vehicles[slot].veh)
    setElementData(komis_shapes[slot], "komis:slot", slot)
    setElementData(vehicles[slot].veh, "komis:veh", true)
    setElementData(vehicles[slot].veh, "salonowe", true)
    setVehicleOverrideLights ( vehicles[slot].veh, 2 )
    setVehicleColor(vehicles[slot].veh, 255,255,255)
    setVehicleHeadLightColor(vehicles[slot].veh, 255, 255, 255)


Interakcja s

addEvent("switchHANDBRAKE", true)
addEventHandler("switchHANDBRAKE", resourceRoot, function(veh, _)
        if getElementData(veh, "vehicle:handbrake") and not _ then
            setControlState(client, "handbrake", false)
            setElementData(veh, "vehicle:handbrake", false)
            setElementFrozen(veh, false)
            
            --if v then
        if getElementData(veh,"recznySalonData") then 
            outputChatBox("* Interakcja, nie dzia?a na pojazd z Salonu / Cygana.", source)    return end


[ Dodano: 2020-03-19, 15:17 ]
Nadal nie dzia?a :P

[ Dodano: 2020-03-19, 15:20 ]
inter klient
local tbl = {
  [1] = "light",
  [2] = "engine",
  [3] = "handbrake",
  [4] = "leave",
  [5] = "lock",
  [6] = "settings",
  [7] = "reload",
};
function onPanelInterkcja()
    local veh = getPedOccupiedVehicle(localPlayer)
    if veh then
        if rowery[getVehicleName(veh)] then return end
        if getElementData(veh,"recznySalonData") then return end
        if getVehicleController(veh) == localPlayer then
            if panelWyboruOpcji == false then
                addEventHandler("onClientRender",root,WyborySPW)
                tick = getTickCount()
                wybrana_opcja=3
                panelWyboruOpcji = true
            end
        end
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 17:22


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

W linijce
setElementData(veh,'recznySalonData', true)

nie zgadza si? zmienna pojazdu. Musisz poprawi?, w linijce wy?ej masz poprawn?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 20:54


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2614 dni
Posty: 424
Nick w MP: Mazeusz*

Piwa: 1023

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Zrobi?em tak ale nadal nic
function createKomisVehicle(slot)
    if #getElementsWithinColShape(komis_shapes[slot]) > 0 then setTimer(createKomisVehicle, 250000, 1, slot) return end

    vehicles[slot] = {}
    
    vehicles[slot].mileage = math.random(slots[slot].dmin, slots[slot].dmax)
    vehicles[slot].price = slots[slot].price

    vehicles[slot].veh = createVehicle(slots[slot].model, slots[slot][1], slots[slot][2], slots[slot][3], 0, 0, slots[slot][4])
    setElementFrozen(vehicles[slot].veh, true)
    setVehicleDamageProof(vehicles[slot].veh, true)
    setVehicleLocked(vehicles[slot].veh, true)
    setElementData(vehicles[slot].veh, "komis:veh", true)
    setElementData(vehicles[slot].veh, "recznySalonData", true)


function onPanelInterkcja()
    local veh = getPedOccupiedVehicle(localPlayer)
    if veh then
        if rowery[getVehicleName(veh)] then return end
        if getElementData(veh, "vehicle:handbrake") then return end
        if getVehicleController(veh) == localPlayer then
            if panelWyboruOpcji == false then
                addEventHandler("onClientRender",root,WyborySPW)
                tick = getTickCount()
                wybrana_opcja=3
                panelWyboruOpcji = true
            end
        end
    end
end


addEvent("switchHANDBRAKE", true)
addEventHandler("switchHANDBRAKE", resourceRoot, function(veh, _)
        if getElementData(veh, "vehicle:handbrake") and not _ then
            setControlState(client, "handbrake", false)
            setElementData(veh, "vehicle:handbrake", false)
            setElementFrozen(veh, false)
            
            --if v then
        if getElementData(veh,"vehicle:handbrake") then 
            outputChatBox("* Interakcja, nie dzia?a na pojazd z Salonu / Cygana.", source)    return end

            if not tick[client] or tick[client] and (getTickCount() - tick[client]) > 3000 then
                tick[client] = getTickCount()
            elseif tick[client] and (getTickCount() - tick[client]) < 3000 then
                return
            end
        else
            setControlState(client, "handbrake", true)
            setElementData(veh, "vehicle:handbrake", true)
            setElementFrozen(veh, true)

            if not tick[client] or tick[client] and (getTickCount() - tick[client]) > 3000 then
                tick[client] = getTickCount()
            elseif tick[client] and (getTickCount() - tick[client]) < 3000 then
                return
            end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-19, 21:01


Wilq







Wiek: 24
Na forum: 4569 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

zamien
if getElementData(veh, "vehicle:handbrake") then return end

na
if getElementData(veh, "recznySalonData") then return end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-20, 00:30


Matikmontana

Modern Stories






Wiek: 22
Na forum: 2614 dni
Posty: 424
Nick w MP: Mazeusz*

Piwa: 1023

Respekt: 130
Respekt: 130

Ostrzeżeń: 60%
Nie wiem zamieni?em i dalej mo?na wchodzi? do aut i spuszcza? r?czny

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-20, 00:37


USUNIETY
[Usunięty]









Skoro chcesz zablokowa? wchodzenie do pojazd?w to po co blokowa? r?czny?
W?aduj to w kod od salon?w i daj zna? o rezultacie.
[lua]addEventHandler("onVehicleStartEnter", resourceRoot, function()
cancelEvent()
end)
[/lua]

 

 
Wysłany: 2020-03-22, 18:40


mixLoLmix2

Programista






Wiek: 35
Na forum: 4254 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3


function onPanelInterkcja()
    local veh = getPedOccupiedVehicle(localPlayer)
    if veh then
        if rowery[getVehicleName(veh)] then return end
        if getElementData(veh, "vehicle:handbrake") then return end
        if getVehicleController(veh) == localPlayer then
        if not getElementData(veh,"komis:veh") == true then
            if panelWyboruOpcji == false then
                addEventHandler("onClientRender",root,WyborySPW)
                tick = getTickCount()
                wybrana_opcja=3
                panelWyboruOpcji = true
            end
        end
        end
    end
end


Postaw piwo autorowi tego posta
 

 
Tagi: zablokowanie :: interakcji :: 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 » Zablokowanie interakcji w salonie Odpowiedz do tematu

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