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

Wysłany: 2019-01-27, 14:35


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot?? gdy chc? rozpocz?? kurs na prawa jazdy nie mog?, nic si? nie respi oraz wyskakuje b??d w DB3
ERROR: Client (FajnyNick) triggered serverside event license:do, but event is not added serverside


2erro w DB3
Loading script failed ogrpg-offices/lincense/s_zdawanie.lua:79: unexpected symbol near')'


kod
c_category

--[[
    Resource: OURGame v2
    Developers: Split <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c) 2015 <split.programista@gmail.com>. All rights reserved.
]]

licenseCategory={
    {"A", "Pojazdy jedno&#197;&#8250;ladowe", 350000},
    {"B", "Samochody osobowe", 0},
    {"C", "Pojazdy dostawcze", 1000000},
    --{"L", "Samoloty osobowe(w trakcie prac)", 0},
}

licenseCategory2={
    {"L", "Maszyny Powietrzne", 500000},
}


c_license


--[[
    Resource: OURGame v2
    Developers: Split <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c) 2015 <split.programista@gmail.com>. All rights reserved.
]]

mojeW,mojeH = 1280, 1024
sW,sH = guiGetScreenSize()
w, h = (sW/mojeW), (sH/mojeH)

local sx, sy = guiGetScreenSize ()
 
prawko = false 

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

local marker=createMarker(-2015.17, -129.01, 35.69-1, "cylinder", 1.2, 255, 80, 0) -- Prawo Jazdy
setElementInterior(marker, 0)
setElementDimension(marker, 0)
setElementData(marker, 'typ', 'pojazd')

local marker2=createMarker(-2237.23, 2353.97, 4.98-1, "cylinder", 1.2, 255, 80, 0) -- Licencja Lotnicza
setElementInterior(marker2, 0)

local t=createElement("text")
setElementInterior(t, 0)
setElementDimension(t, 0)
setElementPosition(t,-2033.08, -117.49, 1035.17)
setElementData(t,"name","Egzamin na  prawo jazdy !")

local t2=createElement("text")
setElementInterior(t2, 0)
setElementPosition(t2, -2237.23, 2353.97, 4.98)
setElementData(t2,"name","Zdawanie licencji lotniczej")


local wm={}
--[[wm.gridlist=guiCreateWindow(0.21, 0.20, 0.57, 0.54, "Zdawanie prawa jazdy", true)
guiWindowSetSizable(wm.gridlist, false)
guiWindowSetMovable(wm.gridlist, false)
guiSetVisible(wm.gridlist, false)
wm.label=guiCreateLabel(0.02, 0.06, 0.96, 0.05, "Z poni?szej listy wybierz kategori? prawa jazdy do kt?rej chcesz przyst?pi? p??niej kliknij Przyst?p", true, wm.gridlist)
guiLabelSetHorizontalAlign(wm.label, "center", false)
guiLabelSetVerticalAlign(wm.label, "center")--]]
wm.gridlist=guiCreateGridList(357*w, 393*h, 567*w, 218*h, false)
guiGridListAddColumn(wm.gridlist, "Kategoria", 0.24)
guiGridListAddColumn(wm.gridlist, "Pojazdy", 0.24)
guiGridListAddColumn(wm.gridlist, "Koszt", 0.24)
guiGridListAddColumn(wm.gridlist, "Zaliczone", 0.24)
guiSetVisible(wm.gridlist, false)
guiSetAlpha(wm.gridlist, 0.8)
guiSetFont(wm.gridlist, "default-bold-small")
--wm.close=guiCreateButton(0.62, 0.83, 0.36, 0.13, "Zamknij", true)
--wm.submit=guiCreateButton(0.02, 0.83, 0.36, 0.13, "Przyst?p", true)

