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

Wysłany: 2020-04-25, 03:31


HEATEX







Wiek: 25
Na forum: 2250 dni
Posty: 109
Nick w MP: HEATEX

Piwa: 1336

Respekt: 50

Ostrzeżeń: 20%
Witam szukalem ostatnio jak zrobic auto do prawka w sensie L na daszku oraz zeby kazdy mogl przenikac przez to auto lecz nie moge tego znalezc przesylam skrypt na prawko
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"30000},
    {"B""Samochody osobowe"0},
    {"C""Pojazdy dostawcze"50000},
    --{"L""Samoloty osobowe(w trakcie prac)"0},
}

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

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 licenseBlip
local licenseTarget
local licenseMarker
local licenseVehicle
local licenseCategory

local categoryPositions={
    ["A"]={
        {2115.80, -1762.9013.40},
        {2135.09, -1752.2613.40},
        {2175.67, -1752.1713.38},
        {2184.91, -1740.5313.38},
        {2207.03, -1732.1913.41},
        {2215.90, -1768.8113.36},
        {2218.52, -1855.5713.36},
        {2218.59, -1894.0813.36},
        {2185.17, -1894.3913.47},
        {2092.06, -1894.4713.47},
        {2082.00, -1908.5013.47},
        {2056.64, -1932.5513.47},
        {1991.55, -1932.4613.47},
        {1929.69, -1932.3313.47},
        {1857.41, -1932.4713.47},
        {1821.68, -1916.3613.47},
        {1804.67, -1895.9213.47},
        {1804.05, -1930.6913.47},
    },
    ["C"]={
        {2072.98, -1915.3613.55},
        {2080.45, -1908.6013.36},
        {2078.39, -1819.7913.36},
        {2092.70, -1752.0213.36},
        {2112.70, -1677.5813.36},
        {2112.76, -1608.7024.23},
        {2112.74, -1527.8423.85},
        {2112.71, -1479.0423.85},
        {2083.44, -1463.2923.85},
        {2019.42, -1463.4513.60},
        {1938.50, -1463.5213.60},
        {1863.57, -1463.2513.60},
        {1849.31, -1481.4513.60},
        {1832.49, -1544.3613.60},
        {1821.70, -1661.6413.60},
        {1821.78, -1815.0213.60},
        {1821.83, -1864.7013.60},
        {1816.34, -1884.9313.60},
        {1789.48, -1908.2613.60},
        {1775.47, -1919.5013.39},
    },
    ["B"]={
        {1800.55, -1854.9913.41},
        {1820.21, -1833.0713.41},
        {1793.59, -1830.7713.41},
        {1701.16, -1811.6613.41},
        {1689.84, -1774.2613.41},
        {1689.66, -1736.1813.41},
        {1688.81, -1618.4713.38},
        {1690.25, -1593.7213.38},
        {1734.13, -1597.2413.38},
        {1776.04, -1607.5713.38},
        {1813.59, -1612.9213.38},
        {1821.72, -1652.3713.38},
        {1821.94, -1760.6513.38},
        {1820.98, -1808.6413.38},
        {1820.73, -1853.7113.38},
        {1818.94, -1889.8213.39},
        {1803.95, -1891.3113.39},
        {1777.80, -1891.2313.39},
         
    },
    ["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,1749.11, -1860.7313.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)--]]

c_license
[lua]
--[[
Resource: OURGame v2
Developers: Split <[email protected]>
You have no right to use this code without my permission.
(c) 2015 <[email protected]>. 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(-2033.08, -117.49, 1035.17-1, "cylinder", 1.2, 0, 122, 255, 55) -- Prawo Jazdy
setElementInterior(marker, 3)
setElementDimension(marker, 1)
setElementData(marker, 'typ', 'pojazd')

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

local t=createElement("text")
setElementInterior(t, 3)
setElementDimension(t, 1)
setElementPosition(t,-2033.08, -117.49, 1035.17)
setElementData(t,"name","Zdawanie 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
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(4632116.76, -1783.5313.050.00.04.2)
    elseif selected == "B" then veh=createVehicle(4581725.82, -1854.9313.29360.0360.0269.3)
    elseif selected == "C" then veh=createVehicle(4142052.25, -1913.6713.23360.00.0270.8)
    elseif selected == "L" then veh=createVehicle(469, -2227.612325.417.600.2359.8180.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(veh0122255255255255)
    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)
    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,1749.11, -1860.7313.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
 

 
Tagi: auto :: 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 » Auto od prawka Odpowiedz do tematu

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku