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

Wysłany: 2019-01-24, 23:01


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

Witam wgralem paczke NewPlace na moj serwer lecz gdy wchodze np. do pracy autobusu nie respi mi pojazdu , w magazynierze nie daje skrzyn!

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-24, 23:34


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Poka? kod, jakie? b??dy /debugscript 3, wszystkie skrypty w??czone?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-24, 23:46


Adaskokieblasko







Wiek: 23
Na forum: 2954 dni
Posty: 101

Piwa: 18

Respekt: 100
Respekt: 100

Musisz poprawi? triggery we wszystkich pracach z NewPlace'a (( sam korzysta?em z tej paczki i mia?em ten sam b??d starczy czysta zmiana nazw trigger?w ))

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-25, 15:12


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

A co to ten triger?

[ Dodano: 2019-01-25, 15:17 ]
Pokaza? by? mi wz?r jak to zrobi? :D ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-25, 15:27


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8


Więcej informacji znajdziesz w Wikipedii MTA:

triggerClientEvent


Więcej informacji znajdziesz w Wikipedii MTA:

triggerServerEvent


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-25, 16:05


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

Czyli ze jak? nazwe mam pozmieniac?

c.lua
--[[
    AutorMalentas
]]

local sxsy guiGetScreenSize()
local pxpy sx/1440sy/900
local okno1 false
local ulepszenia false

local pracodawca createPed(171053.401744.4910.82360)
setElementData(pracodawca"name""Pracodawca")
setElementDimension(pracodawca0)
setElementFrozen(pracodawcatrue)
local rozpoczecie createMarker(1053.611746.689.92"cylinder"1255255255)
setElementData(rozpoczecie"praca"true)
setElementDimension(rozpoczecie0)


