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

Wysłany: 2018-04-09, 08:15


Cobey







Wiek: 25
Na forum: 3302 dni
Posty: 86
Nick w MP: Anonimowa

Piwa: 285

Respekt: -9

Ostrzeżeń: 100%
Tak jak w temacie,mam k?opot z logowaniem,wyskakuje b??d i nie pokazuje panelu logowania
sx,sy guiGetScreenSize()
x,=  (sx/1366), (sy/768)

messages = {}
editBox = {}
editBox.__index editBox
editBox.instances = {}

function onClientResourceStart()
    tick getTickCount()
    font dxCreateFont("gfx/sans-pro-regular.ttf"20)
    sound playSound("sfx/music.mp3",true)
    = {}
    g.user editBox.new()
    g.user:setPosition(x*601,y*364,x*213,y*41)
    g.user.color = {0,37,112,160}
    g.user.font font
    g.user.text loadLoginFromXML()
    g.user.visible true
    g.user.onInput = function()
        g.user.color = {0,37,112160}
    end
    g.user.onOutput = function()
        g.user.color = {0,37,112,160}
    end
    
    g.pass editBox.new()
    g.pass:setPosition(x*601,y*426,x*213,y*41)
    g.pass.color = {79,86,94,160}
    g.pass.font font
    g.pass.masked true
    g.pass.visible true
    g.pass.onInput = function()
        g.pass.color = {037112160}
    end
    g.pass.onOutput = function()
        g.pass.color = {0,37,112,160}
    end
    
    g.rUser editBox.new()
    g.rUser:setPosition(x*601,y*364,x*213,y*41)
    g.rUser.color = {79,86,94,160}
    g.rUser.font font
    g.rUser.onInput = function()
        g.rUser.color = {037112160}
    end
    g.rUser.onOutput = function()
        g.rUser.color = {0,37,112,160}
    end
    
    g.rPass editBox.new()
    g.rPass:setPosition(x*601,y*426,x*213,y*41)
    g.rPass.color = {0,37,112,160}
    g.rPass.font font
    g.rPass.masked true
    g.rPass.onInput = function()
        g.rPass.color = {037112160}
    end
    g.rPass.onOutput = function()
        g.rPass.color = {0,37,112,160}
    end

    showChat(false)
    showCursor(true)
    addEventHandler("onClientRender"rootpaint)
end
addEventHandler("onClientResourceStart",resourceRoot,onClientResourceStart)

