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

Wysłany: 2017-08-02, 15:02


Kuksss

guwno






Wiek: 22
Na forum: 3922 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
Czmu gdy chc? stworzy? plik pasy.xml nic si? nie dzieje?
Doda?em skrypt do acl admin, ale dalej nic sie nie tworzy
kod:
if getElementData(localPlayer, "player:uid") then return end
local pasyCreate = xmlCreateFile("pasy.xml"," newroot")

local root = getRootElement()
local resourceRoot = getResourceRootElement(getThisResource())
local sxidth, syeight = guiGetScreenSize()


local blurStrength = 20


local myScreenSource = dxCreateScreenSource(sxidth, syeight)
blurShader, blurTec = dxCreateShader("shaders/BlurShader.fx")


function renderblur()
    if blur == true then
        dxUpdateScreenSource(myScreenSource)
        
        dxSetShaderValue(blurShader, "ScreenSource", myScreenSource);
        dxSetShaderValue(blurShader, "BlurStrength", blurStrength);
        dxSetShaderValue(blurShader, "UVSize", sxidth, syeight);

        dxDrawImage(0, 0, sxidth, syeight, blurShader)
    end
end
addEventHandler("onClientRender", root, renderblur)

addEventHandler("onClientResourceStop", resourceRoot,
function()
    if (blurShader) then
        destroyElement(blurShader)
        blurShader = nil
    end
end)

x,y=2313.58, 1282.80-- my width
intro_step=math.random(0,850)

local sx,sy=guiGetScreenSize()
local data={ showed=nil, button={}, info=nil, misc=nil, }

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
local dist = 100
local angler = 0
function getPointFromDistanceRotation(x, y, dist, angler)
    local a = math.rad(90 - angler)
    local dx = math.cos(a) * dist;
    local dy = math.sin(a) * dist;
    return x+dx, y+dy;
end

function renderLoginBox()
    blur = true
    dxDrawRectangle(sx*270/1025, sy*150/769, sx*500/1025, sy*458/767, tocolor(0, 0, 0, 135), false)
    dxDrawImage(sx * 0.0000, sy * 0.0000, sx * 1.0000, sy * 1.0000, ":ogrpg-logging/misc/panel.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(sx * 0.1948, sy * 0.7593, sx * 0.2583, sy * 0.0870, ":ogrpg-logging/misc/log_button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    dxDrawImage(sx * 0.5240, sy * 0.7593, sx * 0.2583, sy * 0.0870, ":ogrpg-logging/misc/rej_button.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
    if data.info then dxDrawText(data.info, sx * 0.1646, sy * 0.6630, sx * 0.8208, sy * 0.7472, tocolor(254, 0, 0, 255), 1.70, "bankgothic", "left", "top", false, false, false, false, false) end
    local x,y=getPointFromDistanceRotation(2313.58, 1282.80, dist, angler)
    setCameraMatrix(x,y,107.72+0.9,2323.69, 1285.66, 107.72+0.9)
    angler=(angler+0.1)
end





addEventHandler("onClientClick", root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx * 0.1948, sy * 0.7593, sx * 0.2583, sy * 0.0870) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < 2 or string.len(pass) < 2 then
                data.info="Wype?nij wszystkie pola!"
                return
            end
            triggerServerEvent("logging:checkAccount", resourceRoot, login, pass)
        end
        if isMouseIn(sx * 0.5240, sy * 0.7593, sx * 0.2583, sy * 0.0870) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < 3 or string.len(pass) < 3 then
                data.info="Login/Has?o musz? mie? mniej ni? od 3 do 22 znak?w."
                return
            end
            triggerServerEvent("logging:newAccount", resourceRoot, login, pass)
        end
    end
end)

addEvent("logging:result", true)
addEventHandler("logging:result", resourceRoot, function(value,info)
    if not info then info="" end
    if value then
        data.showed=false
        showZones(data.misc)
        
        -- Usuwamy elementy
        destroyElement(data.button[1])
        destroyElement(data.button[2])
        removeEventHandler("onClientRender", root, renderLoginBox)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end, 3000, 1)
    end
end)

addEventHandler("onClientResourceStart", resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc, 1.0)
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    --setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender", root, renderLoginBox)
    data.button[1]=guiCreateEdit(0.37, 0.37, 0.22, 0.06, "", true)
    data.button[2]=guiCreateEdit(0.37, 0.59, 0.22, 0.06, "", true)   
    guiEditSetMasked(data.button[2],true)
end)

Za pomoc stawiam :piwo:

Podpis
c***
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-02, 15:55


Szymczu

Programista bo tak






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

Piwa: 36

Respekt: 120
Respekt: 120


Więcej informacji znajdziesz w Wikipedii MTA:

xmlSaveFile


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-02, 16:02


Kuksss

guwno






Wiek: 22
Na forum: 3922 dni
Posty: 102
Nick w MP: guwnp

Piwa: 732

Respekt: 70,5

Ostrzeżeń: 100%
Szymczu, by?o dodane
local pasyCreate = xmlCreateFile("pasy.xml"," newroot")


Podpis
c***
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-02, 16:09


Szymczu

Programista bo tak






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

Piwa: 36

Respekt: 120
Respekt: 120

No ale masz u?y? jeszcze funkcji "xmlSaveFile".

Postaw piwo autorowi tego posta
 

 
Tagi: zapisywanie :: hasła
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