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: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

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>
    @EditDylemaT929 :)
    @Edit2Mazeusz* :)
    Nie masz prawa u?ytego kodu bez mojej zgody
]]
createBlip(1422.18, -1175.2825.9855,2,0,0,0,0,0,275) -- Salon zwykly
createBlip(1885.88,-1864.87,13.5855,2,0,0,0,0,0,275) --cygan
createBlip(1090.82, -342.1373.9955,2,0,0,0,0,0,275) -- Salon offroad
createBlip(1800.32, -1255.0413.64,55,2,0,0,0,0,0,275) -- salon sportowy wajrusa
createBlip(1504.46, -1466.2325.93,55,2,0,0,0,0,0,275) -- salon z premierkiem
createBlip(2563.79970.3410.86,55,2,0,0,0,0,0,275) -- lowridery i motory
createBlip(1981.602373.2311.10,55,2,0,0,0,0,0,275) -- Klasyki i sportowe
--createBlip(2027.301008.0611.16,55,2,0,0,0,0,0,275) -- Sandking
createBlip(932.09, -1442.3213.55,39,0,0,0,0,0,39) -- URZ?D

local object=createObject(1365807.44,-650.83,-70.55000)
setElementDimension(object,1)
local object2=createObject(1365807.44,-650.83,-68.55000)
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.0141.850model=411dmax=0dmin=0price=math.random(2800000,3000000), gdzie="sportowe"}, -- Inf
    1816.31, -1229.7741.830model=451dmax=0dmin=0price=math.random(1700000,2000000), gdzie="sportowe"}, -- Turek
    1824.23, -1229.7141.7540.1model=541dmax=0dmin=0price=math.random(1550000,1950000), gdzie="sportowe"}, -- bullet
    1800.06, -1229.8941.89316.6model=415dmax=0dmin=0price=math.random(775000,775000), gdzie="sportowe"}, -- jester
    1800.06, -1221.1741.78310.0model=560dmax=0dmin=0price=math.random(550000,650000), gdzie="sportowe"}, -- sult
    1800.05, -1212.7341.86307.4model=562dmax=0dmin=0price=math.random(450000,550000), gdzie="unikat"}, -- elegy
    1800.16, -1204.2241.81300.9model=559dmax=0dmin=0price=math.random(375000,475000), gdzie="sportowe"}, -- cheeat
    1800.15, -1195.9641.90295.6model=477dmax=0dmin=0price=math.random(380000,480000), gdzie="sportowe"}, -- zr-350    
    1824.07, -1221.1541.8253.6model=506dmax=0dmin=0price=math.random(400000,450000), gdzie="sportowe"}, -- stg
    1824.19, -1212.9441.8361.6model=429dmax=0dmin=0price=math.random(500000,600000), gdzie="sportowe"}, -- banshe
    1824.25, -1204.4241.9263.6model=480dmax=0dmin=0price=math.random(300000,350000), gdzie="sportowe"}, -- comet
    1824.29, -1195.8241.7765model=565dmax=0dmin=0price=math.random(400000,450000), gdzie="sportowe"}, -- flash
    --{ -1945.92257.304132.6model=579dmax=0dmin=0price=math.random(420000,440000), gdzie="sportowe"}, -- Huntley
    
        
    -- Salon motory/lowrider
    2568.79976.2810.4490model=462dmax=0dmin=0price=math.random(25000,26000), gdzie="moto"}, -- Faggi
    2569.11979.6510.4090model=463dmax=0dmin=0price=math.random(20000,252000), gdzie="moto"}, -- freeway
    2569.15983.0010.5390model=468dmax=0dmin=0price=math.random(123000,140000), gdzie="moto"}, -- sanchez
    2569.52986.2810.4590model=581dmax=0dmin=0price=math.random(403000,440000), gdzie="moto"}, -- BF
    2569.45989.3810.4290model=521dmax=0dmin=0price=math.random(430000,434000), gdzie="moto"}, -- FCR
    2569.49992.9610.4390model=522dmax=0dmin=0price=math.random(523000,540000), gdzie="moto"}, -- NRG
    2569.27996.2210.0890model=471dmax=0dmin=0price=math.random(33000,340000), gdzie="moto"}, -- quad
    
    -- Cygan LPG LV
    {1895.63, -1850.9613.23135.7model=410dmax=99343dmin=97323price=math.random(15500,22000), gdzie="cygan"}, -- manana
    {1871.67, -1844.7613.32189model=401dmax=99343dmin=97323price=math.random(47500,48000), gdzie="cygan"}, -- Brabura
    {1896.15, -1857.6113.34-0.1131model=436dmax=99999dmin=90000price=math.random(25000,35000), gdzie="cygan"}, -- Previon
    {1876.53, -1844.8113.29+0.3188.2model=418dmax=99000dmin=97323price=math.random(15500,16000), gdzie="cygan"}, -- Moonbeam
    {1887.27, -1877.8213.31275.7model=543dmax=101343dmin=97000price=math.random(30500,31000), gdzie="cygan"}, -- Sadler
    {1889.56, -1848.0513.35+0.2168model=478dmax=99343dmin=97333price=math.random(17000,25000), gdzie="cygan"}, -- walton
    {1897.79, -1865.4913.31125.2model=404dmax=99343dmin=90333price=math.random(15600,16600), gdzie="cygan"}, -- perek

    -- Zwyk?e 
    {1390.54, -1219.2474.6838.6model=558dmax=0dmin=0price=math.random(145000,155000), gdzie="zwykle"}, -- urans
    {1403.26, -1208.3674.89114.1model=603dmax=0dmin=0price=math.random(160000,180000), gdzie="zwykle"}, -- pohiniex
    {1403.37, -1201.6574.81110.8model=602dmax=0dmin=0price=math.random(145000,155000), gdzie="zwykle"}, -- alha
    {1400.76, -1218.7174.7841.8model=587dmax=0dmin=0price=math.random(125000,135000), gdzie="zwykle"}, -- euroski
    {1380.25, -1219.0774.8637.3model=475dmax=0dmin=0price=math.random(127500,147500), gdzie="zwykle"}, --sabre
    {1371.02, -1217.9174.74302.0model=555dmax=0dmin=0price=math.random(330000,340000), gdzie="zwykle"}, -- winsor
    {1371.33, -1207.9374.91300.6model=517dmax=0dmin=0price=math.random(110000,130000), gdzie="zwykle"}, -- majestic
    {1377.28, -1200.7374.88219.2model=402dmax=0dmin=0price=math.random(185000,199000), gdzie="zwykle"}, -- Buffalo
     --{2963.58, -804.1711.48297.2model=555dmax=0dmin=0price=math.random(449000,500000), gdzie="zwykle"}, -- Windsor
    --{2636.391199.7110.81294.4model=477dmax=0dmin=0price=math.random(410000,520000), gdzie="zwykle"}, -- zr-350
    
    -- Zwyk?e/offrad
    --{1096.27, -362.7975.09326model=500dmax=0dmin=0price=math.random(145000,155000), gdzie="zwykle"}, -- mesa
    --{1070.73, -363.0575.17312.1model=554dmax=0dmin=0price=math.random(160000,180000), gdzie="zwykle"}, -- yose
    --{1061.63, -363.3075.15318.8model=422dmax=0dmin=0price=math.random(145000,155000), gdzie="zwykle"}, -- bobkat
    --{1079.27, -362.5975.01312.8model=482dmax=0dmin=0price=math.random(125000,135000), gdzie="zwykle"}, -- barabus xd
    --{1105.27, -362.9075.15325.3model=482dmax=0dmin=0price=math.random(127500,147500), gdzie="zwykle"}, --burrit
    {1504.75, -1458.5525.96270.0model=426dmax=0dmin=0price=math.random(330000,340000), gdzie="zwykle"}, -- premir
    {1513.15, -1472.7126.100.6model=445dmax=0dmin=0price=math.random(110000,130000), gdzie="zwykle"}, -- adam
    {1529.84, -1472.4026.0390.2model=561dmax=0dmin=0price=math.random(185000,199000), gdzie="zwykle"}, -- starataum
    {1521.51, -1472.6226.100.8model=405dmax=0dmin=0price=math.random(145000,155000), gdzie="zwykle"}, -- sent
    {1530.07, -1467.0825.8890.8model=589dmax=0dmin=0price=math.random(125000,135000), gdzie="zwykle"}, -- klub
    {1529.50, -1463.7626.0890.3model=540dmax=0dmin=0price=math.random(127500,147500), gdzie="zwykle"}, --vic
    {1529.52, -1458.7425.9690.0model=542dmax=0dmin=0price=math.random(330000,340000), gdzie="zwykle"}, -- clower
    {1504.17, -1471.7125.94270.6model=496dmax=0dmin=0price=math.random(110000,130000), gdzie="zwykle"}, -- blista
    {1504.46, -1466.2325.93270.2model=533dmax=0dmin=0price=math.random(185000,199000), gdzie="zwykle"}, -- feltzer
    
    -- Salon Motory/lowrider
    2572.76951.3510.7518model=567dmax=0dmin=0price=math.random(160000,175000), gdzie="sportowe"}, -- Savanna
    --{ 2499.27,-1755.83,13.54-0.370model=576dmax=0dmin=0price=math.random(150000,165000), gdzie="sportowe"}, -- Tornado
    --{ 2466.19,-1747.49,13.54-0.3200model=419dmax=0dmin=0price=math.random(175000,177000), gdzie="sportowe"}, -- Esperanto
    --{ 2463.01,-1764.26,13.54-0.3295.9model=533dmax=0dmin=0price=math.random(160000,170000), gdzie="sportowe"}, -- Feltzer
    --{ 2490.35,-1747.51,13.54-0.2200model=412dmax=0dmin=0price=math.random(160000,170000), gdzie="sportowe"}, -- Vood
    2578.41965.6610.61131model=536dmax=0dmin=0price=math.random(160000,170000), gdzie="sportowe"}, -- blade
    2578.92955.6510.6057model=535dmax=0dmin=0price=math.random(60000,70000), gdzie="sportowe"}, -- slawek
    --{ 2461.681357.8210.82180model=575dmax=0dmin=0price=math.random(60000,70000), gdzie="sportowe"}, -- brodway
    --{2249.962063.4810.82-0.385180model=529dmax=0dmin=0price=math.random(100000,140000), gdzie="sportowe"}, -- wiladr
    --{2262.632063.2610.82+0.1180model=482dmax=0dmin=0price=math.random(160000,170000), gdzie="sportowe"}, -- burito
    {2563.87953.6610.58321model=534dmax=0dmin=0price=math.random(110000,140000), gdzie="sportowe"}, -- remek
    --{2234.912042.4110.82-0.3590model=600dmax=0dmin=0price=math.random(160000,170000), gdzie="sportowe"}, -- picador
    
    -- Salon Podmianek
    2001.772368.9710.9964model=494dmax=0dmin=0price=math.random(7500000,8000000), gdzie="unikat2"}, -- gt
    2001.632377.9010.82-0.1105model=503dmax=0dmin=0price=math.random(30000000,31000000), gdzie="unikat2"}, -- ferrarka
    1966.232361.8816.59-0.1324model=566dmax=0dmin=0price=math.random(5500000,5500500), gdzie="unikat2"}, -- Cadilak
    1971.122378.1010.62256model=551dmax=0dmin=0price=math.random(5750000,6000000), gdzie="unikat2"}, -- m5
    1982.732378.7410.87258model=516dmax=0dmin=0price=math.random(6500000,6700000), gdzie="unikat2"}, -- rs6
    1956.672372.3611.16270model=579dmax=0dmin=0price=math.random(35000000,36000000), gdzie="unikat2"}, -- g500
    1978.642368.2910.8674model=491dmax=0dmin=0price=math.random(22000000,23000000), gdzie="unikat2"},    -- camaro
    1969.542362.5110.72334model=547dmax=0dmin=0price=math.random(14500000,15500000), gdzie="unikat2"},  --e30
    2001.272368.9716.5778model=585dmax=0dmin=0price=math.random(15500000,15600000), gdzie="unikat2"},  --300sel
    2001.032373.6616.19102model=507dmax=0dmin=0price=math.random(20000000,21000000), gdzie="unikat2"},  --300sl
    1992.522368.2816.1370model=550dmax=0dmin=0price=math.random(25500500,25600500), gdzie="unikat2"},  --deluxe
    --{ 1959.922378.3211.02258model=489dmax=0dmin=0price=math.random(45500500,55600500), gdzie="unikat2"}, -- Barabus ten lepszy
    --{ 1958.552364.1310.61+0.4303model=400dmax=0dmin=0price=math.random(3900000,4500000), gdzie="unikat2"}, -- barabus gorszy
    
    -- Lotnisko LV 
    1342.171295.2811.20model=593dmax=0dmin=0price=math.random(880000,1000000), gdzie="sportowe"},    -- DODO
    1321.591295.1211.2+0.10model=513dmax=0dmin=0price=math.random(3280000,5280000), gdzie="sportowe"}, -- stunt
    1289.641276.0410.82, -45model=469dmax=0dmin=0price=math.random(1280000,2228000), gdzie="sportowe"}, -- sees
    1278.441323.8510.82+1270model=519dmax=0dmin=0price=math.random(43280000,51228000), gdzie="sportowe"}, -- premium
    1289.991298.3110.82270model=487dmax=0dmin=0price=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 (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!")
        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 engine vehicles[slot].engine
    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=50, bak=50, mileage=?, ownedPlayer=?, parking=1, pojemnosc=?, engine=?, color=?, model=?"posdistownerpojenginecolormodel)
    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].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(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)
    setVehicleColor(vehicles[slot].veh255,255,255)
    setVehicleHeadLightColor(vehicles[slot].veh255255255)

    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(playervthen 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.1825.99+0.8"arrow"125515351)
