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

Wysłany: 2017-08-19, 23:06


sasik12







Wiek: 27
Na forum: 3904 dni
Posty: 182

Piwa: 7

Respekt: 60

Elo .Mam problem z wyplatami :/

--[[
Autor: Malentas
Dla: .sunnyRPG
NIE MASZ PRAWA DO U?YWANIA KODU BEZ MOJEJ ZGODY!!!!!!
]]

local screenW, screenH = guiGetScreenSize()
local sx, sy = guiGetScreenSize()

function isMouseIn(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

function roundedRectangle(x, y, w, h, color)
  exports["nm-blur"]:dxDrawBluredRectangle(x, y, w, h, tocolor(255,255,255), false)
  exports["nm-blur"]:dxDrawBluredRectangle(x + 2, y - 1, w - 4, 1, tocolor(255,255,255), false)
  exports["nm-blur"]:dxDrawBluredRectangle(x + 2, y + h, w - 4, 1, tocolor(255,255,255), false)
  exports["nm-blur"]:dxDrawBluredRectangle(x - 1, y + 2, 1, h - 4, tocolor(255,255,255), false)
  exports["nm-blur"]:dxDrawBluredRectangle(x + w, y + 2, 1, h - 4, tocolor(255,255,255), false)
  dxDrawRectangle(x, y, w, h, color, false)
  dxDrawRectangle(x + 2, y - 1, w - 4, 1, color, false)
  dxDrawRectangle(x + 2, y + h, w - 4, 1, color, false)
  dxDrawRectangle(x - 1, y + 2, 1, h - 4, color, false)
  dxDrawRectangle(x + w, y + 2, 1, h - 4, color, false)
end

function shadowText(text, x, y, w, h, color, size, font, xx, yy)
    dxDrawText(text, x+1, y+1, w+1, h+1, tocolor(0,0,0), size, font, xx, yy, false)
    dxDrawText(text, x, y, w, h, color, size, font, xx, yy, false)
end

oknowyplat = false

local font = dxCreateFont(":nm-gui/lcz.ttf", 10) or "default-bold"

function gui()
        dxDrawRectangle(screenW * 0.3542, screenH * 0.2656, screenW * 0.2597, screenH * 0.3933, tocolor(0, 0, 0, 180), false)
        dxDrawRectangle(screenW * 0.3542, screenH * 0.2200, screenW * 0.2597, screenH * 0.0644, tocolor(74, 178, 0, 255), false)
        dxDrawText("Odbieranie wyp?at frakcyjnych", screenW * 0.3535, screenH * 0.2189, screenW * 0.6139, screenH * 0.2844, tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
        dxDrawText("Tutaj odbierzesz wyp?ate z SAPD, PSP ,PR i TAXI\n Twoja s?u?ba wynosi: "..getElementData(localPlayer,"wyplata").." minut/a", screenW * 0.3542, screenH * 0.2844, screenW * 0.6139, screenH * 0.4356, tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
        --dxDrawText("Tutaj odbierzesz wyp?ate z SAPD, PSP ,PR i TAXI\n Twoja s?u?ba wynosi: "..getElementData(localPlayer,"wyplata").." minut/a", screenW * 0.3542, screenH * 0.2844, screenW * 0.6139, screenH * 0.4356, tocolor(255, 255, 255, 255), 1.00, font,"center", "center", false, false, false, false, false)
        if isMouseIn(screenW * 0.3681, screenH * 0.4722, screenW * 0.2306, screenH * 0.0789) then
        dxDrawRectangle(screenW * 0.3681, screenH * 0.4722, screenW * 0.2306, screenH * 0.0789, tocolor(74, 178, 0, 155), false)
        else
        dxDrawRectangle(screenW * 0.3681, screenH * 0.4722, screenW * 0.2306, screenH * 0.0789, tocolor(74, 178, 0, 255), false)
        end
        if isMouseIn(screenW * 0.3681, screenH * 0.5622, screenW * 0.2306, screenH * 0.0789) then
        dxDrawRectangle(screenW * 0.3681, screenH * 0.5622, screenW * 0.2306, screenH * 0.0789, tocolor(74, 178, 0, 155), false)
        else
        dxDrawRectangle(screenW * 0.3681, screenH * 0.5622, screenW * 0.2306, screenH * 0.0789, tocolor(74, 178, 0, 255), false)
        end
        dxDrawText("Odbierz wyp?ate", screenW * 0.3674, screenH * 0.4650, screenW * 0.5986, screenH * 0.5611, tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
        dxDrawText("Zamknij panel", screenW * 0.3674, screenH * 0.645, screenW * 0.5986, screenH * 0.5611, tocolor(255, 255, 255, 255), 1.00, font, "center", "center", false, false, false, false, false)
end


local marker = createMarker(-2023.18, 474.09, 161.55-1,"cylinder", 1.5, 255, 255, 255, 50)

addEventHandler("onClientMarkerHit", marker, function(player)
    if player ~= localPlayer then return end
    addEventHandler("onClientRender", root, gui)
    oknowyplat = true
    showCursor(true)

addEventHandler("onClientMarkerHit", marker, function(btn, state)
    if btn == "left" and state == "down" then
        if isMouseIn(screenW * 0.3681, screenH * 0.4722, screenW * 0.2306, screenH * 0.0789) and oknowyplat == true then
            local pieniadze = getElementData(localPlayer,"pieniadze")
            local wyplata = getElementData(localPlayer,"wyplata")*200
            local minut = getElementData(localPlayer,"wyplata")
            if minut < 1 then return exports["nm-noti"]:noti("Musisz posiada? minimum 1 minute na s?u?bie aby odebra? wyp?ate.") end
            setElementData(localPlayer,"pieniadze", pieniadze+wyplata)
            exports["nm-noti"]:noti("Odebra?e? "..wyplata.." PLN za "..minut.." minut.")
            removeEventHandler("onClientRender", root, gui)
                       oknowyplat = false
                      showCursor(false)
                       setElementData(localPlayer,"wyplata", 0)
        elseif isMouseIn(screenW * 0.3681, screenH * 0.5622, screenW * 0.2306, screenH * 0.0789) and oknowyplat == true then
            removeEventHandler("onClientRender", root, gui)
                        oknowyplat = false
                        showCursor(false)
end
end
end)
end)



B??d db3 :
http://www77.zippyshare.com/v/wmI0zTVM/file.html

Za pomoc :piwo: i R*

Podpis
Uczeń LUA . Mapper MTA.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-19, 23:34


Luqas

.lua <3






Wiek: 25
Na forum: 3596 dni
Posty: 84
Nick w MP: Luqas

Piwa: 10

Respekt: 80

Z tego co widze, je?eli patrz? na dobr? linijke to elementData "wyplata" ma warto?? prawda/fa?sz. A dlaczego, to ju? nie mam poj?cia. Co? musi le?e? po stronie servera :|

[ Dodano: 2017-08-19, 23:38 ]
Prawdopodobnie co? jest nie tak ze skryptem, albo nadaje z?? elementDate, a "wyplata" nie istnieje. St?d ten b??d.

Podpis
Pomogłem? Postaw Piwo lub/i respekt ^^


 Mój Youtube (klik)
Moje skrypty:
- Pay'n'Spray -

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-20, 00:32


Szymczu

Programista bo tak






Wiek: 27
Na forum: 3576 dni
Posty: 194
Nick w MP: Szymczu

Piwa: 36

Respekt: 120
Respekt: 120

B??d wynika z tego, ?e skrypt pr?buje pobra? elementDate, kt?ra nie istnieje.
Skrypt wywal bo ma mase b??d?w.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-20, 21:49


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4979 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

W og?le czemu masz 2 onClientMarkerHit? jednego nie zako?czy?e? i drugi zrobi?e? z parametrami 'btn' 'state' ;o



addEventHandler("onClientMarkerHit", marker, function(player)
    if player ~= localPlayer then return end
    addEventHandler("onClientRender", root, gui)
    oknowyplat = true
    showCursor(true)

addEventHandler("onClientMarkerHit", marker, function(btn, state)
    if btn == "left" and state == "down" then


Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Tagi: wyplaty :: frakcji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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