local function fillLicenseData()
    guiGridListClear(wm.gridlist)
    for i,v in ipairs(licenseCategory) do
        local row=guiGridListAddRow(wm.gridlist)
        guiGridListSetItemText(wm.gridlist, row, 1, v[1], false, false)
        guiGridListSetItemText(wm.gridlist, row, 2, v[2], false, false)
        guiGridListSetItemText(wm.gridlist, row, 3, v[3].." PLN", false, false)
        guiGridListSetItemData(wm.gridlist, row, 3, v[3])
        -- Settings
        if getElementData(localPlayer,"player:license:pj"..v[1]) == 1 then
            guiGridListSetItemText(wm.gridlist, row, 4, "TAK", false, false)
            guiGridListSetItemColor(wm.gridlist, row, 4, 0, 255, 0)
        else
            guiGridListSetItemText(wm.gridlist, row, 4, "NIE", false, false)
            guiGridListSetItemColor(wm.gridlist, row, 4, 255, 0, 0)
        end
    end
end

local function fillLicenseData2()
    guiGridListClear(wm.gridlist)
    for i,v in ipairs(licenseCategory2) do
        local row=guiGridListAddRow(wm.gridlist)
        guiGridListSetItemText(wm.gridlist, row, 1, v[1], false, false)
        guiGridListSetItemText(wm.gridlist, row, 2, v[2], false, false)
        guiGridListSetItemText(wm.gridlist, row, 3, v[3].." PLN", false, false)
        guiGridListSetItemData(wm.gridlist, row, 3, v[3])
        -- Settings
        if getElementData(localPlayer,"player:license:pj"..v[1]) == 1 then
            guiGridListSetItemText(wm.gridlist, row, 4, "TAK", false, false)
            guiGridListSetItemColor(wm.gridlist, row, 4, 0, 255, 0)
        else
            guiGridListSetItemText(wm.gridlist, row, 4, "NIE", false, false)
            guiGridListSetItemColor(wm.gridlist, row, 4, 255, 0, 0)
        end
    end
end

addEventHandler("onClientClick", root, function(btn, state)
    if btn == "left" and state == "down" then
    if prawko == true then
    if mysz(352*w, 624*h, 210*w, 78*h) then
    local selectedRow=guiGridListGetSelectedItem(wm.gridlist)
    if not selectedRow or selectedRow < 0 then return end
    local cat=guiGridListGetItemText(wm.gridlist, selectedRow, 1)
    local cost=guiGridListGetItemData(wm.gridlist, selectedRow, 3)
    local zdane=guiGridListGetItemText(wm.gridlist, selectedRow, 4)
    if tonumber(cost) > getPlayerMoney(localPlayer) then
        --outputChatBox("* Nie posiadasz tyle got?wki.", 255, 0, 0)
        triggerEvent('onClientAddNotification', localPlayer, 'Nie posiadasz wystarczaj?co got?wki\ndo przyst?pienia egzaminu z prawa jazdy', 'error')
        return
    end
    --[[if getPlayerName(localPlayer) ~= "Split" then
        outputChatBox("* W budowie...", 255, 0, 0)
        return
    end]]
    if zdane ~= "TAK" then
        triggerServerEvent("license:do", resourceRoot, tonumber(cost), cat)
        if not guiGetVisible(wm.gridlist) then return end
        guiSetVisible(wm.gridlist, false)
        showCursor(false)
    prawko = false
        removeEventHandler("onClientRender",root,gui3)
    else
        --outputChatBox("* Posiadasz ju? zdane prawo jazdy.", 255, 0, 0)
        triggerEvent('onClientAddNotification', localPlayer, 'Posiadasz prawo jazdy zaznaczonej kategorii.', 'error')
    end
    end
    end
    end
end)

addEventHandler("onClientClick", root, function(btn, state)
    if btn == "left" and state == "down" then
    if prawko == true then
    if mysz(718*w, 624*h, 210*w, 78*h) then
    if not guiGetVisible(wm.gridlist) then return end
    showCursor(false)
    guiSetVisible(wm.gridlist, false)
    removeEventHandler("onClientRender",root,gui3)
    prawko = false
    end
    end
    end
end)

addEventHandler("onClientMarkerHit", marker, function(el,md)
    if not md or el~=localPlayer then return end
    if guiGetVisible(wm.gridlist) then return end
    showCursor(true)
    guiSetVisible(wm.gridlist,true)
    if prawko == false then
    addEventHandler("onClientRender",root,gui3)
    prawko = true
    fillLicenseData()
    end
end)

addEventHandler("onClientMarkerHit", marker2, function(el,md)
    if not md or el~=localPlayer then return end
    if guiGetVisible(wm.gridlist) then return end
    showCursor(true)
    guiSetVisible(wm.gridlist,true)
    if prawko == false then
    addEventHandler("onClientRender",root,gui3)
    prawko = true
    fillLicenseData2()
    end
end)

function gui3()
        dxDrawImage(315*w, 313*h, 650*w, 400*h, "img/prawojazdy-psrpg.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
end


c_zdawanie
--[[
    Resource: OURGame v2
    Developers: Split <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c) 2015 <split.programista@gmail.com>. All rights reserved.
]]

local licenseBlip
local licenseTarget
local licenseMarker
local licenseVehicle
local licenseCategory

local categoryPositions={
    ["A"]={
        {-2054.36, -116.02, 34.91},
        {-2079.98, -117.70, 34.92},
        {-2082.32, -132.41, 34.92},
        {-2084.65, -126.50, 34.93},
        {-2091.16, -124.54, 34.92},
        {-2082.88, -129.39, 34.93},
        {-2079.84, -142.00, 34.92},
        {-2075.87, -151.57, 34.92},
        {-2080.77, -160.06, 34.92},
        {-2088.67, -162.08, 34.92},
        {-2090.31, -171.48, 34.92},
        {-2090.01, -196.33, 34.92},
        {-2090.41, -211.16, 36.55},
        {-2090.37, -224.73, 34.92},
        {-2090.30, -246.37, 34.92},
        {-2084.69, -269.75, 34.92},
        {-2071.71, -266.58, 34.92},
        {-2069.27, -239.56, 34.92},
        {-2068.44, -220.64, 34.92},
        {-2069.66, -226.65, 34.92},
        {-2074.96, -227.41, 34.92},
        {-2062.34, -227.92, 34.92},
        {-2068.32, -229.64, 34.92},
        {-2069.30, -235.38, 34.92},
        {-2068.29, -220.33, 34.92},
        {-2066.57, -211.10, 34.92},
        {-2067.62, -204.32, 34.92},
        {-2069.54, -195.51, 34.92},
        {-2071.20, -186.00, 34.92},
        {-2069.94, -175.69, 34.92},
        {-2059.62, -161.08, 34.92},
        {-2047.80, -165.49, 34.92},
        {-2048.04, -176.00, 34.92},
        {-2047.18, -192.95, 34.93},
        {-2051.01, -188.43, 34.92},
        {-2053.94, -186.29, 34.93},
        {-2048.28, -195.36, 34.93},
        {-2046.29, -216.64, 34.92},
        {-2043.80, -223.65, 34.93},
        {-2041.48, -225.98, 34.93},
        {-2045.16, -231.53, 34.92},
        {-2046.65, -247.88, 34.92},
        {-2047.15, -261.78, 34.92},
        {-2039.23, -273.45, 34.92},
        {-2022.39, -268.58, 34.91},
        {-2021.46, -230.30, 34.92},
        {-2020.82, -194.25, 34.92},
        {-2020.63, -167.90, 34.92},
        {-2030.02, -144.36, 34.92},
        {-2036.88, -142.99, 34.92},
        {-2023.21, -141.74, 34.91},
        {-2016.46, -142.01, 34.92},
    },
    ["C"]={
                {-2054.36, -116.02, 34.91},
        {-2079.98, -117.70, 34.92},
        {-2082.32, -132.41, 34.92},
        {-2084.65, -126.50, 34.93},
        {-2091.16, -124.54, 34.92},
        {-2082.88, -129.39, 34.93},
        {-2079.84, -142.00, 34.92},
        {-2075.87, -151.57, 34.92},
        {-2080.77, -160.06, 34.92},
        {-2088.67, -162.08, 34.92},
        {-2090.31, -171.48, 34.92},
        {-2090.01, -196.33, 34.92},
        {-2090.41, -211.16, 36.55},
        {-2090.37, -224.73, 34.92},
        {-2090.30, -246.37, 34.92},
        {-2084.69, -269.75, 34.92},
        {-2071.71, -266.58, 34.92},
        {-2069.27, -239.56, 34.92},
        {-2068.44, -220.64, 34.92},
        {-2069.66, -226.65, 34.92},
        {-2074.96, -227.41, 34.92},
        {-2062.34, -227.92, 34.92},
        {-2068.32, -229.64, 34.92},
        {-2069.30, -235.38, 34.92},
        {-2068.29, -220.33, 34.92},
        {-2066.57, -211.10, 34.92},
        {-2067.62, -204.32, 34.92},
        {-2069.54, -195.51, 34.92},
        {-2071.20, -186.00, 34.92},
        {-2069.94, -175.69, 34.92},
        {-2059.62, -161.08, 34.92},
        {-2047.80, -165.49, 34.92},
        {-2048.04, -176.00, 34.92},
        {-2047.18, -192.95, 34.93},
        {-2051.01, -188.43, 34.92},
        {-2053.94, -186.29, 34.93},
        {-2048.28, -195.36, 34.93},
        {-2046.29, -216.64, 34.92},
        {-2043.80, -223.65, 34.93},
        {-2041.48, -225.98, 34.93},
        {-2045.16, -231.53, 34.92},
        {-2046.65, -247.88, 34.92},
        {-2047.15, -261.78, 34.92},
        {-2039.23, -273.45, 34.92},
        {-2022.39, -268.58, 34.91},
        {-2021.46, -230.30, 34.92},
        {-2020.82, -194.25, 34.92},
        {-2020.63, -167.90, 34.92},
        {-2030.02, -144.36, 34.92},
        {-2036.88, -142.99, 34.92},
        {-2023.21, -141.74, 34.91},
        {-2016.46, -142.01, 34.92},
    },
    ["B"]={
            {-2054.36, -116.02, 34.91},
        {-2079.98, -117.70, 34.92},
        {-2082.32, -132.41, 34.92},
        {-2084.65, -126.50, 34.93},
        {-2091.16, -124.54, 34.92},
        {-2082.88, -129.39, 34.93},
        {-2079.84, -142.00, 34.92},
        {-2075.87, -151.57, 34.92},
        {-2080.77, -160.06, 34.92},
        {-2088.67, -162.08, 34.92},
        {-2090.31, -171.48, 34.92},
        {-2090.01, -196.33, 34.92},
        {-2090.41, -211.16, 36.55},
        {-2090.37, -224.73, 34.92},
        {-2090.30, -246.37, 34.92},
        {-2084.69, -269.75, 34.92},
        {-2071.71, -266.58, 34.92},
        {-2069.27, -239.56, 34.92},
        {-2068.44, -220.64, 34.92},
        {-2069.66, -226.65, 34.92},
        {-2074.96, -227.41, 34.92},
        {-2062.34, -227.92, 34.92},
        {-2068.32, -229.64, 34.92},
        {-2069.30, -235.38, 34.92},
        {-2068.29, -220.33, 34.92},
        {-2066.57, -211.10, 34.92},
        {-2067.62, -204.32, 34.92},
        {-2069.54, -195.51, 34.92},
        {-2071.20, -186.00, 34.92},
        {-2069.94, -175.69, 34.92},
        {-2059.62, -161.08, 34.92},
        {-2047.80, -165.49, 34.92},
        {-2048.04, -176.00, 34.92},
        {-2047.18, -192.95, 34.93},
        {-2051.01, -188.43, 34.92},
        {-2053.94, -186.29, 34.93},
        {-2048.28, -195.36, 34.93},
        {-2046.29, -216.64, 34.92},
        {-2043.80, -223.65, 34.93},
        {-2041.48, -225.98, 34.93},
        {-2045.16, -231.53, 34.92},
        {-2046.65, -247.88, 34.92},
        {-2047.15, -261.78, 34.92},
        {-2039.23, -273.45, 34.92},
        {-2022.39, -268.58, 34.91},
        {-2021.46, -230.30, 34.92},
        {-2020.82, -194.25, 34.92},
        {-2020.63, -167.90, 34.92},
        {-2030.02, -144.36, 34.92},
        {-2036.88, -142.99, 34.92},
        {-2023.21, -141.74, 34.91},
        {-2016.46, -142.01, 34.92},
    },
    ["L"]={
        {-2227.07, 2287.34, 26.95},
        {-2269.48, 2247.53, 35.66},
        {-2339.91, 2199.13, 35.66},
        {-2472.09, 2112.43, 35.66},
        {-2549.21, 2064.18, 35.66},
        {-2672.07, 2004.84, 35.66},
        {-2748.91, 1935.96, 35.66},
        {-2681.77, 1846.71, 42.90},
        {-2444.56, 1937.27, 45.25},
        {-2341.07, 1992.45, 45.25},
        {-2206.64, 2108.53, 45.25},
        {-2227.78, 2326.71, 8.60},
    },
    ["T"]={
        {-2003.43,438.75,35.02},
        {-2003.63, 380.51, 35.50},
        {-2003.63, 348.35, 35.50},
        {-2003.76, 303.06, 35.29},
        {-2005.54, 250.22, 30.41},
        {-2006.50, 194.44, 28.00},
        {-2006.50, 128.62, 28.00},
        {-2006.54, 52.03, 31.28},
        {-2062.99, 30.38, 35.62},
        {-2136.52, 30.39, 35.62},
        {-2166.63, -15.67, 35.62},
        {-2188.21, -70.00, 35.62},
        {-2254.33, -61.16, 35.62},
        {-2254.57, 11.85, 35.62},
        {-2252.38, 88.17, 35.62},
        {-2251.50, 164.36, 35.62},
        {-2251.39, 242.88, 35.62},
        {-2251.43, 322.06, 35.62},
        {-2290.05, 400.80, 35.47},
        {-2357.34, 477.06, 31.12},
        {-2287.46, 508.61, 35.50},
        {-2264.88, 614.11, 44.05},
        {-2264.94, 748.61, 49.81},
        {-2264.88, 892.21, 66.91},
        {-2264.81, 1013.76, 84.66},
        {-2264.47, 1072.97, 81.14},
        {-2263.62, 1095.95, 80.17},
    },
}

