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

Wysłany: 2020-11-24, 17:12


AsaXx







Wiek: 20
Na forum: 2413 dni
Posty: 74
Nick w MP: AsaXx

Piwa: 413

Respekt: 50

Siema! Napotka?em ostatnio taki problem(?). Mianowicie - stworzy?em sobie gui bankomatu, i wszystko fajniutko pi?kniutko, ale gui si? odpala w ka?dym markerze, niezale?nie w jakim skrypcie jest. :| Jakie? pomys?y, bo moje si? sko?cz?y? :)

local bankomaty={
    --x,y,zrxryrzINTDIM,
    
    --[[BANKOMATY LOS SANTOS
    {2194.30, -1971.7013.78-0.35, -0.000.00177.89}, -- Praca Smieciarki.
    {2110.01, -2100.3313.55-0.35, -0.000.00359.49}, -- Salon obok ?mieciarek.
    {872.86, -1203.8716.98-0.35, -0.000.000.30}, -- Salon w Vinewood obok LSPD na PRL.
    {2133.30, -1151.3224.08-0.35, -0.000.00179.41}, -- Salon Motorniczy obok Gangu Blood na PRL. (( Jak jeszcze istnieje. ))
    {661.36, -576.1316.34-0.35, -0.000.00269.16}, -- Stacja Benzynowa Dillimore Red County.
    --BANKOMATY LOS SANTOS--]]
    
    --BANKOMATY SAN FIERRO
    {-1914.99872.8835.41-0.35, -0.000.00270.16}, -- Spawn.
    {-1915.00893.8835.41-0.35, -0.000.00268.96}, -- Spawn.
    {-1859.65, -145.7611.91-0.35, -0.000.00180.49}, -- Praca Sweepery.
    {-2032.97162.6529.04-0.35, -0.000.0090.50}, -- Mechanik Doherty.
    {-1964.86291.7235.47-0.35, -0.000.0089.13}, -- Salon Doherty.
    {-1712.48399.237.42-0.35, -0.000.00223.78}, -- Praca Cysterny.
    {-1648.901202.507.25-0.35, -0.000.00180.47}, -- Salon Downtown.
    {-1603.62710.2713.87-0.35, -0.000.00178.86}, -- Komenda G??wna Policji.
    {-1971.48620.4735.17-0.35, -0.000.000.40}, -- Przechowalnia Pojazd?w.
    {-2102.420.5235.32-0.35, -0.000.00179.26}, -- Pa?stwowa StraPo?arna.
    {-2271.49, -132.4535.32-0.35, -0.000.00359.55}, -- Tuner Garcia.
    {-2420.15983.4445.30-0.35, -0.000.0090.56}, -- Stacja Juniper Hollow.
    {-1874.00, -219.9818.38-0.35, -0.000.0088.42}, -- Parking Policyjny Doherty.
    {-2637.05632.1514.45-0.35, -0.000.00269.96}, -- Pogotowie Ratunkowe
    --BANKOMATY SAN FIERRO
    
    --BANKOMATY FORT CARSON
    {-134.661087.2319.74-0.35, -0.000.00269.76},
    {-205.191135.1419.74-0.35, -0.000.0089.84},
    {180.66655.193.85-0.35, -0.000.0012.65},
    {302.231139.318.59-0.35, -0.000.0089.60},
    --{},
    --{},
    --{},
    --{},
    --{},
    --{},
    --{},
    --{},
    --{},
    --BANKOMATY FORT CARSON
    
    }
    
    for i,v in ipairs(bankomaty) do
    
        v.obiekt=createObject(2942,v[1],v[2],v[3],v[4],v[5],v[6])
        setElementInterior(v.obiekt,v[7] or 0)
        setElementDimension(v.obiekt,v[8] or 0)
        setElementFrozen(v.obiekt,true)
        setObjectBreakable v.obiektfalse )
        
    --    v.mapicon=createBlip(v[1],v[2],v[3], 522255,255,255,0, -1000300)
        v.mapicon=createBlip(v[1],v[2],v[3], 5215,255,5,255, -1000275)
        v.markers=createMarker v[1], v[2], v[3]-0.9"checkpoint"1.52552550170 )
        --local x,y,getElementPosition(v.obiekt)
        --exports.customblips:createCustomBlipxy2020"52.png" )
        setElementInterior(v.obiekt,v[7] or 0)
        setElementDimension(v.obiekt,v[8] or 0)
        
        v.cs=createColSphere(v[1],v[2],v[3]+11)
        setElementInterior(v.cs,v[7] or 0)
        setElementDimension(v.cs,v[8] or 0)
        v.text=createElement('text')
        setElementData(v.text,"name","Bankomat")
        setElementPosition(v.text,v[1],v[2],v[3])
    end

