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

Wysłany: 2023-06-09, 20:25


Waruś







Wiek: 26
Na forum: 1422 dni
Posty: 2
Nick w MP: WariYT

Piwa: 2

Respekt: 50

Witam, mam skrypt na salon samochodowy, ale potrzebuje funkcji kupywania samochodu, bo nie umiem jej zrobi?. Poni?ej wklejam ca?y kod.

local salon = {
    font dxCreateFont("font.ttf",25,false,"antialiased")
}


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



local sultanMarker createMarker(-1946.076270.72835.474-1"cylinder"1.749145205255)

function renderSultanUI()
    dxDrawRectangle(658210599657tocolor(100170), false)

    if isMouseInPosition(66978321574then
        dxDrawRectangle(66978321574tocolor(255120100255), false)
    end

    if isMouseInPosition(10317841247857then
        dxDrawRectangle(103278421574tocolor(2623831255), false)
    end

    dxDrawText("Pojazd: Sultan"7062201213310tocolor(255255255255), 1.00salon.font"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Informacje o poje?dzie :"6583151257407tocolor(255255255255), 1.00salon.font"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Slinik : 1.6dm3"6784281243500tocolor(255255255255), 1.00salon.font"left""top"falsefalsefalsefalsefalse)
    dxDrawText("Przebieg : 0.00km"6784791243551tocolor(255255255255), 1.00salon.font"left""top"falsefalsefalsefalsefalse)
    dxDrawText("Pojemno?? baku : 100l"6785291243601tocolor(255255255255), 1.00salon.font"left""top"falsefalsefalsefalsefalse)
    dxDrawText("Cena : 200 000$"6726521237724tocolor(255255255255), 1.00salon.font"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Kup Pojazd"10317841247857tocolor(255255255255), 1.00salon.font"center""center"falsefalsefalsefalsefalse)
    dxDrawText("Anuluj"668784884857tocolor(255255255255), 1.00salon.font"center""center"falsefalsefalsefalsefalse)
end

function clickSultanUI(key,state)
    if key ~= "left" and state ~= "down" then return end

    if isMouseInPosition(668784884857then
        toggleSultanUI(false)
    end
end

function toggleSultanUI(b)
    local eventCallback and addEventHandler or removeEventHandler

    eventCallback("onClientRender"rootrenderSultanUI)
    eventCallback("onClientClick"rootclickSultanUI)
    showCursor(b)
end

addEventHandler("onClientMarkerHit"sultanMarker, function(elmd)
    if (
        not md or
        getElementType(el) ~= "player" or
        el ~= localPlayer
    then return end
    
    toggleSultanUI(true)
end)


Ostatnio zmieniony przez N0TH1NG 2023-06-09, 21:17, w całości zmieniany 2 razy  
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
borsuk
Tagi: dodanie :: funkcji :: skryptu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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