function finishLicense(value)
    if isElement(licenseMarker) and licenseMarker then
        destroyElement(licenseMarker)
        licenseMarker=nil
    end
    if isElement(licenseBlip) and licenseBlip then
        destroyElement(licenseBlip)
        licenseBlip=nil
    end
    if value == true then
        licenseCategory=nil
        licenseVehicle=nil
        licenseMarker=nil
        licenseTarget=nil
        licenseBlip=nil
    end
end
addEvent("license:finish",true)
addEventHandler("license:finish", resourceRoot, finishLicense)

function showMarker()
    local pos=categoryPositions[licenseCategory][licenseTarget]
    if licenseCategory ~= "L" then
    licenseMarker=createMarker(pos[1], pos[2], pos[3], "checkpoint", 2, 0, 0, 255, 155)
    else
    licenseMarker=createMarker(pos[1], pos[2], pos[3], "ring", 3.5, 0, 0, 255, 155)
    end
    licenseBlip=createBlip(pos[1], pos[2], pos[3], 41, 1.15, 0, 255, 0)
    if categoryPositions[licenseCategory][licenseTarget+1] then
          e=categoryPositions[licenseCategory][licenseTarget+1]
        setMarkerTarget(licenseMarker, e[1], e[2], e[3])
    end
    addEventHandler("onClientMarkerHit", licenseMarker, function(el,md)
        if not md or el~=localPlayer then return end
        if not getPedOccupiedVehicle(el) then return end
        if licenseTarget < #categoryPositions[licenseCategory] then
            --local sound=playSound(":ogrpg-misc/misc/point.wav")
            --setSoundVolume(sound, 1.0)
            
            finishLicense(false)
            licenseTarget=licenseTarget+1
            showMarker()
        else
            --local sound=playSound(":ogrpg-misc/misc/success.flac")
            --setSoundVolume(sound, 1.0)

            --outputChatBox("* Zda?e?(a?) egzamin. Gratulacje!")
            triggerEvent('onClientAddNotification', localPlayer, 'Pomy?lnie zda?e? egzamin z prawa jazdy.\nGratulacje!', 'success')
            triggerServerEvent("license:vehdel", resourceRoot, licenseVehicle)
            setElementData(localPlayer,"player:license:pj"..licenseCategory, 1)
            finishLicense(true)
            fadeCamera(kierowca,false,1)
            setTimer(fadeCamera,1000,1,kierowca,true,1)
            setTimer(setElementPosition,1001,1,kierowca,1074.33, -1838.75, 13.57)
        end
    end)
