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

Wysłany: 2014-03-24, 20:57


zuraw13







Wiek: 27
Na forum: 5073 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Nie dzia?a opcja rejestracji w panelu logowania.
Klikam rejestruj i wyskakuje w konsoli serwera:
Cytat:

[2014-03-24 19] WARNING: [gameplay]\xyz\login\login_s.lua:20: Access denied @ 'addAccount'
[2014-03-24 19] WARNING: [gameplay]\xyz\login\login_s.lua:21: Bad argument @ 'logIn' [Expected account at argument 2, got nil]


Miejsce b??du jest po stronie serwera:
        account addAccount(usernamepassword)
        if (logIn(playeraccountpassword) == truethen



Kod, strona klienta:
sWidthsHeight guiGetScreenSize()
anims = {"dnce_M_b","DAN_Left_A","DAN_Down_A","DAN_Loop_A"}
StartSkin 0
NewSkin false
local localPlayer getLocalPlayer()
local x 1024
local y 768
local sm = {}
sm.moov 0
sm.object1sm.object2 nilnil
local months = {
        [0] = "stycznia",
        [1] = "lutego",
        [2] = "marca",
        [3] = "kwietnia",
        [4] = "maja",
        [5] = "czerwca",
        [6] = "lipca",
        [7] = "sierpnia",
        [8] = "wrze?nia",
        [9] = "pa?dziernika",
        [10] = "listopada",
        [11] = "grudnia"
        }

local function camRender ()
    if isElement(sm.object1) and (sm.object2then
        local x1y1z1 getElementPosition sm.object1 )
        local x2y2z2 getElementPosition sm.object2 )
        setCameraMatrix x1y1z1x2y2z2 )
    end
end

local function removeCamHandler ()
    if(sm.moov == 1then
        sm.moov 0
        removeEventHandler "onClientPreRender"getRootElement(), camRender )
    end
end
 

function smoothMoveCamera x1y1z1x1ty1tz1tx2y2z2x2ty2tz2ttime )
    if(sm.moov == 1then return false end
    sm.object1 createObject 1337x1y1z1 )
    sm.object2 createObject 1337x1ty1tz1t )
    setElementAlpha sm.object1)
    setElementAlpha sm.object2)
    setObjectScale(sm.object10.01)
    setObjectScale(sm.object20.01)
    moveObject sm.object1timex2y2z2000"InOutQuad" )
    moveObject sm.object2timex2ty2tz2t000"InOutQuad" )
 
    addEventHandler "onClientPreRender"getRootElement(), camRender )
    sm.moov 1
    return true
end

login_edit guiCreateEdit((465/x)*sWidth, (550/y)*sHeight, (271/x)*sWidth, (44/y)*sHeight""..getPlayerName(getLocalPlayer()), false)
guiEditSetMaxLength(login_edit50)
haslo_edit guiCreateEdit((465/x)*sWidth, (600/y)*sHeight, (271/x)*sWidth, (44/y)*sHeight""false)
guiEditSetMasked(haslo_edittrue)
guiEditSetMaxLength(haslo_edit50)
login_btn guiCreateButton((250/x)*sWidth, (680/y)*sHeight, (200/x)*sWidth, (50/y)*sHeight"Zaloguj si?"false)
guiSetProperty(login_btn"NormalTextColour""FFAAAAAA")
register_btn guiCreateButton((550/x)*sWidth, (680/y)*sHeight, (200/x)*sWidth, (50/y)*sHeight"Zarejestruj si?"false)
guiSetProperty(register_btn"NormalTextColour""FFAAAAAA")

function renderujemy()
        dxDrawRectangle((0/x)*sWidth, (320/y)*sHeight, (1024/x)*sWidth, (430/y)*sHeighttocolor(000200), false)
        dxDrawImage((250/x)*sWidth, (310/y)*sHeight, (450/x)*sWidth, (300/y)*sHeight":xyz/logo.png"000tocolor(255255255255), true)
        dxDrawLine((0/x)*sWidth, (320/y)*sHeight, (1024/x)*sWidth, (320/y)*sHeighttocolor(25500255), 2true)
        dxDrawLine((0/x)*sWidth, (750/y)*sHeight, (1024/x)*sWidth, (750/y)*sHeighttocolor(25500255), 2true)
        dxDrawText("Nick:", (303/x)*sWidth, (540/y)*sHeight, (502/x)*sWidth, (609/y)*sHeighttocolor(25500255), 1.6"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("Has?o:", (243/x)*sWidth, (590/y)*sHeight, (442/x)*sWidth, (659/y)*sHeighttocolor(25500255), 1.6"bankgothic""left""top"falsefalsetruefalsefalse)
end
addEventHandler("onClientRender"rootrenderujemy)


function init()
triggerServerEvent("destroyPP"rootgetLocalPlayer())
smoothMoveCamera(-1592,756,80, -1592,756,8021401348702140134870150000)
--muzyka playSound(":xyz.mp3")
setSoundVolume(muzyka0.70)
showCursor(true)
showPlayerHudComponent("all"false)
showChat(false)
guiSetInputEnabled(true)
removeEventHandler("onClientRender"getRootElement(), td)
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), init)

function tdInit()
addEventHandler("onClientRender"getRootElement(), td)
end
addEvent("renderTD"true)
addEventHandler("renderTD"getRootElement(), tdInit)

function login(buttonstate)
    if button == "left" and state == "up" then
        local username guiGetText(login_edit)
        local password guiGetText(haslo_edit)
            if string.len(username) < or string.len(password) < 5 then
            showBox("error""D?ugo?? nicku lub has?a jest zbyt kr?tka.")
            return 
            end
        if username and password then
            triggerServerEvent("probaLogowania"getRootElement(), localPlayerusernamepassword)
        else
        showBox("info","Wpisz sw?j login i has?o.")
        end
    end
end

function register(buttonstate)
    if button == "left" and state == "up" then
        local username guiGetText(login_edit)
        local password guiGetText(haslo_edit)
        if string.len(username) < or string.len(password) < 5 then
            showBox("error""D?ugo?? nicku lub has?a jest zbyt kr?tka.")
            return 
        end
        if username and password then
            triggerServerEvent("probaRejestracji"getRootElement(), localPlayerusernamepassword)
        else
            showBox("info","Wpisz sw?j login i has?o.")
        end
    end
end

function wybieralkaInfo()
dxDrawText("#ffffffWybierz sw?j model postaci. Aby przewija? modele - u?yj #FF9900strza?ek, #ffffffaby zatwierdzi? naci?nij klawisz #FF9900ENTER.", (0/1680)*sWidth, (856/1024)*sHeight, (1679/1680)*sWidth, (905/1024)*sHeighttocolor(255255255255), 1.5"default-bold""left""top"falsefalsetruetruefalse)
dxDrawText("Wybierz sw?j model postaci. Aby przewija? modele - u?yj strza?ek, aby zatwierdzi? naci?nij klawisz ENTER.", (2/1680)*sWidth, (856/1024)*sHeight, (1681/1680)*sWidth, (905/1024)*sHeighttocolor(000255), 1.5"default-bold""left""top"falsefalsefalsefalsefalse)
end

function wylaczPanelLogowania()
fadeCamera(false0000)
setTimer(fadeCamera20001true1.0)
removeEventHandler("onClientRender"getRootElement(), renderujemy)
guiSetInputEnabled(false)
destroyElement(login_btn)
destroyElement(register_btn)
destroyElement(login_edit)
destroyElement(haslo_edit)
destroyElement(sm.object1)
destroyElement(sm.object2)
removeCamHandler()
setCameraMatrix(-26621587226, -26621594225skin createPed(StartSkin, -26621594225180)
setPedAnimationskin"DANCING"anims[math.random(1,4)])
setElementFrozen(skintrue)
addEventHandler("onClientRender"rootwybieralkaInfo)
bindKey("arrow_r","down",NextSkin)
bindKey("arrow_l","down",LastSkin)
bindKey("enter""down"zalogowany)
end

function NextSkin()
    if StartSkin == 312 then
        StartSkin = -1
    elseif StartSkin == 2 then
        StartSkin 8
    end
        StartSkin StartSkin 1
        local x,y,getElementPosition(skin)
        setElementModel(skin,StartSkin)
        setPedAnimationskin"DANCING"anims[math.random(1,4)])
        fxAddGlass(x,y,0.5math.random(0255), math.random(0255), math.random(0255), 2550.155)
        setElementPosition(skin, -26621594225)
end
function LastSkin()
    if StartSkin == 0 then
        StartSkin 313
    elseif StartSkin == 9 then
        StartSkin 3
    end
        StartSkin StartSkin 1
        local x,y,getElementPosition(skin)
        setElementModel(skin,StartSkin)
        setPedAnimationskin"DANCING"anims[math.random(1,4)] )
        fxAddGlass(x,y,0.5math.random(0255), math.random(0255), math.random(0255), 2550.155)
        setElementPosition(skin, -26621594225)
end


