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: 25
Na forum: 3438 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
ERRORClient (FajnyNicktriggered serverside event license:do, but event is not added serverside


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


kod
c_category

--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <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


--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

mojeW,mojeH 12801024
sW,sH guiGetScreenSize()
w= (sW/mojeW), (sH/mojeH)

local sxsy 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.0135.69-1"cylinder"1.2255800) -- Prawo Jazdy
setElementInterior(marker0)
setElementDimension(marker0)
setElementData(marker'typ''pojazd')

local marker2=createMarker(-2237.232353.974.98-1"cylinder"1.2255800) -- Licencja Lotnicza
setElementInterior(marker20)

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

local t2=createElement("text")
setElementInterior(t20)
setElementPosition(t2, -2237.232353.974.98)
setElementData(t2,"name","Zdawanie licencji lotniczej")


local wm={}
--[[wm.gridlist=guiCreateWindow(0.210.200.570.54"Zdawanie prawa jazdy"true)
guiWindowSetSizable(wm.gridlistfalse)
guiWindowSetMovable(wm.gridlistfalse)
guiSetVisible(wm.gridlistfalse)
wm.label=guiCreateLabel(0.020.060.960.05"Z poni?szej listy wybierz kategori? prawa jazdy do kt?rej chcesz przyst?pi? p??niej kliknij Przyst?p"truewm.gridlist)
guiLabelSetHorizontalAlign(wm.label"center"false)
guiLabelSetVerticalAlign(wm.label"center")--]]
wm.gridlist=guiCreateGridList(357*w393*h567*w218*hfalse)
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.gridlistfalse)
guiSetAlpha(wm.gridlist0.8)
guiSetFont(wm.gridlist"default-bold-small")
--wm.close=guiCreateButton(0.620.830.360.13"Zamknij"true)
--wm.submit=guiCreateButton(0.020.830.360.13"Przyst?p"true)

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

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