addEventHandler("onClientMarkerHit"rozpoczecie, function(gracz)
    if gracz ~= localPlayer then return end
    if getPedOccupiedVehicle(localPlayerthen return end
    if getElementDimension(source) ~= getElementDimension(localPlayerthen return end
    if getElementData(localPlayer"block:prawko"then exports["np-notyfikacje"]:noti("Posiadasz zabrane prawo jazdy kat. A, B, C""error") return end
    if getElementData(localPlayer"punkty") < 300 then exports["np-notyfikacje"]:noti("Nie posiadasz 700 punkt?w reputacji!""error") return end
    if getElementData(localPlayer"prawko_c") ~= 1 then exports["np-notyfikacje"]:noti("Nie posiadasz prawa jazdy kat.c!""error") return end
    if getElementData(localPlayer"pracuje"then
        if getElementData(localPlayer"pracuje") ~= "autobusy" then exports["np-notyfikacje"]:noti("Posiadasz inn? aktywn? prace!""error") return end
    end
    addEventHandler("onClientRender"rootguistart)
    okno1 true
    showCursor(true)
    triggerServerEvent("pokazTopke:autobusy:source"localPlayer)
end)

local font dxCreateFont("cz.ttf"10)
local font2 dxCreateFont("cz.ttf"12)

local pracownicy = { }

local listaulepszen = {
    {"Du?y autobus""Dzi?ki temu zarabiasz wi?cej i je?dzisz po ca?ym SA"1000"dolar.png"},
    {"Zarobek +5%""Dzi?ki temu ulepszeniu zarabiasz wi?cej o 5%"700"dolar.png"},
}


function guistart()
    dxDrawImage(scale_x(402), scale_y(251), scale_x(637), scale_y(399), ":np-gui/grafiki/tlo.png"000tocolor(255255255255), false)
    if ulepszenia == false then
       local punkty getElementData(localPlayer"apunkty") or 0
       local zlecenia getElementData(localPlayer"azlecenia") or 0
        shadowText("Praca przewozu osob"scale_x(401), scale_y(251), scale_x(1039), scale_y(295), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        --shadowText("Wymagania:\nBRAK"scale_x(401), scale_y(295), scale_x(719), scale_y(449), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        shadowText("Kursy: "..zlecenia.."\nPunkty: "..punkty..""scale_x(402), scale_y(510), scale_x(719), scale_y(646), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        shadowText("Top pracownicy:"scale_x(719), scale_y(295), scale_x(1036), scale_y(329), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        dxDrawImage(scale_x(415), scale_y(310), scale_x(304), scale_y(175), ":np-magazynier/grafiki/bg6.png"000tocolor(255255255255), false)
        shadowText("Wymagania: 300 RP, Kat. C"scale_x(415), scale_y(500), scale_x(719), scale_y(548), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        if mysz(scale_x(889), scale_y(592), scale_x(139), scale_y(44)) then
           dxDrawImage(scale_x(889), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_on.png"000tocolor(255255255255), false)
        else
           dxDrawImage(scale_x(889), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_off.png"000tocolor(255255255255), false)
        end
        if mysz(scale_x(729), scale_y(592), scale_x(139), scale_y(44)) then
           dxDrawImage(scale_x(729), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_on.png"000tocolor(255255255255), false)
        else
           dxDrawImage(scale_x(729), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_off.png"000tocolor(255255255255), false)
        end
        if getElementData(localPlayer"pracuje") == "autobusy" then
           shadowText("Zako?cz prace"scale_x(728), scale_y(591), scale_x(868), scale_y(636), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        else
           shadowText("Rozpocznij prace"scale_x(728), scale_y(591), scale_x(868), scale_y(636), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        end
        shadowText("Ulepszenia"scale_x(888), scale_y(592), scale_x(1028), scale_y(637), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        dxDrawImage(scale_x(1010), scale_y(261), scale_x(16), scale_y(16), ":guieditor/images/cross.png"000tocolor(255255255255), false)
        shadowText("Nickname:"scale_x(729), scale_y(329), scale_x(880), scale_y(363), tocolor(255255255255), 1.00font"center""center"falsefalsefalsefalsefalse)
        shadowText("Kursy:"scale_x(877), scale_y(329), scale_x(1028), scale_y(363), tocolor(255255255255), 1.00font"center""center"falsefalsefalsefalsefalse)

        for iv in ipairs(pracownicy) do
           local dodatekY = (scale_y(37))*(i-1)
           local dodatekY2 = (scale_y(74))*(i-1)

           dxDrawRectangle(scale_x(729), scale_y(363) + dodatekYscale_x(299), scale_y(35), tocolor(000120), false)
           shadowText(v.nickscale_x(729), scale_y(364) + dodatekY2scale_x(877), scale_y(398), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
           shadowText(v.liczbascale_x(880), scale_y(364) + dodatekY2scale_x(1028), scale_y(398), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        end
    else
        local punkty getElementData(localPlayer"apunkty") or 0
        shadowText("Kupno ulepszen"scale_x(401), scale_y(251), scale_x(1039), scale_y(295), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        dxDrawImage(scale_x(1011), scale_y(262), scale_x(16), scale_y(16), ":np-gui/grafiki/cofnij.png"000tocolor(255255255255), false)
        dxDrawText("Posiadasz: "..punkty.." punkt?w"scale_x(402), scale_y(582), scale_x(1037), scale_y(648), tocolor(02550255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        for iv in ipairs(listaulepszen) do
            local dodatekY = (scale_y(72))*(i-1)
            local dodatekY2 = (scale_y(144))*(i-1)

            dxDrawRectangle(scale_x(417), scale_y(297)+dodatekYscale_x(610), scale_y(70), tocolor(000120), false)
            dxDrawImage(scale_x(432), scale_y(307)+dodatekYscale_x(50), scale_y(50), ":np-magazynier/grafiki/"..v[4]..""000tocolor(255255255255), false)
            shadowText(v[1], scale_x(501), scale_y(297)+dodatekY2scale_x(874), scale_y(332), tocolor(255255255255), 1.00font2"left""center"falsefalsefalsefalsefalse)
            shadowText(v[2], scale_x(501), scale_y(332)+dodatekY2scale_x(874), scale_y(367), tocolor(255255255255), 1.00font"left""center"falsefalsefalsefalsefalse)
            if mysz(scale_x(904), scale_y(312)+dodatekYscale_x(113), scale_y(38)) then
                dxDrawImage(scale_x(904), scale_y(312)+dodatekYscale_x(113), scale_y(38), ":np-gui/grafiki/button_on.png"000tocolor(255255255255), false)
            else
                dxDrawImage(scale_x(904), scale_y(312)+dodatekYscale_x(113), scale_y(38), ":np-gui/grafiki/button_off.png"000tocolor(255255255255), false)
            end
            shadowText("Zakup"scale_x(904), scale_y(312)+dodatekY2scale_x(1017), scale_y(350), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
            shadowText("Cena: "..v[3].."p"scale_x(781), scale_y(297)+dodatekY2scale_x(894), scale_y(335), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        end
    end
end

addEventHandler("onClientClick"root, function(btnstate)
  if btn == "left" and state == "down" then
    if mysz(scale_x(729), scale_y(592), scale_x(139), scale_y(44)) and okno1 == true and ulepszenia == false then
        if getElementData(localPlayer"pracuje") == "autobusy" then
            zakonczprace()
        else
            rozpocznijprace()
        end
    elseif mysz(scale_x(889), scale_y(592), scale_x(139), scale_y(44)) and okno1 == true and ulepszenia == false then
        ulepszenia true
    elseif mysz(scale_x(1010), scale_y(261), scale_x(16), scale_y(16)) and okno1 == true and ulepszenia == false then
        removeEventHandler("onClientRender"rootguistart)
        okno1 false
        showCursor(false)
    elseif mysz(scale_x(1011), scale_y(262), scale_x(16), scale_y(16)) and okno1 == true and ulepszenia == true then
        ulepszenia false
    end
    for iv in ipairs(listaulepszen) do
        local dodatekY = (scale_y(72))*(i-1)
        if mysz(scale_x(904), scale_y(312)+dodatekYscale_x(113), scale_y(38)) and okno1 == true and ulepszenia == true then
            local punkty getElementData(localPlayer"apunkty") or 0
            if punkty tonumber(v[3]) then exports["np-notyfikacje"]:noti("Posiadasz za ma?o punkt?w by zakupi? to ulepszenie""error") return end
            if v[1] == "Du?y autobus" then 
                if getElementData(localPlayer"autobusy:ulepszenie1") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie""error") return end
                setElementData(localPlayer"autobusy:ulepszenie1"1)
            elseif v[1] == "Zarobek +5%" then
                if getElementData(localPlayer"autobusy:ulepszenie2") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie""error") return end
                setElementData(localPlayer"autobusy:ulepszenie2"1)
            end
            exports["np-notyfikacje"]:noti("Zakupujesz ulepszenie: "..v[1])
            setElementData(localPlayer"apunkty"punkty-tonumber(v[3]))
        end
    end
  end
end)

addEvent("pokazTopke:autobusy:client"true)
addEventHandler("pokazTopke:autobusy:client"root, function(tabelka)
  pracownicy tabelka
end)

-- praca

local bileciki true
local trzymam1 false
local trzymam2 false
local bilet false
local klienci 0
local sprzedane 0

local markers = {
    [1] = {
        [1] = {
        {1087.161773.2710.911},
        {1053.761815.6410.67},  
        {1010.271832.4510.671},
        {1009.941880.9610.67},
        {1009.551924.8910.67},
        {1009.961991.1110.671},
        {1009.892034.5510.67},
        {1044.432050.6710.67},
        {1129.282050.5710.671},
        {1201.872050.4613.55},
        {1282.722050.9710.67},
        {1294.742007.4510.671},
        {1297.681955.6210.67},
        {1331.711950.7910.67},
        {1375.381952.1810.67},
        {1384.831919.9010.671}, 
        {1386.441878.7110.83},
        {1474.151870.9010.67},
        {1545.981871.0310.67},
        {1626.761870.8210.67},
        {1709.241880.8810.67},
        {1709.461986.9410.67},
        {1745.632050.2510.741}, 
        {1820.352050.1110.83},
        {1908.392038.9710.671},
        {1936.682019.9910.67},
        {2015.922019.7810.67},
        {2116.022018.5910.74},
        {2125.121965.1910.70},
        {2119.961933.9010.671},
        {2125.281881.9210.67},
        {2091.931795.8110.67},
        {2054.691722.4210.67},
        {2038.801658.7210.671},
        {2046.041598.0110.67},
        {2045.711487.8110.67},
        {2046.281364.6710.67},
        {2039.481322.1510.671},
        {2046.131237.6510.67},
        {2045.701091.8710.67},
        {2044.31981.6010.64},
        {2039.55940.429.761},
        {2051.67867.116.83},
        {2090.88837.186.74},
        {2367.12831.626.73},
        {2550.50853.316.73},
        {2696.08988.216.73},
        {2728.791291.646.73},
        {2765.101394.638.56},
        {2779.661476.0010.67},
        {2677.161475.7512.08},
        {2622.971476.3610.661},
        {2525.311475.2310.67},
        {2458.761475.8910.671},
        {2429.731507.4410.67},
        {2429.701578.4510.67},
        {2405.711615.7810.67},
        {2351.051615.1310.671},
        {2329.791646.3010.67},
        {2329.701715.5510.83},
        {2329.911757.9010.67},
        {2292.601775.7410.67},
        {2154.411775.4310.67},
        {2119.331801.9710.67},
        {2149.772123.3410.67},
        {2152.422248.2010.67},
        {2229.412398.6410.67},
        {2208.912455.8310.67},
        {2128.162455.5310.671},
        {2041.532455.5810.67},
        {2025.062416.5110.67},
        {2005.172395.7310.67},
        {1965.572396.2810.671},
        {1924.812378.8410.67},
        {1924.892316.7010.671},
        {1884.002275.6010.67},
        {1794.352275.6112.48},
        {1686.882275.8510.671},
        {1579.782275.4810.67},
        {1564.362260.2810.67},
        {1564.662200.5810.671},
        {1577.452170.8710.67},
        {1615.592158.3910.67},
        {1616.082089.0910.52},
        {1616.482024.7610.67},
        {1665.352010.2510.671},
        {1704.812006.1810.74},
        {1704.991965.0310.671},
        {1702.501877.1910.67},
        {1656.591875.5810.70},
        {1577.141875.6510.67},
        {1509.041875.5610.67},
        {1416.391875.4610.67},
        {1352.841876.0510.67},
        {1324.421852.7910.671},
        {1326.311828.4210.68},
        {1269.451815.9311.23},
        {1152.161815.4410.67},
        {1098.701814.7210.67},
        {1074.951773.6110.821},
        },
    },
    [2] = {
        [1] = {
            {1087.221776.3710.821},
            {1080.081810.7610.67},    
            {1138.081793.2810.67},
            {1192.001701.986.68},
            {1206.641530.846.74},
            {1206.001396.906.73},
            {1204.281327.516.731},
            {1205.131232.546.78},
            {1205.731103.106.81},
            {1173.55925.0310.12},
            {1104.18838.6510.67},
            {1050.44800.6110.71},
            {835.22708.7611.551},
            {676.39679.178.37},
            {333.87778.826.17},
            {154.21725.906.21},
            {-46.61619.2011.93},
            {-280.75574.1615.97},
            {-453.57593.3217.181},
            {-546.94625.5616.69},
            {-692.18689.4516.62},
            {-820.81801.4518.08},
            {-848.251021.9924.67},
            {-872.891125.1226.82},
            {-877.341228.3534.03},
            {-930.721321.0238.86},
            {-1107.651157.4637.68},
            {-1209.601042.8841.95},
            {-1420.57820.1147.31},
            {-1639.95589.0240.13},
            {-1729.80496.1238.49},
            {-1821.49392.6939.35},
            {-1862.60300.8839.47},
            {-1896.49131.8238.14},
            {-1904.2040.7138.24},
            {-1911.26, -84.7038.24},
            {-1913.99, -236.1438.24},
            {-1913.48, -388.6238.24},
            {-1913.58, -506.0438.23},
            {-1913.87, -601.5038.46},
            {-1914.36, -739.0044.42},
            {-1913.94, -823.3244.95},
            {-1913.87, -950.6543.60},
            {-1908.29, -1026.1738.71},
            {-1907.94, -1147.7038.45},
            {-1907.87, -1302.7239.48},
            {-1914.91, -1361.6740.38},
            {-1871.68, -1397.3738.901},
            {-1572.17, -1522.6437.73},
            {-1547.98, -1598.7337.73},
            {-1629.03, -1618.7136.26},
            {-1723.61, -1658.2736.26},
            {-1821.80, -1718.3129.101},
            {-1952.89, -1812.4534.03},
            {-2010.39, -1880.0044.36},
            {-2080.17, -1997.6560.34},
            {-2188.60, -2159.2347.09},
            {-2314.43, -2232.2922.64},
            {-2377.19, -2263.0715.001},
            {-2430.18, -2285.9614.25},
            {-2503.52, -2300.1814.94},
            {-2540.64, -2337.1614.45},
            {-2510.49, -2447.5828.87},
            {-2457.38, -2533.8248.14},
            {-2395.47, -2596.9756.54},
            {-2307.65, -2638.2559.46},
            {-2204.80, -2681.1857.50},
            {-2089.56, -2680.1153.60},
            {-1975.94, -2642.5158.95},
            {-1907.34, -2618.8457.97},
            {-1854.06, -2606.0256.901},
            {-1764.16, -2625.6149.50},
            {-1687.06, -2703.6246.95},
            {-1582.93, -2795.0446.92},
            {-1433.98, -2922.8346.92},
            {-1317.60, -2919.7950.74},
            {-1180.73, -2870.2267.72},
            {-1015.94, -2868.4267.54},
            {-866.88, -2860.1161.86},
            {-577.41, -2788.7548.80},
            {-456.77, -2815.3547.33},
            {-217.48, -2868.9239.18},
            {-87.30, -2870.7039.24},
            {3.45, -2750.4440.60},
            {3.58, -2611.6839.92},
            {-80.68, -2464.4333.85},
            {-156.09, -2390.6131.361},
            {-240.96, -2272.8828.24},
            {-281.53, -2203.6128.39},
            {-325.48, -2071.7527.14},
            {-326.80, -1867.4721.58},
            {-273.79, -1700.4014.31},
            {-224.95, -1594.7015.55},
            {-115.26, -1464.4612.80},
            {-76.76, -1427.2512.26},
            {-20.66, -1412.3611.07},
            {-1.86, -1486.563.36},
            {-51.70, -1498.651.71},
            {-134.91, -1440.402.70},
            {-148.13, -1334.682.70},
            {-141.57, -1276.812.701},
            {-104.34, -1152.801.72},
            {-77.16, -1066.2715.10},
            {-101.27, -1009.5724.22},
            {-101.32, -950.4321.93},
            {-32.58, -810.6711.01},
            {23.06, -682.444.38},
            {44.51, -618.413.471},
            {40.63, -524.1610.07},
            {-71.13, -430.301.08},
            {-124.72, -392.271.08},
            {-226.54, -288.061.08},
            {-276.53, -217.821.08},
            {-308.38, -120.541.081},
            {-293.29, -13.851.08},
            {-242.40135.021.60},
            {-218.84192.769.61},
            {-192.03263.3812.08},
            {-185.16288.8312.08},
            {-151.40416.9012.08},
            {-128.08509.588.951}, 
            {-107.92536.997.06},
            {-19.17583.1310.52},
            {36.57631.127.36},
            {103.18667.435.53},
            {165.79703.196.13},
            {251.87738.236.13},
            {378.18752.656.13},
            {466.11716.445.69},
            {547.28673.833.36},
            {700.37654.129.46},
            {831.74679.6111.77},
            {894.54706.3010.841},
            {950.13726.1210.68},
            {1015.12751.3710.71},
            {1079.97796.1810.70},
            {1101.75810.7810.70},
            {1185.65857.5711.60},
            {1311.96898.3117.35},
            {1350.74973.4316.36},
            {1282.851068.869.74},
            {1234.251133.846.81},
            {1229.751346.766.74},
            {1229.981473.606.73},
            {1229.541634.436.73},
            {1247.191707.386.73},
            {1294.381797.9810.65},
            {1258.381816.0012.02},
            {1178.331816.0212.15},
            {1106.681816.0410.67},
            {1074.931774.6210.821},
        },
    },        
}

x39*px30*py
x2y2 39*px174*py

--guiCreateWindow(0.700.190.290.60""true)

function gbilety()
    local mxmy getCursorPosition()
    if mysz(xy370*px127*py) and getKeyState("mouse1") == true then
        x= (mx*sx-(370*px/2)),(my*sy-(127*py/2))
        trzymam1 true
        trzymam2 false
    end
    if mysz(x2y2370*px127*py) and getKeyState("mouse1") == true then
        x2y2 = (mx*sx-(370*px/2)),(my*sy-(127*py/2))
        trzymam1 false
        trzymam2 true
    end
    if mysz(587*px373*py370*px127*py) and trzymam1 == true or trzymam2 == true then
        git true
    else
        git false
    end
    if mysz(587*px373*py370*px127*py) and git == true and getKeyState("mouse1") ~= true then
        sprzedal()
        trzymam1 false
        trzymam2 false
        git false
    end
    dxDrawImage(00sxsy":np-gui/grafiki/tlo.png"000tocolor(255255255255), false)
    dxDrawImage(xy370*px127*py":np-autobusy/img/ulgowy.png"000tocolor(255255255255), false)
    dxDrawImage(x2y2370*px127*py":np-autobusy/img/normalny.png"000tocolor(255255255255), false)
    dxDrawLine(586*px372*py586*px500*pytocolor(25175131255), 2false)
    dxDrawLine(957*px372*py586*px372*pytocolor(25175131255), 2false)
    dxDrawLine(586*px500*py957*px500*pytocolor(25175131255), 2false)
    dxDrawLine(957*px500*py957*px372*pytocolor(25175131255), 2false)
    --dxDrawRectangle(587*px373*py370*px127*pytocolor(000120), false)
    dxDrawText(bilet[1], 585*px373*py957*px500*pytocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
    if not myElement or not myObject then return end
    local projPosXprojPosY guiGetPosition(guiWindow,true)
    local projSizeXprojSizeY guiGetSize(guiWindowtrue)
    exports.object_preview:setProjection(myObjectprojPosXprojPosYprojSizeXprojSizeYtruetrue)
end

function rozpocznijprace()
    setElementData(localPlayer"pracuje""autobusy")
    exports["np-notyfikacje"]:noti("Rozpoczynasz prace")
    triggerServerEvent("dajAutobus:autobusy"localPlayer)
    punkty 0
    if getElementData(localPlayer"autobusy:ulepszenie1") == 1 then
        region 2 
    else
        region 1
    end
    los math.random(1#markers[region])
    showMarkers()
end

function zakonczprace(cos)
    setElementData(localPlayer"pracuje"false)
    triggerServerEvent("usunAutobus:autobusy"localPlayer)
    if isElement(markerthen
        destroyElement(marker)
    end
    if isElement(blipthen
        destroyElement(blip)
    end
    if cos then
        setElementPosition(localPlayer1621.62, -1139.1023.91)
    end
end
addEvent("zakonczPrace:autobusy"true)
addEventHandler("zakonczPrace:autobusy"rootzakonczprace)

function showMarkers()
    if isElement(markerthen
        destroyElement(marker)
    end
    if isElement(blipthen
        destroyElement(blip)
    end
    if punkty == #markers[region][los] then return end
    punkty punkty 1
    local przystanek markers[region][los][punkty][4] or 0
    if przystanek == 1 then
        rg25500
    else
        rg00255
    end
    marker createMarker(markers[region][los][punkty][1], markers[region][los][punkty][2], markers[region][los][punkty][3], "checkpoint"4rgb)
    blip createBlipAttachedTo(marker41)
    setElementData(marker"przystanek", (markers[region][los][punkty][4] or ))
    if markers[region][los][punkty+1then
        ile markers[region][los][punkty+1]
        setMarkerTarget(markerile[1], ile[2], ile[3])
    end
    addEventHandler("onClientMarkerHit"markermarkersHit)
end

local bilety = {
    {"Ulgowy"},
    {"Normalny"},
}

function markersHit(gracz)
    if gracz ~= localPlayer then return end
    if punkty == #markers[region][los] then
        zakonczprace()
        triggerServerEvent("daj:azlecenia"localPlayerlocalPlayer)
    end
    if getElementData(source"przystanek") == 1 then
        addEventHandler("onClientRender"rootgbilety)
        showCursor(true)
        bileciki true
        setElementData(localPlayer"hud"true)
        setElementFrozen(getPedOccupiedVehicle(localPlayer), true)
        local x1y1z1 getCameraMatrix()
        myElement createPed(math.random(1041), x1y1z10)
        myObject exports.object_preview:createObjectPreview(myElement000100.511truetruetrue)
        guiWindow guiCreateWindow(987*px186*py418*px506*py""falsefalse)
        guiSetAlpha(guiWindow0)
        local projPosXprojPosY guiGetPosition(guiWindow,true)
        local projSizeXprojSizeY guiGetSize(guiWindowtrue)
        exports.object_preview:setProjection(myObjectprojPosXprojPosYprojSizeXprojSizeYtruetrue)
        exports.object_preview:setRotation(myObject, -100160)
        bilet bilety[math.random(#bilety)]
        klienci math.random(2,4)
        --outputChatBox(klienci)
        sprzedane 0
    else
        showMarkers()
        if getElementData(localPlayer"autobusy:ulepszenie1") == 1 then
               zarobek2 math.random(710)
           else
               zarobek2 math.random(510)
           end
        if getElementData(localPlayer"premium"then
            zarobek2 zarobek2 zarobek2*0.15
        end
        setElementData(localPlayer"pieniadze"getElementData(localPlayer"pieniadze")+zarobek2)
        local nagroda math.random(120)
        if tonumber(nagroda) == 5 then
            local los2 math.random(1,3)
            if getElementData(localPlayer"premium"then
                los2 math.random(26)
            end
            setElementData(localPlayer"punkty"getElementData(localPlayer"punkty")+los2)
            exports["np-notyfikacje"]:noti("Za dobr? prace otrzymujesz "..los2.." RP")
        end
    end
end

function sprzedal()
    if (bilet[1] == "Ulgowy" and trzymam2 == true) or (bilet[1] == "Normalny" and trzymam1 == truethen
        exports["np-notyfikacje"]:noti("Da?e? klientowi z?y bilet""error")
    else
        exports["np-notyfikacje"]:noti("Sprzedajesz bilet klientowi")
        if getElementData(localPlayer"autobusy:ulepszenie1") == 1 then
            zarobek math.random(1018)
        else
            zarobek math.random(816)
        end
        if getElementData(localPlayer"premium"then
            zarobek zarobek zarobek*0.15
        end
        if getElementData(localPlayer"autobusy:ulepszenie2") == 1 then
            zarobek zarobek zarobek*0.05
        end
        setElementData(localPlayer"pieniadze"getElementData(localPlayer"pieniadze")+zarobek)
    end
    sprzedane sprzedane 1
    bilet bilety[math.random(#bilety)]
    if sprzedane >= klienci then 
        showMarkers() 
        removeEventHandler("onClientRender"rootgbilety)
        showCursor(false)
        bileciki false
        x39*px30*py
        x2y2 39*px174*py
        setElementFrozen(getPedOccupiedVehicle(localPlayer), false)
        if isElement(myElementthen
            destroyElement(myElement)
        end
        setElementData(localPlayer"hud"false)
    return end
    local punkty getElementData(localPlayer"apunkty") or 0
    setElementData(localPlayer"apunkty"punkty+math.random(0,1))
    x39*px30*py
    x2y2 39*px174*py
    if isElement(myElementthen
        destroyElement(myElement)
    end
    local x1y1z1 getCameraMatrix()
    myElement createPed(math.random(1041), x1y1z10)
    myObject exports.object_preview:createObjectPreview(myElement000100.511truetruetrue)
    guiWindow guiCreateWindow(987*px186*py418*px506*py""falsefalse)
    guiSetAlpha(guiWindow0)
    local projPosXprojPosY guiGetPosition(guiWindow,true)
    local projSizeXprojSizeY guiGetSize(guiWindowtrue)
    exports.object_preview:setProjection(myObjectprojPosXprojPosYprojSizeXprojSizeYtruetrue)
    exports.object_preview:setRotation(myObject, -100160)
end

--opcje

function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
    dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5)
    dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
end

function mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function scale_x(value)
    local result = (value 1440) * sx

    return result
end

function scale_y(value)
    local result = (value 900) * sy

    return result
end


s.lua
function pokazpracownikow()
    local q exports['np-mysql']:wykonaj("SELECT * from konta order by azlecenia desc")
    local topka = {}

    for 1,do
        table.insert(topka, {nick q[i]["login"], liczba q[i]["azlecenia"]})
    end

    return topka
end

tablica pokazpracownikow()

setTimer(function()
    tablica pokazpracownikow()
end6000000)

addEvent("pokazTopke:autobusy:source"true)
addEventHandler("pokazTopke:autobusy:source"root, function()
    triggerClientEvent(source"pokazTopke:autobusy:client"sourcetablica)
end)

addEvent("daj:azlecenia"true)
addEventHandler("daj:azlecenia"root, function(player)
    local dbid getElementData(player"dbid")
    local ilosc getElementData(player"azlecenia") or 0
    local q exports['np-mysql']:wykonaj("UPDATE konta SET azlecenia=azlecenia+1 where dbid=?"dbid)
    setElementData(player"azlecenia"ilosc+1)
end)

bus = { }

addEvent("dajAutobus:autobusy"true)
addEventHandler("dajAutobus:autobusy"root, function()
    if getElementData(source"autobusy:ulepszenie1") == 1 then
        bus[source] = createVehicle(4311104.131735.1910.490.40.00.0)
    else
        bus[source] = createVehicle(4181104.131735.1910.490.40.10.0)
    end
    warpPedIntoVehicle(sourcebus[source])
    setElementDimension(bus[source], 0)
    setVehicleDamageProof(bus[source], true)
    triggerClientEvent(root"ghost:vehicle"rootbus[source])
    setElementData(bus[source], "kierowca:autobusy"getElementData(source"dbid"))
    setVehicleColor(bus[source], 255255255255255255)
end)

addEvent("usunAutobus:autobusy"true)
addEventHandler("usunAutobus:autobusy"root, function()
    if isElement(bus[client]) then
        destroyElement(bus[client])
    end
end)

addEventHandler("onVehicleStartExit"resourceRoot, function(gracz)
    if getElementData(gracz"pracuje") ~= "autobusy" then return end
    triggerClientEvent(gracz"zakonczPrace:autobusy"gracztrue)
end)

addEventHandler("onVehicleStartEnter"root, function(graczseat)
    if getElementData(gracz"pracuje") == "autobusy" then
        if getElementData(source"id"then
            cancelEvent()
        end
        if getElementData(source"kierowca:autobusy") ~= getElementData(gracz"dbid"then
            cancelEvent()
        end
    else
        if getElementData(source"kierowca:autobusy"then
            cancelEvent()
        end
    end
end)

addEventHandler("onPlayerQuit"root, function()
    if isElementbus[source] ) then
        destroyElementbus[source] )
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-25, 16:19


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Zobacz w /debugscript 3 i wy?lij zdj?cie b??d?w je?li takie b?d?.

Ja nie mia?em styczno?ci z tym Gamemodem i nie wiem o czym m?wi? Adaskokieblasko

Wy?lesz b??dy to si? wszystkiego dowiemy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-25, 17:41


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

Debugscript 3


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-25, 18:18


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Wys?a?e? kod od autobus?w a nie dzia?aj???mieciarki, wy?lij odpowiedni kod.

Z tego co pisa? Adaskokieblasko wywnioskowa?em, ?e wie jak naprawi? Tw?j b??d - musisz poczeka? na pomoc z Jego strony, sam spr?buje Ci pom?c kiedy otrzymam odpowiedni kod.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-25, 20:01


Adaskokieblasko







Wiek: 23
Na forum: 2954 dni
Posty: 101

Piwa: 18

Respekt: 100
Respekt: 100

np-smieciarki > s.lua > zmie? nazw? wadliwych event?w NP


addEvent("dajSmieciarke:smieciarki"true)
addEventHandler("dajSmieciarke:smieciarki"root, function(el)

na

addEvent("NadajSmieciarke"true)
addEventHandler("NadajSmieciarke"root, function(el)

oraz po stronie clienta
z

    triggerServerEvent("dajSmieciarke:smieciarki"localPlayer)

na

    triggerServerEvent("NadajSmieciarke"localPlayer)


Edit//Dodam ze w moim przypadku nie trzeba by?o zmienia? nazw po prostu w s.lua
starczy?o usun?? nazw? eventu i nada? j? ponownie (( w razie co podaje ten spos?b jest szybszy i prostszy ))

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-25, 21:35


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

Nic nie zadzia?a?o :( Adaskokieblasko
DEBUGSCRIPT 3


[ Dodano: 2019-01-25, 21:39 ]
np-smieciarki >> c.lua
--[[
    AutorMalentas
]]
 
local sxsy guiGetScreenSize()
local okno1 false
local ulepszenia false
 
local pracodawca createPed(272076.60, -2045.0313.59180)
setElementData(pracodawca"name""Pracodawca")
setElementDimension(pracodawca0)
setElementFrozen(pracodawcatrue)
local rozpoczecie createMarker(2076.85, -2047.2213.59-.95"cylinder"1255255255)
setElementData(rozpoczecie"praca"true)
setElementDimension(rozpoczecie0)
 
 
addEventHandler("onClientMarkerHit"rozpoczecie, function(gracz)
    if gracz ~= localPlayer then return end
    if getPedOccupiedVehicle(localPlayerthen return end
    if getElementData(localPlayer"block:prawko"then exports["np-notyfikacje"]:noti("Posiadasz zabrane prawo jazdy kat. A, B, C""error") return end
    if getElementData(localPlayer"punkty") < 75 then exports["np-notyfikacje"]:noti("Nie posiadasz 120 punkt?w reputacji!""error") return end
    if getElementData(localPlayer"pracuje"then
        if getElementData(localPlayer"pracuje") ~= "smieciarki" then exports["np-notyfikacje"]:noti("Posiadasz inn? aktywn? prace!""error") return end
    end
    addEventHandler("onClientRender"rootguistart)
    okno1 true
    showCursor(true)
    triggerServerEvent("pokazTopke:smieciarki:source"localPlayer)
end)
 
local font dxCreateFont("cz.ttf"10)
local font2 dxCreateFont("cz.ttf"12)
 
local font dxCreateFont("cz.ttf"10)
local font2 dxCreateFont("cz.ttf"12)
 
local pracownicy = { }
 
local listaulepszen = {
    {"Sprint""Dzi?ki temu ulepszeniu mo?esz biega? z koszem"300"dolar.png"},
    {"Szybsze ?adowanie""Dzi?ki temu ulepszeniu b?dziesz szybciej ?adowa? ?mieci"500"dolar.png"},
    {"Zarobek +5%""Dzi?ki temu ulepszeniu zarabiasz wi?cej o 5%"700"dolar.png"},
    {"Pojemniejsza ?mieciarka""Dzi?ki temu ulepszeniu twoja smieciarka zmiesci wi?cej koszy"500"dolar.png"},
}
 
 
function guistart()
    dxDrawImage(scale_x(402), scale_y(251), scale_x(637), scale_y(399), ":np-gui/grafiki/tlo.png"000tocolor(255255255255), false)
    if ulepszenia == false then
       local punkty getElementData(localPlayer"spunkty") or 0
       local zlecenia getElementData(localPlayer"szlecenia") or 0
        shadowText("Praca zbieracza smieci"scale_x(401), scale_y(251), scale_x(1039), scale_y(295), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        --shadowText("Wymagania:\nBRAK"scale_x(401), scale_y(295), scale_x(719), scale_y(449), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        shadowText("Wykonane zlecenia: "..zlecenia.."\nPunkty: "..punkty..""scale_x(402), scale_y(510), scale_x(719), scale_y(646), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        shadowText("Top pracownicy:"scale_x(719), scale_y(295), scale_x(1036), scale_y(329), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        dxDrawImage(scale_x(415), scale_y(310), scale_x(304), scale_y(175), ":np-magazynier/grafiki/bg2.png"000tocolor(255255255255), false)
        shadowText("Wymagania: Kategoria C\n75 Punkt?w reputacji"scale_x(415), scale_y(500), scale_x(719), scale_y(548), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        if mysz(scale_x(889), scale_y(592), scale_x(139), scale_y(44)) then
           dxDrawImage(scale_x(889), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_on.png"000tocolor(255255255255), false)
        else
           dxDrawImage(scale_x(889), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_off.png"000tocolor(255255255255), false)
        end
        if mysz(scale_x(729), scale_y(592), scale_x(139), scale_y(44)) then
           dxDrawImage(scale_x(729), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_on.png"000tocolor(255255255255), false)
        else
           dxDrawImage(scale_x(729), scale_y(592), scale_x(139), scale_y(44), ":np-gui/grafiki/button_off.png"000tocolor(255255255255), false)
        end
        if getElementData(localPlayer"pracuje") == "smieciarki" then
           shadowText("Zako?cz prace"scale_x(728), scale_y(591), scale_x(868), scale_y(636), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        else
           shadowText("Rozpocznij prace"scale_x(728), scale_y(591), scale_x(868), scale_y(636), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        end
        shadowText("Ulepszenia"scale_x(888), scale_y(592), scale_x(1028), scale_y(637), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        dxDrawImage(scale_x(1010), scale_y(261), scale_x(25), scale_y(25), ":np-gui/grafiki/cross.png"000tocolor(255255255255), false)
        shadowText("Nickname:"scale_x(729), scale_y(329), scale_x(880), scale_y(363), tocolor(255255255255), 1.00font"center""center"falsefalsefalsefalsefalse)
        shadowText("Wykonane zlecenia:"scale_x(877), scale_y(329), scale_x(1028), scale_y(363), tocolor(255255255255), 1.00font"center""center"falsefalsefalsefalsefalse)
 
        for iv in ipairs(pracownicy) do
           local dodatekY = (scale_y(37))*(i-1)
           local dodatekY2 = (scale_y(74))*(i-1)
 
           dxDrawRectangle(scale_x(729), scale_y(363) + dodatekYscale_x(299), scale_y(35), tocolor(000120), false)
           shadowText(v.nickscale_x(729), scale_y(364) + dodatekY2scale_x(877), scale_y(398), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
           shadowText(v.liczbascale_x(880), scale_y(364) + dodatekY2scale_x(1028), scale_y(398), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        end
    else
        local punkty getElementData(localPlayer"spunkty") or 0
        shadowText("Kupno ulepszen"scale_x(401), scale_y(251), scale_x(1039), scale_y(295), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        dxDrawImage(scale_x(1011), scale_y(262), scale_x(16), scale_y(16), ":np-gui/grafiki/cofnij.png"000tocolor(255255255255), false)
        dxDrawText("Posiadasz: "..punkty.." punkt?w"scale_x(402), scale_y(582), scale_x(1037), scale_y(648), tocolor(02550255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        for iv in ipairs(listaulepszen) do
            local dodatekY = (scale_y(72))*(i-1)
            local dodatekY2 = (scale_y(144))*(i-1)
 
            dxDrawRectangle(scale_x(417), scale_y(297)+dodatekYscale_x(610), scale_y(70), tocolor(000120), false)
            dxDrawImage(scale_x(432), scale_y(307)+dodatekYscale_x(50), scale_y(50), ":np-magazynier/grafiki/"..v[4]..""000tocolor(255255255255), false)
            shadowText(v[1], scale_x(501), scale_y(297)+dodatekY2scale_x(874), scale_y(332), tocolor(255255255255), 1.00font2"left""center"falsefalsefalsefalsefalse)
            shadowText(v[2], scale_x(501), scale_y(332)+dodatekY2scale_x(874), scale_y(367), tocolor(255255255255), 1.00font"left""center"falsefalsefalsefalsefalse)
            if mysz(scale_x(904), scale_y(312)+dodatekYscale_x(113), scale_y(38)) then
                dxDrawImage(scale_x(904), scale_y(312)+dodatekYscale_x(113), scale_y(38), ":np-gui/grafiki/button_on.png"000tocolor(255255255255), false)
            else
                dxDrawImage(scale_x(904), scale_y(312)+dodatekYscale_x(113), scale_y(38), ":np-gui/grafiki/button_off.png"000tocolor(255255255255), false)
            end
            shadowText("Zakup"scale_x(904), scale_y(312)+dodatekY2scale_x(1017), scale_y(350), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
            shadowText("Cena: "..v[3].."p"scale_x(781), scale_y(297)+dodatekY2scale_x(894), scale_y(335), tocolor(255255255255), 1.00font2"center""center"falsefalsefalsefalsefalse)
        end
    end
end
 
addEventHandler("onClientClick"root, function(btnstate)
  if btn == "left" and state == "down" then
    if mysz(scale_x(729), scale_y(592), scale_x(139), scale_y(44)) and okno1 == true and ulepszenia == false then
        if getElementData(localPlayer"pracuje") == "smieciarki" then
            zakonczprace()
        else
            rozpocznijprace()
        end
    elseif mysz(scale_x(889), scale_y(592), scale_x(139), scale_y(44)) and okno1 == true and ulepszenia == false then
        ulepszenia true
    elseif mysz(scale_x(1010), scale_y(261), scale_x(16), scale_y(16)) and okno1 == true and ulepszenia == false then
        removeEventHandler("onClientRender"rootguistart)
        okno1 false
        showCursor(false)
    elseif mysz(scale_x(1011), scale_y(262), scale_x(16), scale_y(16)) and okno1 == true and ulepszenia == true then
        ulepszenia false
    end
    for iv in ipairs(listaulepszen) do
        local dodatekY = (scale_y(72))*(i-1)
        if mysz(scale_x(904), scale_y(312)+dodatekYscale_x(113), scale_y(38)) and okno1 == true and ulepszenia == true then
            local punkty getElementData(localPlayer"spunkty") or 0
            if punkty tonumber(v[3]) then exports["np-notyfikacje"]:noti("Posiadasz za ma?o punkt?w by zakupi? to ulepszenie""error") return end
            if v[1] == "Szybsze ?adowanie" then
                if getElementData(localPlayer"smieciarki:ulepszenie2") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie""error") return end
                setElementData(localPlayer"smieciarki:ulepszenie2"1)
            elseif v[1] == "Sprint" then
                if getElementData(localPlayer"smieciarki:ulepszenie1") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie""error") return end
                setElementData(localPlayer"smieciarki:ulepszenie1"1)
            elseif v[1] == "Zarobek +5%" then
                if getElementData(localPlayer"smieciarki:ulepszenie3") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie""error") return end
                setElementData(localPlayer"smieciarki:ulepszenie3"1)
            elseif v[1] == "Pojemniejsza ?mieciarka" then
                if getElementData(localPlayer"smieciarki:ulepszenie4") == 1 then exports["np-notyfikacje"]:noti("Posiadasz ju? to ulepszenie""error") return end
                setElementData(localPlayer"smieciarki:ulepszenie4"1)
            end
            exports["np-notyfikacje"]:noti("Zakupujesz ulepszenie: "..v[1])
            setElementData(localPlayer"spunkty"punkty-tonumber(v[3]))
        end
    end
  end
end)
 
addEvent("pokazTopke:smieciarki:client"true)
addEventHandler("pokazTopke:smieciarki:client"root, function(tabelka)
  pracownicy tabelka
end)
 
--praca
 
local kosz = {}
local kmarker = {}
local kblip = {}
local liczbakoszy 5
local max 20
local czas 4000

local odklada false
 
--Jefferson
local miejsce1 = {
    {2134.10, -1375.3023.98},
    {2190.74, -1375.7223.99},
    {2138.45, -1406.0023.99},
    {2138.42, -1411.3323.99},
    {2138.24, -1452.1323.98},
}
 
--Ganton
local miejsce2 = {
    {2498.26, -1686.7013.48},
    {2505.73, -1654.0713.59},
    {2490.30, -1647.0814.08},
    {2468.72, -1648.2613.47},
    {2471.70, -1684.6713.51},
}
 
--Idlewood
local miejsce3 = {
    {2067.43, -1733.5513.88},
    {2065.64, -1701.9114.15},
    {2072.29, -1653.7113.55},
    {2013.18, -1653.4213.55},
    {2012.33, -1629.0713.55},
}
 
--Glen Park
local miejsce4 = {
    {1937.65, -1126.8925.42},
    {1903.61, -1116.7725.66},
    {1939.73, -1062.3324.42},
    {2025.53, -1056.7924.69},
    {1858.05, -1159.6123.86},
}
 
--Market
local miejsce5 = {
    {1184.90, -1257.6315.18},
    {1185.32, -1257.9118.90},
    {1181.94, -1230.2118.55},
    {1185.18, -1230.0722.14},
    {1134.85, -1211.1018.55},
}
 
--Marina
local miejsce6 = {
    {819.46, -1495.7913.59},
    {867.32, -1509.5613.55},
    {843.90, -1481.2013.60},
    {785.13, -1460.9613.55},
    {811.44, -1553.4413.59},
}
 
--Richman
local miejsce7 = {
    {298.88, -1335.2653.44},
    {253.61, -1364.6453.11},
    {250.39, -1271.3273.84},
    {254.48, -1219.2475.31},
    {280.82, -1259.1073.92},
}
 
--Las Colinas
local miejsce8 = {
    {2528.09, -1036.6969.58},
    {2501.15, -1062.8270.16},
    {2488.55, -1013.4465.40},
    {2629.20, -1071.0869.62},
    {2556.71, -956.1282.73},
}
 
function rozpocznijprace()
    if getElementData(localPlayer"prawko_c") ~= 1 then exports["np-notyfikacje"]:noti("Nie posiadasz prawa jazdy kat. c""error") return end
    setElementData(localPlayer"pracuje""smieciarki")
    triggerServerEvent("skin:praca"localPlayer260)
    triggerServerEvent("NadajSmieciarke"localPlayer)
    removeEventHandler("onClientRender"rootguistart)
    okno1 false
    showCursor(false)
    stowrzKosze()
    wysypisko createMarker(2080.57, -2000.4812.65"cylinder"4.502550)
    bwysypisko createBlipAttachedTo(wysypisko11)
    setElementData(localPlayer"liczbakoszy"0)
    odklada false
    addEventHandler("onClientMarkerHit"wysypisko, function(gracz)
        if gracz ~= localPlayer then return end
        local ile getElementData(localPlayer"liczbakoszy")
        if ile <= 1 then exports["np-notyfikacje"]:noti("Aby wy?adowa? smieciarke musisz za?adowa? wi?cej ni? 1 kosz!""error") return end
        local zarobek 90*ile
        if getElementData(localPlayer"premium"then
            zarobek zarobek+(zarobek*0.15)
        end
        local nagroda math.random(0,1)
        if getElementData(localPlayer"premium"then
            nagroda nagroda+(nagroda*2)
        end
        if getElementData(localPlayer"smieciarki:ulepszenie3") == 1 then
            zarobek zarobek+(zarobek*0.05)
        end
        setElementData(localPlayer"pieniadze"getElementData(localPlayer"pieniadze")+zarobek)
        setElementData(localPlayer"punkty"getElementData(localPlayer"punkty")+nagroda)
        exports["np-notyfikacje"]:noti("Wy?adowa?e? smieciarke zarabiasz: "..zarobek.." PLN")
        setElementData(localPlayer"liczbakoszy"0)
        setElementData(getPedOccupiedVehicle(localPlayer), "nametag""")
    end)
end
 
function stowrzKosze()
    local los math.random(18)
    if los == 1 then
        trasa miejsce1
    elseif los == 2 then
        trasa =  miejsce2
    elseif los == 3 then
        trasa =  miejsce3
        elseif los == 4 then
        trasa =  miejsce4
       elseif los == 5 then
        trasa =  miejsce5
       elseif los == 6 then
        trasa =  miejsce6
   elseif los == 7 then
        trasa =  miejsce7
elseif los == 8 then
        trasa =  miejsce8
    end
    liczbakoszy 5
    for iv in ipairs(trasa) do
        kmarker[i] = createMarker(v[1], v[2], v[3], "corona"1.20,0,0,0)
        kosz[i] = createObject(1339v[1], v[2], v[3]-0.35)
        kblip[i] = createBlipAttachedTo(kosz[i], 41)
        setElementData(kmarker[i], "kosz"kosz[i])
        setElementData(kmarker[i], "blip"kblip[i])
        setElementCollisionsEnabled(kosz[i], false)
        addEventHandler("onClientMarkerHit"kmarker[i], function(gracz)
            if gracz ~= localPlayer then return end
            if getPedOccupiedVehicle(localPlayerthen return end
            if getElementData(localPlayer"kosz"then return end
            --destroyElement(getElementData(source"kosz"))
            attachElements(getElementData(source"kosz"), localPlayer00.7, -0.400180)
            setElementData(localPlayer"kosz"getElementData(source"kosz"))
            destroyElement(getElementData(source"blip"))
            destroyElement(source)
            toggleControl("jump"false)
            if getElementData(localPlayer"smieciarki:ulepszenie1") == 1 then
                toggleControl("walk"true)
                setControlState(localPlayer"walk"false)
            else
                toggleControl("walk"false)
                setControlState(localPlayer"walk"true)
            end
            setPedWalkingStyle(localPlayer66)    
        end)
    end
end
 
addEventHandler("onClientVehicleExit"root, function(graczseat)
    if gracz ~= localPlayer then return end
    if getElementData(localPlayer"pracuje") == "smieciarki" then
        local x,y,getElementPosition(source)
        pmarker createMarker(x,y,z"corona"10,0,0,0)
        setElementData(pmarker"pojazd"source)
        attachElements(pmarkersource0.121, -4.047, -0.641)
        addEventHandler("onClientMarkerHit"pmarker, function(gracz)
            if gracz ~= localPlayer then return end
            if odklada == true then return end
            if getElementData(localPlayer"kosz") and isPedOnGround(localPlayerthen
                if getElementData(localPlayer"smieciarki:ulepszenie4") == 1 then
                    max 30
                else
                    max 20
                end
                local ile getElementData(localPlayer"liczbakoszy") or 0
                if tonumber(ile) >= tonumber(maxthen exports["np-notyfikacje"]:noti("Twoja ?mieciarka ma pe?ny zbiornik. Jed? na wysypisko aby j? wy?adowa?.") return end
                toggleAllControls(false)
                exports["np-notyfikacje"]:noti("Trwa wy?adowywanie kosza...")
                setElementFrozen(localPlayertrue)
                if getElementData(localPlayer"smieciarki:ulepszenie1") == 1 then
                    czas 2000
                else
                    czas 4000
                end
                setElementData(localPlayer"liczbakoszy"ile+1)
                odklada true
                setTimer(function()
                    odklada false
                    setElementFrozen(localPlayerfalse)
                    exports["np-notyfikacje"]:noti("Kosz zosta? wy?adowany")
                    toggleAllControls(true)
                    toggleControl("fire"false)
                    toggleControl("aim_weapon"false)
                    destroyElement(getElementData(localPlayer"kosz"))
                    toggleControl("walk"true)
                    setControlState(localPlayer"walk"false)
                    toggleControl("jump"true)
                    setPedWalkingStyle(localPlayer0)
                    setElementData(localPlayer"kosz"false)
                    liczbakoszy =  liczbakoszy-1
                    local nagroda math.random(110)
                    if tonumber(nagroda) == 5 then
                        local los2 math.random(1,3)
                        if getElementData(localPlayer"premium"then
                            los2 math.random(26)
                        end
                        setElementData(localPlayer"punkty"getElementData(localPlayer"punkty")+los2)
                        exports["np-notyfikacje"]:noti("Za dobr? prace otrzymujesz "..los2.." RP")
                    end
                    local pkt getElementData(localPlayer"spunkty") or 0
                    setElementData(localPlayer"spunkty"pkt+math.random(02))
                    for iv in ipairs(getElementsByType("vehicle")) do
                        if getElementData(v"kierowca:smieciarki") and getElementData(v"kierowca:smieciarki") == getElementData(localPlayer"dbid"then
                            setElementData(v"nametag""Zape?nienie "..getElementData(localPlayer"liczbakoszy").."/"..max)
                        end
                    end
                    if liczbakoszy == 0 then
                        stowrzKosze()
                        triggerServerEvent("daj:szlecenia"localPlayerlocalPlayer)
                    end
                endczas1)
            end
        end)
    end
end)
 
addEventHandler("onClientVehicleEnter"root, function(graczseat)
    if gracz ~= localPlayer then return end
    if getElementData(localPlayer"pracuje") == "smieciarki" then
        if isElement(pmarkerthen
            destroyElement(pmarker)
        end
    end
end)
 
 
function zakonczprace()
    setElementData(localPlayer"pracuje"false)
    triggerServerEvent("skin:praca"localPlayergetElementData(localPlayer"skin"))
    triggerServerEvent("usunSmieciarke:smieciarki"localPlayer)
    setElementData(localPlayer"liczbakoszy"0)
    odklada false
    for iv in ipairs(kmarker) do
        if isElement(vthen
            destroyElement(v)
        end
    end
    for iv in ipairs(kblip) do
        if isElement(vthen
            destroyElement(v)
        end
    end
    for iv in ipairs(kosz) do
        if isElement(vthen
            destroyElement(v)
        end
    end
    if isElement(pmarkerthen
        destroyElement(pmarker)
    end
    if isElement(wysypiskothen
        destroyElement(wysypisko)
    end
    if isElement(bwysypiskothen
        destroyElement(bwysypisko)
    end
end
 
 
--opcje
 
function shadowText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
    dxDrawText(text,x+1,y+1,w+1,h+1,tocolor(0,0,0),size,font,xx,yy,x1,x2,x3,x4,x5)
    dxDrawText(text,x,y,w,h,color,size,font,xx,yy,x1,x2,x3,x4,x5)
end
 
function mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end
 
function scale_x(value)
    local result = (value 1440) * sx
 
    return result
end
 
function scale_y(value)
    local result = (value 900) * sy
 
    return result
end


np-smieciarki >> s.lua
local smieciarka = { }
 
function pokazpracownikow()
    local q exports['np-mysql']:wykonaj("SELECT * from konta order by szlecenia desc")
    local topka = {}
 
    for 1,do
        table.insert(topka, {nick q[i]["login"], liczba q[i]["szlecenia"]})
    end
 
    return topka
end



tablica pokazpracownikow()

setTimer(function()
    tablica pokazpracownikow()
end6000000)
+

addEvent("pokazTopke:smieciarki:source"true)
addEventHandler("pokazTopke:smieciarki:source"root, function()
    triggerClientEvent(source"pokazTopke:smieciarki:client"sourcetablica)
end)
 
addEvent("NadajSmieciarke"true)
addEventHandler("NadajSmieciarke"root, function(el)
    smieciarka[source] = createVehicle(4082080.96, -2020.4814.101.30.1264.8)
    warpPedIntoVehicle(sourcesmieciarka[source])  
    triggerClientEvent(root"ghost:vehicle"rootsmieciarka[source])
    setElementData(smieciarka[source], "kierowca:smieciarki"getElementData(source"dbid"))
end)
 
addEvent("usunSmieciarke:smieciarki"true)
addEventHandler("usunSmieciarke:smieciarki"root, function(el)
    if isElement(smieciarka[source]) then
        destroyElement(smieciarka[source])
    end
end)
 
addEventHandler("onPlayerQuit"root, function()
    if isElement(smieciarka[source]) then
        destroyElement(smieciarka[source])
    end
end)
 
addEvent("daj:szlecenia"true)
addEventHandler("daj:szlecenia"root, function(player)
    local dbid getElementData(player"dbid")
    local ilosc getElementData(player"szlecenia") or 0
    local q exports['np-mysql']:wykonaj("UPDATE konta SET szlecenia=szlecenia+1 where dbid=?"dbid)
    setElementData(player"szlecenia"ilosc+1)
end)
 
 
addEventHandler("onVehicleStartEnter"root, function(graczseat)
    if seat ~= 0 then return end
    if getElementData(gracz"pracuje") == "smieciarki" then
        if getElementData(source"id"then
            cancelEvent()
        end
        if getElementData(source"kierowca:smieciarki") ~= getElementData(gracz"dbid"then
            cancelEvent()
        end
    else
        if getElementData(source"kierowca:smieciarki"then
            cancelEvent()
        end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-25, 23:25


Adaskokieblasko







Wiek: 23
Na forum: 2954 dni
Posty: 101

Piwa: 18

Respekt: 100
Respekt: 100

Wska? 8 linijk? + PW odczytaj

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-26, 00:06


Fl!k







Wiek: 26
Na forum: 3592 dni
Posty: 162

Piwa: 18

Respekt: 50

8 linijka Adaskokieblasko

s.lua
        table.insert(topka, {nick q[i]["login"], liczba q[i]["szlecenia"]})

Dalej jest problem z tym tworzeniem smieciarki :(

Postaw piwo autorowi tego posta
 

 
Tagi: prace :: newplace
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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