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

Wysłany: 2015-08-10, 13:46


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4330 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witajcie u?ydkownicy forum jak zrobi? CUBOID ?

mam taki sobie skrypt

Server





local strefyLakiernicze = {
    LakierniaDoherty = {
        cuboid = {1093.47,1767.82,10.48,359.8,0.0,268.7},-- cuboid w ktorym musi znalezc sie pojazd
        marker = {1085.90,1764.81,10.82}, -- pozycja markera w ktorym gracz bedzie stal aby w??czylakierni?
        dostep_frakcja 1, -- id frakcji ktora ma do tego dostep
  },
}

for i,v in pairs(strefyLakiernicze) do
    setGarageOpen(21true)
    l_cuboid createColCuboid(unpack(v.cuboid))
    l_wybor createMarker(v.marker[1], v.marker[2], v.marker[3], "cylinder"1000100)
    setElementData(l_wybor"dostep_frakcja"v.dostep_frakcja)
    setElementData(l_wybor"lakiernia_cs"l_cuboid)
end

addEventHandler("onMarkerHit"root, function(elmd)
    if getElementData(source"lakiernia_cs"then
        local accName getAccountName (getPlayerAccount(el))
        if isObjectInACLGroup("user."..accNameaclGetGroup("Mechanik")) then
            if getElementType(el) == "player" then
                local pojazd getElementsWithinColShape(l_cuboid"vehicle")
                if #pojazd<1 then
                    outputChatBox("Na stanowisku lakierniczym nie ma ?adnego pojazdu!"el)
                    return
                end
                if #pojazd>1 then
                    outputChatBox("Na stanowisku lakierniczym jest zbyt du?o pojazd?w!"el)
                    return
                end
                for _,v in ipairs(getElementsByType("vehicle")) do
                    if isElementWithinColShape(vl_cuboidthen
                        if getVehicleOccupant(vthen
                            triggerClientEvent(el"onWyborLakieru"root)
                        else
                            outputChatBox("Nikogo nie ma w poje?dzie wi?c lakierowanie jest niedost?pne!"el)
                        end
                    end
                end
            end
        else
            outputChatBox("Nie jeste? zatrudniony jako Mechanik Doherty San Fierro, mo?esz z?o?y? podanie na forum!"el25500)
        end
    end
end)

addEvent("onLakierujPojazd"true)
addEventHandler("onLakierujPojazd"root, function(kolor)
    if kolor == 0 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                playSoundFrontEnd(v46)
                setTimer(setVehicleColor30001v25500)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 1 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v2552550)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 2 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v039194)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 3 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v000)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 4 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v255255255)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 5 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v128128128)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 6 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v150750)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 7 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v2251650)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 8 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v65105225)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 9 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v255204221)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
    if kolor == 10 then
        for _,v in ipairs(getElementsByType("vehicle")) do
            if isElementWithinColShape(vl_cuboidthen
                setGarageOpen(21false)
                setTimer(setVehicleColor30001v02550)
                setTimer(setGarageOpen4000121true)
            end
        end
    end
end)


Client





--local sw,sh guiGetScreenSize()

function Skaluj(swshsw2sh2) 
    local sWidth,sHeight guiGetScreenSize()
    local scaleXscaleY=(sWidth/1280), (sHeight/720)
    return (sw*scaleX), (sh*scaleY), (sw2*scaleX), (sh2*scaleY)
end

x,y,w,Skaluj(359.8,0.0,268.7)
x1,y1,w1,h1 Skaluj(151794217)
x2,y2,w2,h2 Skaluj(1434943318)
x3,y3,w3,h3 Skaluj(1435620342)
x4,y4,w4,h4 Skaluj(75435620342)
x5,y5,w5,h5 Skaluj(38035720341)