addEventHandler("onClientClick"root, function(btnstate)
    if btn == "left" and state == "down" then
    if prawko == true then
    if mysz(352*w624*h210*w78*hthen
    local selectedRow=guiGridListGetSelectedItem(wm.gridlist)
    if not selectedRow or selectedRow 0 then return end
    local cat=guiGridListGetItemText(wm.gridlistselectedRow1)
    local cost=guiGridListGetItemData(wm.gridlistselectedRow3)
    local zdane=guiGridListGetItemText(wm.gridlistselectedRow4)
    if tonumber(cost) > getPlayerMoney(localPlayerthen
        --outputChatBox("* Nie posiadasz tyle got?wki."25500)
        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..."25500)
        return
    end]]
    if zdane ~= "TAK" then
        triggerServerEvent("license:do"resourceRoottonumber(cost), cat)
        if not guiGetVisible(wm.gridlistthen return end
        guiSetVisible(wm.gridlistfalse)
        showCursor(false)
    prawko false
        removeEventHandler("onClientRender",root,gui3)
    else
        --outputChatBox("* Posiadasz ju? zdane prawo jazdy."25500)
        triggerEvent('onClientAddNotification'localPlayer'Posiadasz prawo jazdy zaznaczonej kategorii.''error')
    end
    end
    end
    end
end)

addEventHandler("onClientClick"root, function(btnstate)
    if btn == "left" and state == "down" then
    if prawko == true then
    if mysz(718*w624*h210*w78*hthen
    if not guiGetVisible(wm.gridlistthen return end
    showCursor(false)
    guiSetVisible(wm.gridlistfalse)
    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.gridlistthen 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.gridlistthen 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*w313*h650*w400*h"img/prawojazdy-psrpg.png"000tocolor(255255255255), false)
end


c_zdawanie
--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <split.programista@gmail.com>. All rights reserved.
]]

local licenseBlip
local licenseTarget
local licenseMarker
local licenseVehicle
local licenseCategory

local categoryPositions={
    ["A"]={
        {-2054.36, -116.0234.91},
        {-2079.98, -117.7034.92},
        {-2082.32, -132.4134.92},
        {-2084.65, -126.5034.93},
        {-2091.16, -124.5434.92},
        {-2082.88, -129.3934.93},
        {-2079.84, -142.0034.92},
        {-2075.87, -151.5734.92},
        {-2080.77, -160.0634.92},
        {-2088.67, -162.0834.92},
        {-2090.31, -171.4834.92},
        {-2090.01, -196.3334.92},
        {-2090.41, -211.1636.55},
        {-2090.37, -224.7334.92},
        {-2090.30, -246.3734.92},
        {-2084.69, -269.7534.92},
        {-2071.71, -266.5834.92},
        {-2069.27, -239.5634.92},
        {-2068.44, -220.6434.92},
        {-2069.66, -226.6534.92},
        {-2074.96, -227.4134.92},
        {-2062.34, -227.9234.92},
        {-2068.32, -229.6434.92},
        {-2069.30, -235.3834.92},
        {-2068.29, -220.3334.92},
        {-2066.57, -211.1034.92},
        {-2067.62, -204.3234.92},
        {-2069.54, -195.5134.92},
        {-2071.20, -186.0034.92},
        {-2069.94, -175.6934.92},
        {-2059.62, -161.0834.92},
        {-2047.80, -165.4934.92},
        {-2048.04, -176.0034.92},
        {-2047.18, -192.9534.93},
        {-2051.01, -188.4334.92},
        {-2053.94, -186.2934.93},
        {-2048.28, -195.3634.93},
        {-2046.29, -216.6434.92},
        {-2043.80, -223.6534.93},
        {-2041.48, -225.9834.93},
        {-2045.16, -231.5334.92},
        {-2046.65, -247.8834.92},
        {-2047.15, -261.7834.92},
        {-2039.23, -273.4534.92},
        {-2022.39, -268.5834.91},
        {-2021.46, -230.3034.92},
        {-2020.82, -194.2534.92},
        {-2020.63, -167.9034.92},
        {-2030.02, -144.3634.92},
        {-2036.88, -142.9934.92},
        {-2023.21, -141.7434.91},
        {-2016.46, -142.0134.92},
    },
    ["C"]={
                {-2054.36, -116.0234.91},
        {-2079.98, -117.7034.92},
        {-2082.32, -132.4134.92},
        {-2084.65, -126.5034.93},
        {-2091.16, -124.5434.92},
        {-2082.88, -129.3934.93},
        {-2079.84, -142.0034.92},
        {-2075.87, -151.5734.92},
        {-2080.77, -160.0634.92},
        {-2088.67, -162.0834.92},
        {-2090.31, -171.4834.92},
        {-2090.01, -196.3334.92},
        {-2090.41, -211.1636.55},
        {-2090.37, -224.7334.92},
        {-2090.30, -246.3734.92},
        {-2084.69, -269.7534.92},
        {-2071.71, -266.5834.92},
        {-2069.27, -239.5634.92},
        {-2068.44, -220.6434.92},
        {-2069.66, -226.6534.92},
        {-2074.96, -227.4134.92},
        {-2062.34, -227.9234.92},
        {-2068.32, -229.6434.92},
        {-2069.30, -235.3834.92},
        {-2068.29, -220.3334.92},
        {-2066.57, -211.1034.92},
        {-2067.62, -204.3234.92},
        {-2069.54, -195.5134.92},
        {-2071.20, -186.0034.92},
        {-2069.94, -175.6934.92},
        {-2059.62, -161.0834.92},
        {-2047.80, -165.4934.92},
        {-2048.04, -176.0034.92},
        {-2047.18, -192.9534.93},
        {-2051.01, -188.4334.92},
        {-2053.94, -186.2934.93},
        {-2048.28, -195.3634.93},
        {-2046.29, -216.6434.92},
        {-2043.80, -223.6534.93},
        {-2041.48, -225.9834.93},
        {-2045.16, -231.5334.92},
        {-2046.65, -247.8834.92},
        {-2047.15, -261.7834.92},
        {-2039.23, -273.4534.92},
        {-2022.39, -268.5834.91},
        {-2021.46, -230.3034.92},
        {-2020.82, -194.2534.92},
        {-2020.63, -167.9034.92},
        {-2030.02, -144.3634.92},
        {-2036.88, -142.9934.92},
        {-2023.21, -141.7434.91},
        {-2016.46, -142.0134.92},
    },
    ["B"]={
            {-2054.36, -116.0234.91},
        {-2079.98, -117.7034.92},
        {-2082.32, -132.4134.92},
        {-2084.65, -126.5034.93},
        {-2091.16, -124.5434.92},
        {-2082.88, -129.3934.93},
        {-2079.84, -142.0034.92},
        {-2075.87, -151.5734.92},
        {-2080.77, -160.0634.92},
        {-2088.67, -162.0834.92},
        {-2090.31, -171.4834.92},
        {-2090.01, -196.3334.92},
        {-2090.41, -211.1636.55},
        {-2090.37, -224.7334.92},
        {-2090.30, -246.3734.92},
        {-2084.69, -269.7534.92},
        {-2071.71, -266.5834.92},
        {-2069.27, -239.5634.92},
        {-2068.44, -220.6434.92},
        {-2069.66, -226.6534.92},
        {-2074.96, -227.4134.92},
        {-2062.34, -227.9234.92},
        {-2068.32, -229.6434.92},
        {-2069.30, -235.3834.92},
        {-2068.29, -220.3334.92},
        {-2066.57, -211.1034.92},
        {-2067.62, -204.3234.92},
        {-2069.54, -195.5134.92},
        {-2071.20, -186.0034.92},
        {-2069.94, -175.6934.92},
        {-2059.62, -161.0834.92},
        {-2047.80, -165.4934.92},
        {-2048.04, -176.0034.92},
        {-2047.18, -192.9534.93},
        {-2051.01, -188.4334.92},
        {-2053.94, -186.2934.93},
        {-2048.28, -195.3634.93},
        {-2046.29, -216.6434.92},
        {-2043.80, -223.6534.93},
        {-2041.48, -225.9834.93},
        {-2045.16, -231.5334.92},
        {-2046.65, -247.8834.92},
        {-2047.15, -261.7834.92},
        {-2039.23, -273.4534.92},
        {-2022.39, -268.5834.91},
        {-2021.46, -230.3034.92},
        {-2020.82, -194.2534.92},
        {-2020.63, -167.9034.92},
        {-2030.02, -144.3634.92},
        {-2036.88, -142.9934.92},
        {-2023.21, -141.7434.91},
        {-2016.46, -142.0134.92},
    },
    ["L"]={
        {-2227.072287.3426.95},
        {-2269.482247.5335.66},
        {-2339.912199.1335.66},
        {-2472.092112.4335.66},
        {-2549.212064.1835.66},
        {-2672.072004.8435.66},
        {-2748.911935.9635.66},
        {-2681.771846.7142.90},
        {-2444.561937.2745.25},
        {-2341.071992.4545.25},
        {-2206.642108.5345.25},
        {-2227.782326.718.60},
    },
    ["T"]={
        {-2003.43,438.75,35.02},
        {-2003.63380.5135.50},
        {-2003.63348.3535.50},
        {-2003.76303.0635.29},
        {-2005.54250.2230.41},
        {-2006.50194.4428.00},
        {-2006.50128.6228.00},
        {-2006.5452.0331.28},
        {-2062.9930.3835.62},
        {-2136.5230.3935.62},
        {-2166.63, -15.6735.62},
        {-2188.21, -70.0035.62},
        {-2254.33, -61.1635.62},
        {-2254.5711.8535.62},
        {-2252.3888.1735.62},
        {-2251.50164.3635.62},
        {-2251.39242.8835.62},
        {-2251.43322.0635.62},
        {-2290.05400.8035.47},
        {-2357.34477.0631.12},
        {-2287.46508.6135.50},
        {-2264.88614.1144.05},
        {-2264.94748.6149.81},
        {-2264.88892.2166.91},
        {-2264.811013.7684.66},
        {-2264.471072.9781.14},
        {-2263.621095.9580.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"resourceRootfinishLicense)

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

            --outputChatBox("* Zda?e?(a?) egzamin. Gratulacje!")
            triggerEvent('onClientAddNotification'localPlayer'Pomy?lnie zda?e? egzamin z prawa jazdy.\nGratulacje!''success')
            triggerServerEvent("license:vehdel"resourceRootlicenseVehicle)
            setElementData(localPlayer,"player:license:pj"..licenseCategory1)
            finishLicense(true)
            fadeCamera(kierowca,false,1)
            setTimer(fadeCamera,1000,1,kierowca,true,1)
            setTimer(setElementPosition,1001,1,kierowca,1074.33, -1838.7513.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(nalicz30000)
end)--]]


s_zdawanie
--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <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.625625610351108.405273437518.61372947692979.86.4)
createBlip(-2237.232353.974.985,2,0,0,0,0,0,275addEvent("license:do",true)
addEventHandler("license:do"resourceRoot, function(cost,selected)
    if tonumber(cost) <= getPlayerMoney(clientthen
        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(593324.692543.6717.28359.4360.0179.0end
    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(veh255800255255255)
    triggerClientEvent(client"license:start"resourceRootselectedveh)
    --outputChatBox("* "..getPlayerName(client).." rozpocz??(??a) egzamin prawa jazdy, kategoria: "..selected..""root25500)
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!"kierowca25500)
    triggerClientEvent(kierowca'onClientAddNotification'kierowca'Uszkodzi?e?/a? pojazd egzaminacyjny,\nnie zdajesz egzaminu.''error')
    triggerClientEvent(kierowca"license:finish"resourceRoottrue)
    fadeCamera(kierowca,false,1)
    setTimer(fadeCamera,1000,1,kierowca,true,1)
    if lot == 469 then
    setTimer(setElementPosition,1001,1,kierowca,-2240.702350.854.98)
    else
    setTimer(setElementPosition,1001,1,kierowca,1074.33, -1838.7513.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(pplr)
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(pplr)
end)--]]


Postaw piwo autorowi tego posta
 

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


DevJumpDj

VILLAGE MTA






Wiek: 27
Na forum: 3474 dni
Posty: 102
Nick w MP: D4NTE

Piwa: 3277

Respekt: 121
Respekt: 121

Podmien plik s_zdawanie.lua

kod:

--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c2015 <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.625625610351108.405273437518.61372947692979.86.4)
createBlip(-2237.232353.974.985,2,0,0,0,0,0,275addEvent("license:do",true)
addEventHandler("license:do"resourceRoot, function(cost,selected)
    if tonumber(cost) <= getPlayerMoney(clientthen
        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(593324.692543.6717.28359.4360.0179.0end
    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(veh255800255255255)
    triggerClientEvent(client"license:start"resourceRootselectedveh)
    --outputChatBox("* "..getPlayerName(client).." rozpocz??(??a) egzamin prawa jazdy, kategoria: "..selected..""root25500)
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"resourceRoottrue)
    fadeCamera(kierowca,false,1)
    setTimer(fadeCamera,1000,1,kierowca,true,1)
    if lot == 469 then
    setTimer(setElementPosition,1001,1,kierowca,-2240.702350.854.98)
    else
    setTimer(setElementPosition,1001,1,kierowca,1074.33, -1838.7513.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: 25
Na forum: 3438 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
ERRORClient (FajnyNicktriggered 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: 3474 dni
Posty: 102
Nick w MP: D4NTE

Piwa: 3277

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: 25
Na forum: 3438 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: 4428 dni
Posty: 3410

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"resourceRoottrue)
    fadeCamera(kierowca,false,1)
    setTimer(fadeCamera,1000,1,kierowca,true,1)
    if lot == 469 then
    setTimer(setElementPosition,1001,1,kierowca,-2240.702350.854.98)
    else
    setTimer(setElementPosition,1001,1,kierowca,1074.33, -1838.7513.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: 25
Na forum: 3438 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 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