local wyjscie1 createMarker(1407.22, -1217.4075.05+0.8"arrow"125515351)
addEventHandler("onMarkerHit",wejscie1,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(elthen return end
    setElementPosition(el,1404.95, -1217.1675.05)
end)
 
addEventHandler("onMarkerHit",wyjscie1,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(elthen return end
    setElementPosition(el,1421.14, -1176.6125.99)
end)

local wejscie23 createMarker(1800.27, -1253.7813.65+0.8"arrow"125515351)
local wyjscie23 createMarker(1812.14, -1193.3242.15+0.8"arrow"125515351)
addEventHandler("onMarkerHit",wejscie23,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(elthen return end
    setElementPosition(el,1812.38, -1194.7242.15)
end)
 
addEventHandler("onMarkerHit",wyjscie23,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(elthen return end
    setElementPosition(el,1800.11, -1255.6213.64)
end)

local wejscie233 createMarker(1518.62, -1453.9214.21+0.8"arrow"125515351)
local wyjscie233 createMarker(1517.37, -1454.9026.22+0.8"arrow"125515351)
setElementDimension(wyjscie2330)
addEventHandler("onMarkerHit",wejscie233,function(el,md)
    if getElementType(el) == "vehicle" then return end
    if getPedOccupiedVehicle(elthen return end
    setElementPosition(el,1517.28, -1457.7226.22+0.1)
        setElementDimension(el0)

end)



Interakcja serwer:
--[[
    licencjaArt67
        1. Tw?rca mo?e udzieliupowa?nienia do korzystania z utworu na wymienionych w umowie polach eksploatacji z okre?leniem zakresumiejsca i czasu tego korzystania.
        - 2. Je?eli umowa nie zastrzega wy??czno?ci korzystania z utworu w okre?lony spos?(licencja wy??czna), udzielenie licencji nie ogranicza udzielenia przez tw?rcupowa?nienia innym osobom do korzystania z utworu na tym samym polu eksploatacji (licencja niewy??czna).
        - 3. Je?eli umowa nie stanowi inaczejlicencjobiorca nie mo?e upowa?niinnej osoby do korzystania z utworu w zakresie uzyskanej licencji.
        - 4. Je?eli umowa nie stanowi inaczejuprawniony z licencji wy??cznej mo?e dochodziroszczez tytu?u naruszenia autorskich praw maj?tkowychw zakresie obj?tym umowlicencyjn?.
        - 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(vehnot 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) == and 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(vehfalse)
        
addEvent("r?cznysalon",true)
addEventHandler("r?cznysalon",root,function()
    local v getPedOccupiedVehicle(source)
    if v then
        if not isVehicleOnGround(vthen return end
        if getElementData(v,"komis:veh"then triggerClientEvent(source"onClientAddNotification"source"Interakcja nie dzia?a na pojazd z salonu") return end
        if isElementFrozen(vthen
            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(vehtrue)

            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(vehfalse)

        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 0,do
            setVehicleDoorOpenRatio(vehi02500)
        end

        setVehicleLocked(vehtrue)

        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 ~= client then
            setControlState(v"enter_exit"true)
            setTimer(function()
                setControlState(v"enter_exit"false)
            end2001)

            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(playerseat)
    if seat ~= 0 then return end

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

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

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

addEventHandler("onVehicleExit"root, function(playerseat)
    for 0,do
        if == 2 then
            setVehicleDoorOpenRatio(sourcei01000)
        end
    end

    if seat == and getElementData(source"vehicle:handbrake"then
        setControlState(player"handbrake"false)
        setElementFrozen(sourcetrue)
        setVehicleLocked(sourcefalse)
    end
end)

addEvent("wiecejOpcji"true)
addEventHandler("wiecejOpcji"resourceRoot, function(vehx)
    if == 1 then
        if getVehicleDoorOpenRatio(veh0) == 0 then
            setVehicleDoorOpenRatio(veh01500)
        else
            setVehicleDoorOpenRatio(veh00500)
        end
    elseif == 2 then
        if getVehicleDoorOpenRatio(veh1) == 0 then
            setVehicleDoorOpenRatio(veh11500)
        else
            setVehicleDoorOpenRatio(veh10500)
        end
    elseif == 3 then
        if getVehicleDoorOpenRatio(veh2) == 0 then
            setVehicleDoorOpenRatio(veh21500)
        else
            setVehicleDoorOpenRatio(veh20500)
        end
    elseif == 4 then
        if getVehicleDoorOpenRatio(veh3) == 0 then
            setVehicleDoorOpenRatio(veh31500)
        else
            setVehicleDoorOpenRatio(veh30500)
        end
    elseif == 5 then
        if getVehicleDoorOpenRatio(veh4) == 0 then
            setVehicleDoorOpenRatio(veh41500)
        else
            setVehicleDoorOpenRatio(veh40500)
        end
    elseif == 6 then
        if getVehicleDoorOpenRatio(veh5) == 0 then
            setVehicleDoorOpenRatio(veh51500)
        else
            setVehicleDoorOpenRatio(veh50500)
        end
    end
end)


Postaw piwo autorowi tego posta
 

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


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

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: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

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: 4428 dni
Posty: 3410

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: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

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].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(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)
    setVehicleColor(vehicles[slot].veh255,255,255)
    setVehicleHeadLightColor(vehicles[slot].veh255255255)


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(vehfalse)
            
            --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: 4428 dni
Posty: 3410

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: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

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].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(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(vehfalse)
            
            --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(vehtrue)

            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: 4428 dni
Posty: 3410

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: 2473 dni
Posty: 423
Nick w MP: Mazeusz*

Piwa: 1015

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