end

addEvent("license:start",true)
addEventHandler("license:start", resourceRoot, function(category,vehicle)
    licenseTarget=1
    licenseBlip=nil
    licenseMarker=nil
    licenseCategory=category
    licenseVehicle=vehicle
    showMarker()
end)

punkty={}

function nalicz()
    local veh=getPedOccupiedVehicle(localPlayer)
    if not veh then return end
    local x,y,z=getElementPosition(veh)
    table.insert(punkty, {x,y,z})
    outputChatBox("* Dodano")
end

addCommandHandler("zakoncz", function()
    for i,v in ipairs(punkty) do
        lol=string.format("{%.02f, %.02f, %.02f},", v[1], v[2], v[3])
        outputChatBox("        "..lol)
        killTimer(punkty_timer)
    end
end)

addCommandHandler("licz", function()
    outputChatBox("* Rozpocz??e?(a?) naliczanie, aby zako?czy? wpisz /zakoncz")
    punkty_timer=setTimer(nalicz, 3000, 0)
end)--]]


s_zdawanie
--[[
    Resource: OURGame v2
    Developers: Split <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c) 2015 <split.programista@gmail.com>. All rights reserved.
]]

--[[local marker2=createMarker(-2050.29,-106.16,35.24,"corona",2,170,200,0)

addEventHandler("onMarkerHit", marker2, function(el,md)
 setElementPosition(el,-2044.69,-94.57,35.17 )
end)--]]