function fadeOutAudio()
    if not muzyka then return end
    local vol=getSoundVolume(muzyka)
    vol=vol-0.1
    if (vol<0then
    stopSound(muzyka)

    muzyka=nil
    return
    end
    setSoundVolume(muzyka,vol)
    setTimer(fadeOutAudio3001)
end

function zalogowany()
showChat(true)
unbindKey("arrow_r","down",NextSkin)
unbindKey("arrow_l","down",LastSkin)
unbindKey("enter","down",zalogowany)
setElementData(localPlayer"skin"StartSkin)
setCameraTarget(getLocalPlayer())
showPlayerHudComponent("all"true)
showPlayerHudComponent("area_name"false)
showPlayerHudComponent("vehicle_name"false)
showPlayerHudComponent("wanted"false)
showCursor(false)
setTimer(fadeOutAudio10001)
removeEventHandler("onClientRender"rootwybieralkaInfo)
addEventHandler("onClientRender"roottd)
callServerFunction("spawn"localPlayer)
local teraz getRealTime()
local lastonline getRealTime(getElementData(localPlayer"ostanioOnline")) or "To jest twoja pierwsza wizyta"
outputChatBox("Witaj, "..getPlayerName(localPlayer), 0102255)
outputChatBox("Twoja ranga : "..getElementData(localPlayer"Ranga") or "Gracz"0102255outputChatBox("Ostatnio online: "..lastonline.monthday.." "..months[lastonline.month].." ".. 1900 lastonline.year.." o "..("%02d"):format(lastonline.hour)..":"..("%02d"):format(lastonline.minute), 0102255)
outputChatBox("Mi?ej gry, ?yczy administracja.",  0102255)
setElementData(localPlayer"ostatnioOnline"tonumber(teraz.timestamp))
end



addEvent("HideGUI"true)
addEventHandler("HideGUI"rootwylaczPanelLogowania)
addEventHandler("onClientGUIClick"login_btnloginfalse)
addEventHandler("onClientGUIClick"register_btnregisterfalse)



Kod, strona serwera:
function logowanie(playerusernamepassword)
    local account getAccount(usernamepassword)
    if (account ~= falsethen
        if (logIn(playeraccountpassword) == truethen
        setCameraTarget(player,player)
            triggerClientEvent (player"HideGUI"getRootElement())
        else
            triggerClientEvent(player"CreateBox"getRootElement(), "error""Uzupe?nij pole 'login' i 'has?o'.")
    end
end
end

addEvent("probaLogowania"true)
addEventHandler("probaLogowania"getRootElement(), logowanie)

function rejestracja(playerusernamepassword)
    local account getAccount(usernamepassword)
    if (account ~= falsethen
    else
        account addAccount(usernamepassword)
        if (logIn(playeraccountpassword) == truethen
        setCameraTarget(player,player)
        spawn(player)
        triggerClientEvent(player"CreateBox"getRootElement(), "info""Zarejestrowa?e? si? pomy?lnie! Witamy na serwerze xyz.")
            triggerClientEvent(player"HideGUI"getRootElement())
            
        end
    end
end

addEvent("probaRejestracji"true)
addEventHandler("probaRejestracji"getRootElement(), rejestracja)

function resourceStop ()
    setElementData(source"admin"nil)
    setElementData(source"vip"nil)
    setElementData(source"Exp"nil)
    setElementData(source"money"nil)
    setElementData(source"datetime"nil)
    setElementData(source"loggedin"nil)
end
addEventHandler("onResourceStop"getRootElement(), resourceStop)
addEventHandler("onPlayerQuit"getRootElement(), resourceStop)


addEventHandler("onPlayerJoin"root,
function(gracz)
    if isElement(gracz) and getElementType(gracz) == "player" then
    fadeCamera(gracztrue)
    showPlayerHudComponent(gracz"all"true)
    setElementData(gracz"Exp"0)
    setElementData(gracz"Level"0)
    setElementData(gracz"Ranga""Gracz")
    serverDisplayo textCreateDisplay()                            
    textDisplayAddObserver serverDisplaygracz )                      
    serverTexto textCreateTextItem "Witaj na serwerze xyz!\nAktualnie trwa pobieranie zasob?w serwera.\nJeste? ciekaw co dla ciebie oferujemy? Chcesz pozna? atrakcje serwera?\nZosta? z nami i poczekaj :)."0.750.5"high"01532552552551.5"right""bottom"200 )  
    textDisplayAddText serverDisplayserverText )                      
    spawn(gracz)
    end
end)

function destroyTextdispJoin(gracz)
    if isElement(gracz) and getElementType(gracz) == "player" then
    if serverDisplayo then
    textDisplayRemoveObserver(serverDisplayogracz)
    end
end
end
addEvent("destroyPP"true)
addEventHandler("destroyPP"rootdestroyTextdispJoin)
function logoutAll ()
    local players getElementsByType "player" ) 
        for kplayer in ipairs players ) do
            account getPlayerAccount player )
                if ( not isGuestAccount account ) ) then 
                    logOut player )
                end
        end
end

addEventHandler "onResourceStart"getResourceRootElement(getThisResource()), logoutAll )





Przywo?uje: http://gtao.pl/teleport-w-gui-vt83378,15.htm

Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-24, 22:00


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

"zuraw13" napisał/a:

[2014-03-24 19] WARNING: [gameplay]\xyz\login\login_s.lua:20: Access denied @ 'addAccount'


Dodaj skrypt do grupy Admin w ACL.

Kod:

resource.nazwa_skryptu


2. Spr?buj tak:

triggerServerEvent("probaLogowania"localPlayerusernamepassword)


Postaw piwo autorowi tego posta
 

 
Tagi: nie :: działa :: opcja :: rejestracji :: panelu :: logowania
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