--setElementData(markers"typ""bank")

screenWscreenH guiGetScreenSize()
sx,syguiGetScreenSize()
px,py=(sx/1280), (sy/768)

local sw,sh guiGetScreenSize()
local scale 1280 sw

function isMouseInPosition xywidthheight )
    if ( not isCursorShowing( ) ) then
        return false
    end
    local sxsy guiGetScreenSize ( )
    local cxcy getCursorPosition ( )
    local cxcy = ( cx sx ), ( cy sy )
    
    return ( ( cx >= and cx <= width ) and ( cy >= and cy <= height ) )
end

panel false
page info
blur false

local font3 dxCreateFont("Roboto-Regular.ttf"9)
local font4 dxCreateFont("Roboto-Regular.ttf"10)
local font5 dxCreateFont("Roboto-Regular.ttf"12)

function przecinek(liczba)  
    local format liczba  
    while true do      
        formatstring.gsub(format"^(-?%d+)(%d%d%d)"'%1,%2')    
        if ( k==then      
            break  
        end  
    end  
    return format
  end

function gui()
    dxDrawRectangle(475/scale200/scale325/scale375/scaletocolor(161616245))
    if isMouseInPosition(573/scale479/scale125/scale17/scalethen
        dxDrawRectangle(573/scale479/scale125/scale17/scaletocolor(101010245))
    elseif isMouseInPosition(573/scale516/scale125/scale17/scalethen
        dxDrawRectangle(573/scale516/scale125/scale17/scaletocolor(101010245))
    end
    dxDrawText("Bankomat"945/scale50/scale325/scale425/scaletocolor(188200204), 1font5"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Tw?j stan konta: 0"945/scale175/scale325/scale425/scaletocolor(188200204), 1font4"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Wybierz kwot? jak? chcesz wyp?aci?"945/scale275/scale325/scale425/scaletocolor(188200204), 1font4"center""center"falsefalsefalsefalsefalse)
    dxDrawText("10,000"770/scale350/scale325/scale425/scaletocolor(188200204), 1font3"center""center"falsefalsefalsefalsefalse)
    dxDrawText("100,000"945/scale350/scale325/scale425/scaletocolor(188200204), 1font3"center""center"falsefalsefalsefalsefalse)
    dxDrawText("1,000,000"1125/scale350/scale325/scale425/scaletocolor(188200204), 1font3"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Wyp?a?"945/scale550/scale325/scale425/scaletocolor(188200204), 1font4"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Zamknij"945/scale625/scale325/scale425/scaletocolor(188200204), 1font4"center""center"falsefalsefalsefalsefalse)
end

--local marker createMarker ( -1908.06895.5335.17"cylinder"1.52552550170 )

function on(plr)
    if panel == false then 
        if plr == localPlayer then
            panel true
            addEventHandler("onClientRender",root,gui)
            editBox guiCreateEdit0.41/scale0.53/scale0.18/scale0.025/scale"W?asna kwota"true )
            --guiSetVisible(editBox,true)
            showCursor(true)
            showChat(false)
        end
    end
end
addEventHandler("onClientMarkerHit"rootonmarkers)

function off()
    if panel == true then
        if isMouseInPosition(573/scale516/scale125/scale17/scalethen
            panel false
            guiSetVisible(editBox,false)
            removeEventHandler("onClientRender",root,gui)
            showCursor(false)
            showChat(true)
        end
    end 
end
addEventHandler("onClientClick"rootoff)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-11-24, 17:25


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Podczas tworzenia eventu "onClientMarkerHit" jako element (source) w drugim argumencie addEventHandler wstaw "resourceRoot".


Więcej informacji znajdziesz w Wikipedii MTA:

Predefined variables list


Postaw piwo autorowi tego posta
 

 
Tagi: markery :: gui
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