function wybierzKolor()
    wl_okno guiCreateWindow(x,y,w,h"WYB?R LAKIERU"false)
    guiWindowSetSizable(wl_oknofalse)
    guiSetVisible(wl_oknotrue)
    showCursor(true)
    
    wl_info guiCreateLabel(x1,y1,w1,h1""falsewl_okno)
    guiLabelSetHorizontalAlign(wl_info"center"false)
    guiLabelSetColor(wl_info25400)
    
    wl_gridlist guiCreateGridList(x2,y2,w2,h2falsewl_okno)
    guiGridListAddColumn(wl_gridlist"Nazwa koloru"0.3)
    guiGridListAddColumn(wl_gridlist"Cena"0.3)
    guiGridListAddColumn(wl_gridlist"Dla pojazd?w"0.3)
    
    for 110 do
        guiGridListAddRow(wl_gridlist)
    end
    
    guiGridListSetItemText(wl_gridlist01"Czerwony"falsefalse)
    guiGridListSetItemText(wl_gridlist0210falsefalse)
    guiGridListSetItemText(wl_gridlist03"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist11"Z??ty"falsefalse)
    guiGridListSetItemText(wl_gridlist1210falsefalse)
    guiGridListSetItemText(wl_gridlist13"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist21"Niebieski C"falsefalse)
    guiGridListSetItemText(wl_gridlist2210falsefalse)
    guiGridListSetItemText(wl_gridlist23"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist31"Czarny"falsefalse)
    guiGridListSetItemText(wl_gridlist3210falsefalse)
    guiGridListSetItemText(wl_gridlist33"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist41"Bialy"falsefalse)
    guiGridListSetItemText(wl_gridlist4210falsefalse)
    guiGridListSetItemText(wl_gridlist43"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist51"Szary"falsefalse)
    guiGridListSetItemText(wl_gridlist5210falsefalse)
    guiGridListSetItemText(wl_gridlist53"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist61"Br?zowy"falsefalse)
    guiGridListSetItemText(wl_gridlist6210falsefalse)
    guiGridListSetItemText(wl_gridlist63"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist71"Pomara?czowy"falsefalse)
    guiGridListSetItemText(wl_gridlist7210falsefalse)
    guiGridListSetItemText(wl_gridlist73"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist81"Niebieski J"falsefalse)
    guiGridListSetItemText(wl_gridlist8210falsefalse)
    guiGridListSetItemText(wl_gridlist83"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist91"R??owy"falsefalse)
    guiGridListSetItemText(wl_gridlist9210falsefalse)
    guiGridListSetItemText(wl_gridlist93"Wszystkich"falsefalse)
    
    guiGridListSetItemText(wl_gridlist101"Zielony"falsefalse)
    guiGridListSetItemText(wl_gridlist10210falsefalse)
    guiGridListSetItemText(wl_gridlist103"Wszystkich"falsefalse)
    
    wl_uruchom guiCreateButton(x3,y3,w3,h3"Uruchom lakierowanie"falsewl_okno)
    addEventHandler("onClientGUIClick"wl_uruchomonUruchomLakierowaniefalse)
    wl_zamknij guiCreateButton(x4,y4,w4,h4"Zamknij"falsewl_okno)
    addEventHandler("onClientGUIClick"wl_zamknijonZamknijOknofalse)
    wl_blad guiCreateButton(x5,y5,w5,h5"Zg?o? b??d(w przygotowaniu)"falsewl_okno)    
end

function onZamknijOkno()
    guiSetVisible(wl_oknofalse)
    showCursor(false)
end

addEvent("onWyborLakieru"true)
addEventHandler("onWyborLakieru"root, function()
    wybierzKolor()
end)

function onUruchomLakierowanie()
    local id guiGridListGetSelectedItem(wl_gridlist)
    local kolor guiGridListGetSelectedItem(wl_gridlist)
    local cena guiGridListGetItemText(wl_gridlistid2)
    if id == id then
        if tonumber(cena) <= getPlayerMoney(getLocalPlayer()) then
            takePlayerMoney(cena)
            triggerServerEvent("onLakierujPojazd"rootkolor)
        else
            guiSetText(wl_info"Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!")
        end
    end
end

addCommandHandler"devmode",
function ()
    setDevelopmentMode true )
end
)


Chodzi o to ?e jak kto? wjedzie w cuboid , i mechanik chce mu pokolorowac pojazd to pisze ze pojazdu nie ma ;(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 15:45


Fanciak

BOT






Wiek: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

?le stworzy?e? cuboid. X, Y, Z, Szeroko??, g??boko??, wysoko??.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-10, 17:28


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4049 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

Respekt: 460
Respekt: 460

Pobierz sobie to http://community.multithe...details&id=3804
Uruchom na serwie i wpisz /editcol I sie bawisz..

Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
MicHaLeQZ
Tagi: cuboid
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