function paint()
    local rh,ry interpolateBetween(0, (y*559/2)+y*1050y*559y*1050, (getTickCount()-tick)/1400"Linear")
        dxDrawImage(395179590492":guieditor/images/reset.png"000tocolor(255255255190), false)
    if getTickCount()-tick 1500 then
        local bColor tocolor(037112200)
        if isMouseInPosition(x*552,y*504,x*262,y*44then
            bColor tocolor(000200)
        end
        dxDrawImage(x*584,y*137,x*199,y*198,"gfx/logo.png",getTickCount()/100,0,0,tocolor(255,255,255,200))
        
        if not inRegisterTab then
            dxDrawRectangle(x*552,y*364,x*49,y*41,tocolor(0,37,112,160))
            dxDrawImage(x*560,y*369,x*33,y*31,"gfx/user.png")
            dxDrawRectangle(x*552,y*426,x*49,y*41,tocolor(0,37,112,160))
            dxDrawImage(x*565,y*431,x*23,y*31,"gfx/pass.png")
        
            dxDrawRectangle(x*552,y*504,x*262,y*44,bColor)
            dxDrawBorder(x*552,y*504,x*262,y*44,tocolor(0,0,0,240),1.4)
            dxDrawText("LOGOWANIE",x*552,y*504,x*552+x*262,y*504+y*44,tocolor(255,255,255),y*1,font,"center","center")
        
            dxDrawText([[NIE ZAREJESTROWANY?
REJESTRACJA #002570 KLIKNIJ #002570],x*588,y*582,x*588+x*192,y*592+y*43,tocolor(255,255,255),y*0.6,font,"center","center",false,false,false,true)
        end

        for k,self in pairs(editBox.instances) do
            if self.visible then
                local px,py,pw,ph self:getPosition()
                local text self.masked and string.gsub(self.text,".","•") or self.text
                local alignX dxGetTextWidth(text,self.scale,self.font) <= pw and "left" or "right"
                dxDrawRectangle(pxpypwphtocolor(unpack(self.color)))
                dxDrawText(text,px+x*5py,px-x*5+pwpy+ph,tocolor(unpack(self.textColor)),self.scale,self.font,alignX,"center",true)        
                if self.input and dxGetTextWidth(text,self.scale,self.font) <= pw then
                    local lx dxGetTextWidth(text,self.scale,self.font)+px+x*8
                    local lx dxGetTextWidth(text,self.scale,self.font)+px+x*8
                    dxDrawLine(lxpy+y*10lxpy+ph-y*10tocolor(255,255,255,math.abs(math.sin(getTickCount()/300))*200), 2)
                end
            end
        end
        
    if not inRegisterTab then
        dxDrawBorder(x*552,y*364,x*262,y*41,tocolor(0,0,0,240),1)
        dxDrawBorder(x*552,y*426,x*262,y*41,tocolor(0,0,0,240),1)
    else
    
        dxDrawRectangle(x*552,y*364,x*49,y*41,tocolor(0,37,112,160))
        dxDrawImage(x*560,y*369,x*33,y*31,"gfx/user.png")
        dxDrawRectangle(x*552,y*426,x*49,y*41,tocolor(0,37,112,160))
        dxDrawImage(x*565,y*431,x*23,y*31,"gfx/pass.png")
        dxDrawBorder(x*552,y*364,x*262,y*41,tocolor(0,0,0,240),1)
        dxDrawBorder(x*552,y*426,x*262,y*41,tocolor(0,0,0,240),1)
        
        dxDrawRectangle(x*552,y*504,x*262,y*44,bColor)
        dxDrawBorder(x*552,y*504,x*262,y*44,tocolor(0,0,0,240),1.4)
        dxDrawText("ZAREJESTRUJ SI?",x*552,y*504,x*552+x*262,y*504+y*44,tocolor(255,255,255),y*1,font,"center","center")
    end
    
    end
        
    if getKeyState("backspace"then
        for k,self in pairs(editBox.instances) do
            if self.visible and self.input then
                if not keyState then
                    keyState getTickCount() + 400
                    self.text string.sub(self.text,1,string.len(self.text)-1)
                elseif keyState and keyState getTickCount() then
                    keyState getTickCount()+100
                    self.text string.sub(self.text,1,string.len(self.text)-1)
                end
                return
            end
        end
        keyState nil
    end
    
    for iv in pairs(messages) do
        if v.visible then
            dxDrawRectangle(sx-dxGetTextWidth(v.text1"default-bold")-1035*idxGetTextWidth(v.text1"default-bold")+5032,v.color)
            dxDrawBorder(sx-dxGetTextWidth(v.text1"default-bold")-1035*idxGetTextWidth(v.text1"default-bold")+2032,tocolor(255,255,255,200),1.6)
            dxDrawText(v.text,sx-dxGetTextWidth(v.text,1,"default-bold")-59+35*idxGetTextWidth(v.text1"default-bold"), 32tocolor(255,255,255,255), 1"default-bold""left""top"falsefalse ,falsetrue)
        end
    end
end

function onClientClick(button,state,cX,cY)
    if not isCursorShowing() then
        return
    end
    if button == "left" and state == "up" then
        for k,self in pairs(editBox.instances) do
            if self.visible then
                if self.input then
                    self.input nil
                    self.onOutput()
                end
                local x,y,w,self:getPosition()
                if isMouseInPosition(x,y,w,hthen
                    self.input true
                    self.onInput()
                end
            end
        end
        if not inRegisterTab then
            if isMouseInPosition(x*552,y*504,x*262,y*44then
                triggerServerEvent("onRequestLogin",localPlayer,g.user.text,g.pass.text)
            elseif isMouseInPosition(x*700,y*609,x*44,y*22then
                g.user.visible false
                g.pass.visible false
                
                inRegisterTab true
                g.rUser.visible true
                g.rPass.visible true
            end
        else
            if isMouseInPosition(x*552,y*504,x*262,y*44then
                triggerServerEvent("onRequestRegister",localPlayer,g.rUser.text,g.rPass.text)
            end
        end
    end
end
addEventHandler("onClientClick"rootonClientClick)

function onClientCharacter(character)
    if not isCursorShowing() then
        return
    end
    for k,self in pairs(editBox.instances) do
        if self.visible and self.input then
            if (string.len(self.text)) < self.maxLength then
                self.text self.text..character
            end
        end
    end
end
addEventHandler("onClientCharacter"rootonClientCharacter)

function editBox.new()
    local self setmetatable({}, editBox)
    self.text ""
    self.maxLength 20
    self.scale y*0.8
    self.state "normal"
    self.font "sans"
    self.color = {255,255,255,220}
    self.textColor = {255,255,255,220}
    table.insert(editBox.instancesself)
    return self
end

function editBox:getPosition()
    return self.xself.yself.wself.h
end

function editBox:setPosition(x,y,w,h)
    self.xself.yself.wself.x,y,w,h
    return true
end

function dxDrawBorder(posXposY,posW,posH,color,scale)
    dxDrawLine(posXposYposX+posWposYcolorscale,false)
    dxDrawLine(posXposYposXposY+posHcolorscale,false)
    dxDrawLine(posXposY+posHposX+posWposY+posHcolorscale,false)
    dxDrawLine(posX+posWposYposX+posWposY+posHcolorscale,false)
end

function isMouseInPosition(x,y,width,height)
    local cxcy getCursorPosition()
    local cxcy = (cx*sx), (cy*sy)
    if (cx >= and cx <= width) and (cy >= and cy <= heightthen
        return true
    else
        return false
    end
end

function onLogin()
    showChat(true)
    showCursor(false)
    stopSound(sound)
    removeEventHandler("onClientRender"rootpaint)
    removeEventHandler("onClientClick",root,onClientClick)
    removeEventHandler("onClientCharacter",root,onClientCharacter)
end
addEvent("onLogin"true)
addEventHandler("onLogin"localPlayeronLogin)

function onRegister()
    g.user.visible true
    g.pass.visible true
    g.user.text ""
    g.pass.text ""
        
    inRegisterTab false
    g.rUser.visible false
    g.rPass.visible false
    g.rUser.text ""
    g.rPass.text ""
end
addEvent("onRegister"true)
addEventHandler("onRegister"localPlayeronRegister)

function loadLoginFromXML()
    local XML xmlLoadFile ("userdata.xml")
    if not XML then
        XML xmlCreateFile("userdata.xml""login")
    end
    
    local usernameNode xmlFindChild (XML"username"0)
    if usernameNode then
        return xmlNodeGetValue(usernameNode)
    else
        return ""
    end
    xmlUnloadFile XML )
end

function saveLoginToXML(username)
    local XML xmlLoadFile ("userdata.xml")
    if not XML then
        XML xmlCreateFile("userdata.xml""login")
    end
    if (username ~= ""then
        local usernameNode xmlFindChild (XML"username"0)
        if not usernameNode then
            usernameNode xmlCreateChild(XML"username")
        end
        xmlNodeSetValue (usernameNodetostring(username))
    end
    xmlSaveFile(XML)
    xmlUnloadFile (XML)
end
addEvent("saveLoginToXML"true)
addEventHandler("saveLoginToXML"rootsaveLoginToXML)


function login_text(resulttext)
    if result == "sucess" then
        addNotification(text,1)
    elseif result == "error" then
        addNotification(text,2)
    end
end
addEvent("login_text",true)
addEventHandler("login_text",root,login_text)

function addNotification(texttype)
    text string.gsub(text,"#%x%x%x%x%x%x","")
    local i 0
    if text == "" or text == nil or not type then
        return
    else
        for 0#messages+1 do
            if messages[ithen
                i i+1
            else
                messages[i] = {}
                messages[i].text text
                messages[i].visible true
                if type == 1 then
                    messages[i].color tocolor(0,255,0,255)
                elseif type == 2 then
                    messages[i].color tocolor(255,0,0,255)
                end
                setTimer(removeNotify,5000,1,i)
            end
        end
    end
end

function removeNotify(i)
    messages[i].visible false
    messages[i] = nil
end

function dxDrawBorder(posXposY,posW,posH,color,scale)
    dxDrawLine(posXposYposX+posWposYcolorscale,false)
    dxDrawLine(posXposYposXposY+posHcolorscale,false)
    dxDrawLine(posXposY+posHposX+posWposY+posHcolorscale,false)
    dxDrawLine(posX+posWposYposX+posWposY+posHcolorscale,false)
end

DB3
ERROR: Loading script failed: op-login/client/main.lua:340: unfinished long string near '<eof>'

Podpis
13.04.2018 [*] ArtWorld
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-09, 08:38


.RiV







Wiek: 25
Na forum: 3588 dni
Posty: 554
Nick w MP: Split

Piwa: 2596

Respekt: 597,8
Respekt: 597,8

Mo?esz poda? kod z 340 linijki ? Magicznej kuli nie mamy.

Podpis

Autor OGRPG, na scenie MTA od 2012 roku.




Użytkownik: 08.08.2016
GTAO Member: 06.02.2017
Support-Team: 17.06.2017 & 01.06.2019 - 18.11.2019
Moderator: 14.01.2018 - 09.08.2018

Ostatnio zmieniony przez .RiV 2018-04-09, 08:39, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-09, 08:39


xJakob







Wiek: 31
Na forum: 3662 dni
Posty: 164
Nick w MP: tylkoyolo

Piwa: 984

Respekt: 155,3
Respekt: 155,3Respekt: 155,3

Nie wiem na pewno ale wychodzi z tego db ?e nie zako?czy?e? stringa czyli po prostu pobaw si? endami. Nie jestem pewien 100% ale pobaw si? to nic nie kosztuje a mo?e uporasz si? z tym.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-09, 09:05


Cobey







Wiek: 25
Na forum: 3302 dni
Posty: 86
Nick w MP: Anonimowa

Piwa: 285

Respekt: -9

Ostrzeżeń: 100%
340linijka to jest ostatnia,zakonczona endem

Podpis
13.04.2018 [*] ArtWorld
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-04-09, 15:01


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Tak wygl?da m?j kod bez b??d?w. Troch? usun??em kodu od grafiki, gdy? nie mia?em nic. Ale, przystosuj si? do niego i Sobie tam do??cz potrzebne linijki, kt?rych brakuje:

sx,sy guiGetScreenSize()
x,=  (sx/1366), (sy/768)

messages = {}
editBox = {}
editBox.__index editBox
editBox.instances = {}

font "default"

function onClientResourceStart()
    tick getTickCount()
    sound playSound("",true)
    = {}
    g.user editBox.new()
    g.user:setPosition(x*601,y*364,x*213,y*41)
    g.user.color = {0,37,112,160}
    g.user.font font
    g.user.text loadLoginFromXML()
    g.user.visible true
    g.user.onInput = function()
        g.user.color = {0,37,112160}
    end
    g.user.onOutput = function()
        g.user.color = {0,37,112,160}
    end
    
    g.pass editBox.new()
    g.pass:setPosition(x*601,y*426,x*213,y*41)
    g.pass.color = {79,86,94,160}
    g.pass.font font
    g.pass.masked true
    g.pass.visible true
    g.pass.onInput = function()
        g.pass.color = {037112160}
    end
    g.pass.onOutput = function()
        g.pass.color = {0,37,112,160}
    end
    
    g.rUser editBox.new()
    g.rUser:setPosition(x*601,y*364,x*213,y*41)
    g.rUser.color = {79,86,94,160}
    g.rUser.font font
    g.rUser.onInput = function()
        g.rUser.color = {037112160}
    end
    g.rUser.onOutput = function()
        g.rUser.color = {0,37,112,160}
    end
    
    g.rPass editBox.new()
    g.rPass:setPosition(x*601,y*426,x*213,y*41)
    g.rPass.color = {0,37,112,160}
    g.rPass.font font
    g.rPass.masked true
    g.rPass.onInput = function()
        g.rPass.color = {037112160}
    end
    g.rPass.onOutput = function()
        g.rPass.color = {0,37,112,160}
    end

    showChat(false)
    showCursor(true)
    addEventHandler("onClientRender"rootpaint)
end
addEventHandler("onClientResourceStart",resourceRoot,onClientResourceStart)

function paint()
    local rh,ry interpolateBetween(0, (y*559/2)+y*1050y*559y*1050, (getTickCount()-tick)/1400"Linear")
    if getTickCount()-tick 1500 then
        local bColor tocolor(037112200)
        if isMouseInPosition(x*552,y*504,x*262,y*44then
            bColor tocolor(000200)
        end
        
        if not inRegisterTab then
            dxDrawRectangle(x*552,y*364,x*49,y*41,tocolor(0,37,112,160))
            dxDrawRectangle(x*552,y*426,x*49,y*41,tocolor(0,37,112,160))
        
            dxDrawRectangle(x*552,y*504,x*262,y*44,bColor)
            dxDrawBorder(x*552,y*504,x*262,y*44,tocolor(0,0,0,240),1.4)
            dxDrawText("LOGOWANIE",x*552,y*504,x*552+x*262,y*504+y*44,tocolor(255,255,255),y*1,font,"center","center")
        
            dxDrawText("NIE ZAREJESTROWANY? REJESTRACJA - KLIKNIJ",x*588,y*582,x*588+x*192,y*592+y*43,tocolor(255,255,255),y*0.6,font,"center","center",false,false,false,true)
        end

        for k,self in pairs(editBox.instances) do
            if self.visible then
                local px,py,pw,ph self:getPosition()
                local text self.masked and string.gsub(self.text,".","text") or self.text
                local alignX dxGetTextWidth(text,self.scale,self.font) <= pw and "left" or "right"
                dxDrawRectangle(pxpypwphtocolor(unpack(self.color)))
                dxDrawText(text,px+x*5py,px-x*5+pwpy+ph,tocolor(unpack(self.textColor)),self.scale,self.font,alignX,"center",true)        
                if self.input and dxGetTextWidth(text,self.scale,self.font) <= pw then
                    local lx dxGetTextWidth(text,self.scale,self.font)+px+x*8
                    local lx dxGetTextWidth(text,self.scale,self.font)+px+x*8
                    dxDrawLine(lxpy+y*10lxpy+ph-y*10tocolor(255,255,255,math.abs(math.sin(getTickCount()/300))*200), 2)
                end
            end
        end
        
    if not inRegisterTab then
        dxDrawBorder(x*552,y*364,x*262,y*41,tocolor(0,0,0,240),1)
        dxDrawBorder(x*552,y*426,x*262,y*41,tocolor(0,0,0,240),1)
    else
    
        dxDrawRectangle(x*552,y*364,x*49,y*41,tocolor(0,37,112,160))
        dxDrawRectangle(x*552,y*426,x*49,y*41,tocolor(0,37,112,160))
        dxDrawBorder(x*552,y*364,x*262,y*41,tocolor(0,0,0,240),1)
        dxDrawBorder(x*552,y*426,x*262,y*41,tocolor(0,0,0,240),1)
        
        dxDrawRectangle(x*552,y*504,x*262,y*44,bColor)
        dxDrawBorder(x*552,y*504,x*262,y*44,tocolor(0,0,0,240),1.4)
        dxDrawText("ZAREJESTRUJ SI?",x*552,y*504,x*552+x*262,y*504+y*44,tocolor(255,255,255),y*1,font,"center","center")
    end
    
    end
        
    if getKeyState("backspace"then
        for k,self in pairs(editBox.instances) do
            if self.visible and self.input then
                if not keyState then
                    keyState getTickCount() + 400
                    self.text string.sub(self.text,1,string.len(self.text)-1)
                elseif keyState and keyState getTickCount() then
                    keyState getTickCount()+100
                    self.text string.sub(self.text,1,string.len(self.text)-1)
                end
                return
            end
        end
        keyState nil
    end
    
    for iv in pairs(messages) do
        if v.visible then
            dxDrawRectangle(sx-dxGetTextWidth(v.text1"font-bold")-1035*idxGetTextWidth(v.text1"font-bold")+5032,v.color)
            dxDrawBorder(sx-dxGetTextWidth(v.text1"font-bold")-1035*idxGetTextWidth(v.text1"font-bold")+2032,tocolor(255,255,255,200),1.6)
            dxDrawText(v.text,sx-dxGetTextWidth(v.text,1,"font-bold")-59+35*idxGetTextWidth(v.text1"font-bold"), 32tocolor(255,255,255,255), 1"font-bold""left""top"falsefalse ,falsetrue)
        end
    end
end

function onClientClick(button,state,cX,cY)
    if not isCursorShowing() then
        return
    end
    if button == "left" and state == "up" then
        for k,self in pairs(editBox.instances) do
            if self.visible then
                if self.input then
                    self.input nil
                    self.onOutput()
                end
                local x,y,w,self:getPosition()
                if isMouseInPosition(x,y,w,hthen
                    self.input true
                    self.onInput()
                end
            end
        end
        if not inRegisterTab then
            if isMouseInPosition(x*552,y*504,x*262,y*44then
                triggerServerEvent("onRequestLogin",localPlayer,g.user.text,g.pass.text)
            elseif isMouseInPosition(x*700,y*609,x*44,y*22then
                g.user.visible false
                g.pass.visible false
                
                inRegisterTab true
                g.rUser.visible true
                g.rPass.visible true
            end
        else
            if isMouseInPosition(x*552,y*504,x*262,y*44then
                triggerServerEvent("onRequestRegister",localPlayer,g.rUser.text,g.rPass.text)
            end
        end
    end
end
addEventHandler("onClientClick"rootonClientClick)

function onClientCharacter(character)
    if not isCursorShowing() then
        return
    end
    for k,self in pairs(editBox.instances) do
        if self.visible and self.input then
            if (string.len(self.text)) < self.maxLength then
                self.text self.text..character
            end
        end
    end
end
addEventHandler("onClientCharacter"rootonClientCharacter)

function editBox.new()
    local self setmetatable({}, editBox)
    self.text ""
    self.maxLength 20
    self.scale y*0.8
    self.state "normal"
    self.font "sans"
    self.color = {255,255,255,220}
    self.textColor = {255,255,255,220}
    table.insert(editBox.instancesself)
    return self
end

function editBox:getPosition()
    return self.xself.yself.wself.h
end

function editBox:setPosition(x,y,w,h)
    self.xself.yself.wself.x,y,w,h
    return true
end

function dxDrawBorder(posXposY,posW,posH,color,scale)
    dxDrawLine(posXposYposX+posWposYcolorscale,false)
    dxDrawLine(posXposYposXposY+posHcolorscale,false)
    dxDrawLine(posXposY+posHposX+posWposY+posHcolorscale,false)
    dxDrawLine(posX+posWposYposX+posWposY+posHcolorscale,false)
end

function isMouseInPosition(x,y,width,height)
    local cxcy getCursorPosition()
    local cxcy = (cx*sx), (cy*sy)
    if (cx >= and cx <= width) and (cy >= and cy <= heightthen
        return true
    else
        return false
    end
end

function onLogin()
    showChat(true)
    showCursor(false)
    stopSound(sound)
    removeEventHandler("onClientRender"rootpaint)
    removeEventHandler("onClientClick",root,onClientClick)
    removeEventHandler("onClientCharacter",root,onClientCharacter)
end
addEvent("onLogin"true)
addEventHandler("onLogin"localPlayeronLogin)

function onRegister()
    g.user.visible true
    g.pass.visible true
    g.user.text ""
    g.pass.text ""
        
    inRegisterTab false
    g.rUser.visible false
    g.rPass.visible false
    g.rUser.text ""
    g.rPass.text ""
end
addEvent("onRegister"true)
addEventHandler("onRegister"localPlayeronRegister)

function loadLoginFromXML()
    local XML xmlLoadFile ("userdata.xml")
    if not XML then
        XML xmlCreateFile("userdata.xml""login")
    end
    
    local usernameNode xmlFindChild (XML"username"0)
    if usernameNode then
        return xmlNodeGetValue(usernameNode)
    else
        return ""
    end
    xmlUnloadFile XML )
end

function saveLoginToXML(username)
    local XML xmlLoadFile ("userdata.xml")
    if not XML then
        XML xmlCreateFile("userdata.xml""login")
    end
    if (username ~= ""then
        local usernameNode xmlFindChild (XML"username"0)
        if not usernameNode then
            usernameNode xmlCreateChild(XML"username")
        end
        xmlNodeSetValue (usernameNodetostring(username))
    end
    xmlSaveFile(XML)
    xmlUnloadFile (XML)
end
addEvent("saveLoginToXML"true)
addEventHandler("saveLoginToXML"rootsaveLoginToXML)


function login_text(resulttext)
    if result == "sucess" then
        addNotification(text,1)
    elseif result == "error" then
        addNotification(text,2)
    end
end
addEvent("login_text",true)
addEventHandler("login_text",root,login_text)

function addNotification(texttype)
    text string.gsub(text,"#%x%x%x%x%x%x","")
    local i 0
    if text == "" or text == nil or not type then
        return
    else
        for 0#messages+1 do
            if messages[ithen
                i i+1
            else
                messages[i] = {}
                messages[i].text text
                messages[i].visible true
                if type == 1 then
                    messages[i].color tocolor(0,255,0,255)
                elseif type == 2 then
                    messages[i].color tocolor(255,0,0,255)
                end
                setTimer(removeNotify,5000,1,i)
            end
        end
    end
end

function removeNotify(i)
    messages[i].visible false
    messages[i] = nil
end

function dxDrawBorder(posXposY,posW,posH,color,scale)
    dxDrawLine(posXposYposX+posWposYcolorscale,false)
    dxDrawLine(posXposYposXposY+posHcolorscale,false)
    dxDrawLine(posXposY+posHposX+posWposY+posHcolorscale,false)
    dxDrawLine(posX+posWposYposX+posWposY+posHcolorscale,false)
end


Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Tagi: logowanie :: kłopot
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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