--local zone = createColCuboid(-157.62562561035, 1108.4052734375, 18.613729476929, 7, 9.8, 6.4)
createBlip(-2237.23, 2353.97, 4.98, 5,2,0,0,0,0,0,275) 

addEvent("license:do",true)
addEventHandler("license:do", resourceRoot, function(cost,selected)
    if tonumber(cost) <= getPlayerMoney(client) then
        takePlayerMoney(client,cost)
    end

    local veh=nil
    --if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("* Miejsce respu zaj?te, poczekaj a? kto? wyjedzie.",client) return end
    if selected == "A" then veh=createVehicle(586,-2045.84,-122.92,34.97,359.8,0.3,358.6)
    elseif selected == "B" then veh=createVehicle(496, -2045.84,-122.92,34.97,359.8,0.3,358.6)
    elseif selected == "C" then veh=createVehicle(482, -2045.84,-122.92,34.97,359.8,0.3,358.6)
    elseif selected == "L" then veh=createVehicle(593, 324.69, 2543.67, 17.28, 359.4, 360.0, 179.0) end
    if not veh then return end
    if selected == "L" then
    setElementData(veh,"vehicle:desc","Egzamin z Licencji Lotniczej\nKategoria: "..selected.."")
    else
    setElementData(veh,"vehicle:desc","Egzamin z Prawa Jazdy\nKategoria: "..selected.."")
    end
    setElementData(veh,"vehicle:mileage",0)
    setElementData(veh,"vehicle:fuel",100)
    setElementData(veh,"vehicle:lic",true)
    setElementData(veh,"lotnicza",false)

    setElementDimension(client,0)
    setElementInterior(client,0)
    showPlayerHudComponent(client, "radar", true)
    warpPedIntoVehicle(client,veh)
    setVehicleColor(veh, 255, 80, 0, 255, 255, 255)
    triggerClientEvent(client, "license:start", resourceRoot, selected, veh)
    --outputChatBox("* "..getPlayerName(client).." rozpocz??(??a) egzamin prawa jazdy, kategoria: "..selected.."", root, 255, 0, 0)
end)

addEvent("license:vehdel", true)
addEventHandler("license:vehdel", resourceRoot, function(veh)
    destroyElement(veh)
end)

addEventHandler("onPlayerQuit", root, function()
    local veh=getPedOccupiedVehicle(source)
    if not veh then return end
    if getVehicleController(veh) ~= source then return end
    if not getElementData(veh,"vehicle:lic") then return end
    destroyElement(veh)
end)

