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

Wysłany: 2019-02-19, 22:43


smigi







Wiek: 23
Na forum: 3367 dni
Posty: 60
Nick w MP: smigi

Piwa: 2

Respekt: 50

witam chcia?bym tutaj dodac rosline je?li zaczynasz prace pokazuje marker a ja chce zeby pokazywa?o rosline pomoze ktos wstawiam piwko

local startPracy =  createMarker(1146.74, -2141.3468.76-0.9"cylinder"1.5)
createBlipAttachedTo(startPracy46)

local punktyOgrodnik = {
    {1134.43, -2139.9970.32-0.9},
    {1147.27, -2091.8770.59-0.9},
    {1143.32, -2081.5769.12-0.9},
    {1127.85, -2061.8069.01-0.9},
    {1042.80, -2185.9340.34-0.9},
    {1036.30, -2191.9639.51-0.9},
    {1085.50, -2233.6047.50-0.9},
}

x,guiGetScreenSize()
pxpy = (x/1024), (y/768)

local mousePoints = {
{246*px387*py15*px15*px},
{276*px370*py15*px15*px},
{302*px377*py15*px15*px},
{342*px377*py15*px15*px},
{372*px360*py15*px15*px},
{402*px387*py15*px15*px},
{432*px387*py15*px15*px},
{442*px365*py15*px15*px},
{478*px365*py15*px15*px},
{498*px383*py15*px15*px},
{549*px366*py15*px15*px},
{569*px373*py15*px15*px},
{589*px383*py15*px15*px},
{595*px356*py15*px15*px},
{629*px373*py15*px15*px},
{649*px373*py15*px15*px},
{679*px390*py15*px15*px},
{699*px373*py15*px15*px},
{729*px363*py15*px15*px},
{759*px373*py15*px15*px},
{779*px373*py15*px15*px},
}
target=0
addEventHandler("onClientMarkerHit"startPracy, function(h)
    if ~= localPlayer then return end
    if isPedInVehicle(localPlayerthen return end
    setElementData(localPlayer"praca:ogrodnik:gui"true)
    showCursor(true)
end)

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

setElementData(localPlayer"ogrodnik:zakonczono"false)

function tworzenieMarkera()
    rnd math.random(1#punktyOgrodnik)
    markerRandomowy createMarker(punktyOgrodnik[rnd][1], punktyOgrodnik[rnd][2], punktyOgrodnik[rnd][3], 'cylinder'1.5)
    blipRandomowy createBlipAttachedTo(markerRandomowy41)
end

        function onRandom(h)
        if ~= localPlayer then return end
        if isPedInVehicle(localPlayerthen return end
            target target+1
            setElementData(localPlayer"ogrodnik:zakonczono"false)
            addEventHandler("onClientRender"root, function()
                if getElementData(localPlayer"ogrodnik:zakonczono"then return end
                dxDrawImage(241*px63*py570*px357*py,"trawa.png")
                dxDrawImage(mousePoints[target][1], mousePoints[target][2], mousePoints[target][3], mousePoints[target][4],"kolo.png")
            end)
            showCursor(true)
            destroyElement(source)
            destroyElement(blipRandomowy)
        end

function gui()
    if not getElementData(localPlayer"praca:ogrodnik:gui") == true then return end
    dxDrawImage(312*px184*py400*px400*py"test.png")
end
addEventHandler("onClientRender"rootgui)

bindKey("mouse1""down", function()
    if not getElementData(localPlayer"praca:ogrodnik:gui") == true then return end
    if isMouseIn(538*px527*py161*px39*pythen
        setElementData(localPlayer"praca:ogrodnik:gui"false)
        showCursor(false)
    end
    if isMouseIn(324*px527*py161*px39*pythen
    if isPedInVehicle(localPlayerthen return end
    if getElementData(localPlayer"praca"then triggerEvent("onClientAddNotification"localPlayer"Posiadasz aktywn? prac?""error") return end
        triggerEvent("onClientAddNotification"localPlayer"Rozpoczynasz prac? ogrodnika""success")
        outputChatBox("Rozpoczynasz prac? ogrodnika. Aby zako?czy? wpisz /zakoncz.ogrodnik"100100250)
        setElementData(localPlayer"praca""ogrodnik")
        setElementData(localPlayer"praca:ogrodnik:gui"false)
        showCursor(false)
        tworzenieMarkera()
        addEventHandler("onClientMarkerHit"markerRandomowyonRandom)
    end
end)

function kliki()
    if getElementData(localPlayer"praca") ~= "ogrodnik" then return end
    if isMouseIn(mousePoints[target][1], mousePoints[target][2], mousePoints[target][3], mousePoints[target][4]) then
        target target+1
        if target == #mousePoints then
            if not getElementData(localPlayer"player:premium"then
            triggerServerEvent("hajsOgrodnik"localPlayermath.random(20,50), math.random(0,2))
            else
            triggerServerEvent("hajsOgrodnik"localPlayermath.random(20*1.250*1.2), math.random(1,4))
            end
            target 0
            setElementData(localPlayer"ogrodnik:zakonczono"true)
            showCursor(false)
            tworzenieMarkera()
            addEventHandler("onClientMarkerHit"markerRandomowyonRandom)
        end
        return
    end
end
bindKey("mouse1""down"kliki)

addCommandHandler("zakoncz.ogrodnik", function()
    if getElementData(localPlayer"praca") ~= "ogrodnik" then
        triggerEvent("onClientAddNotification"localPlayer"Nie posiadasz aktywnej pracy ogrodnika""error")
        return
    end
    setElementData(localPlayer"praca"nil)
    destroyElement(markerRandomowy)
    destroyElement(blipRandomowy)
    triggerEvent("onClientAddNotification"localPlayer"Ko?czysz prac? jako ogrodnik""success")
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-20, 00:35


Kuks*







Wiek: 15
Na forum: 3030 dni
Posty: 246
Nick w MP: Kuks*

Piwa: 2208

Respekt: 115,8
Respekt: 115,8

smigi, Od razu przy starcie pracy daj el. date praca:ogrodnik:gui na true i usun tworzeniemarkera()

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-20, 15:15


smigi







Wiek: 23
Na forum: 3367 dni
Posty: 60
Nick w MP: smigi

Piwa: 2

Respekt: 50

Kuks*,
nie wiem o co chodzi pomozesz?

Postaw piwo autorowi tego posta
 

 
Tagi: praca :: ogrodnika
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