addEventHandler("onVehicleDamage", resourceRoot, function(loss)
    if getElementHealth(source) < 955 then
    local kierowca=getVehicleController(source)
    local lot = getElementModel(source)
    if not kierowca then return end
    if not getElementData(source,"vehicle:lic") then return end
    destroyElement(source)
    --outputChatBox("* Uszkodzi?e?(a?) pojazd, nie zdajesz egzaminu!", kierowca, 255, 0, 0)
    triggerClientEvent(kierowca, 'onClientAddNotification', kierowca, 'Uszkodzi?e?/a? pojazd egzaminacyjny,\nnie zdajesz egzaminu.', 'error')
    triggerClientEvent(kierowca, "license:finish", resourceRoot, true)
    fadeCamera(kierowca,false,1)
    setTimer(fadeCamera,1000,1,kierowca,true,1)
    if lot == 469 then
    setTimer(setElementPosition,1001,1,kierowca,-2240.70, 2350.85, 4.98)
    else
    setTimer(setElementPosition,1001,1,kierowca,1074.33, -1838.75, 13.57)
    end
end)

addEventHandler("onVehicleStartExit", resourceRoot, function()
    cancelEvent()
end)

--[[addCommandHandler("lotgp", function(plr,cmd)
    local x,y,z=getElementPosition(plr)
    local p=string.format("{%.02f, %.02f, %.02f},", x,y,z)
    outputChatBox(p, plr)
end)

addCommandHandler("lotgp2", function(plr,cmd)
    local veh=getPedOccupiedVehicle(plr)
    if not veh then return end
    local x,y,z=getElementPosition(veh)
    local rx,ry,rz=getElementRotation(veh)
    local p=string.format("%.02f, %.02f, %.02f, %.02f, %.02f, %.02f", x,y,z,rx,ry,rz)
    outputChatBox(p, plr)
end)--]]


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-28, 16:21


DevJumpDj

VILLAGE MTA






Wiek: 27
Na forum: 3616 dni
Posty: 109
Nick w MP: D4NTE

Piwa: 3331

Respekt: 121
Respekt: 121

Podmien plik s_zdawanie.lua

kod:

--[[
    Resource: OURGame v2
    Developers: Split <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c) 2015 <split.programista@gmail.com>. All rights reserved.
]]

--[[local marker2=createMarker(-2050.29,-106.16,35.24,"corona",2,170,200,0)

addEventHandler("onMarkerHit", marker2, function(el,md)
 setElementPosition(el,-2044.69,-94.57,35.17 )
end)--]]

--local zone = createColCuboid(-157.62562561035, 1108.4052734375, 18.613729476929, 7, 9.8, 6.4)
createBlip(-2237.23, 2353.97, 4.98, 5,2,0,0,0,0,0,275) 

addEvent("license:do",true)
addEventHandler("license:do", resourceRoot, function(cost,selected)
    if tonumber(cost) <= getPlayerMoney(client) then
        takePlayerMoney(client,cost)
    end

    local veh=nil
    --if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("* Miejsce respu zaj?te, poczekaj a? kto? wyjedzie.",client) return end
    if selected == "A" then veh=createVehicle(586,-2045.84,-122.92,34.97,359.8,0.3,358.6)
    elseif selected == "B" then veh=createVehicle(496, -2045.84,-122.92,34.97,359.8,0.3,358.6)
    elseif selected == "C" then veh=createVehicle(482, -2045.84,-122.92,34.97,359.8,0.3,358.6)
    elseif selected == "L" then veh=createVehicle(593, 324.69, 2543.67, 17.28, 359.4, 360.0, 179.0) end
    if not veh then return end
    if selected == "L" then
    setElementData(veh,"vehicle:desc","Egzamin z Licencji Lotniczej\nKategoria: "..selected.."")
    else
    setElementData(veh,"vehicle:desc","Egzamin z Prawa Jazdy\nKategoria: "..selected.."")
    end
    setElementData(veh,"vehicle:mileage",0)
    setElementData(veh,"vehicle:fuel",100)
    setElementData(veh,"vehicle:lic",true)
    setElementData(veh,"lotnicza",false)

    setElementDimension(client,0)
    setElementInterior(client,0)
    showPlayerHudComponent(client, "radar", true)
    warpPedIntoVehicle(client,veh)
    setVehicleColor(veh, 255, 80, 0, 255, 255, 255)
    triggerClientEvent(client, "license:start", resourceRoot, selected, veh)
    --outputChatBox("* "..getPlayerName(client).." rozpocz??(??a) egzamin prawa jazdy, kategoria: "..selected.."", root, 255, 0, 0)
end)

addEvent("license:vehdel", true)
addEventHandler("license:vehdel", resourceRoot, function(veh)
    destroyElement(veh)
end)

addEventHandler("onPlayerQuit", root, function()
    local veh=getPedOccupiedVehicle(source)
    if not veh then return end
    if getVehicleController(veh) ~= source then return end
    if not getElementData(veh,"vehicle:lic") then return end
    destroyElement(veh)
end)

addEventHandler("onVehicleDamage", resourceRoot, function(loss)
    if getElementHealth(source) < 955 then
    local kierowca=getVehicleController(source)
    local lot = getElementModel(source)
    if not kierowca then return end
    if not getElementData(source,"vehicle:lic") then return end
    destroyElement(source)
    triggerClientEvent(kierowca, 'onClientAddNotification', kierowca, 'Uszkodzi?e?/a? pojazd egzaminacyjny,\nnie zdajesz egzaminu.', 'error')
    triggerClientEvent(kierowca, "license:finish", resourceRoot, true)
    fadeCamera(kierowca,false,1)
    setTimer(fadeCamera,1000,1,kierowca,true,1)
    if lot == 469 then
    setTimer(setElementPosition,1001,1,kierowca,-2240.70, 2350.85, 4.98)
    else
    setTimer(setElementPosition,1001,1,kierowca,1074.33, -1838.75, 13.57)
    end
end)

addEventHandler("onVehicleStartExit", resourceRoot, function()
    cancelEvent()
end)


jeden nawias byl zle

Podpis


VILLAGE MTA - www.villagemta.pl
D4NTE Właściciel serwera
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-28, 16:56


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Okey, lecz dalej jest b??d jak klikam gdy chce podj?? si? zdania egzaminu
ERROR: Client (FajnyNick) triggered serverside event license:do, but event is not added serverside


Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-29, 15:56


DevJumpDj

VILLAGE MTA






Wiek: 27
Na forum: 3616 dni
Posty: 109
Nick w MP: D4NTE

Piwa: 3331

Respekt: 121
Respekt: 121

Pyrek24, ten b??d informuje, ?e taki event nie jest dodany w pliku s_zdawanie.lua

Podpis


VILLAGE MTA - www.villagemta.pl
D4NTE Właściciel serwera
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-29, 18:09


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Mordko jest to ta linijka, m?g?by? mi j? doda? do eventu?
kod
if getElementHealth(source) < 800 then


Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-29, 19:06


Wilq







Wiek: 24
Na forum: 4570 dni
Posty: 3409

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Nie ma sprawy
"Pyrek24" napisał/a:

mordko
, tutaj kod:
addEventHandler("onVehicleDamage", resourceRoot, function(loss)
    if getElementHealth(source) < 955 then
    local kierowca=getVehicleController(source)
    local lot = getElementModel(source)
    if not kierowca then return end
    if not getElementData(source,"vehicle:lic") then return end
    destroyElement(source)
    triggerClientEvent(kierowca, 'onClientAddNotification', kierowca, 'Uszkodzi?e?/a? pojazd egzaminacyjny,\nnie zdajesz egzaminu.', 'error')
    triggerClientEvent(kierowca, "license:finish", resourceRoot, true)
    fadeCamera(kierowca,false,1)
    setTimer(fadeCamera,1000,1,kierowca,true,1)
    if lot == 469 then
    setTimer(setElementPosition,1001,1,kierowca,-2240.70, 2350.85, 4.98)
    else
    setTimer(setElementPosition,1001,1,kierowca,1074.33, -1838.75, 13.57)
    end
    end
end)


Podmie? sobie event.

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Pyrek24
Wysłany: 2019-01-30, 16:16


Pyrek24







Wiek: 26
Na forum: 3579 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Dziekuje juz daje repsekt i piwko

Podpis
amta
Postaw piwo autorowi tego posta
 

 
Tagi: serverside :: zdawanie :: prawka
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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