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

Wysłany: 2016-11-19, 01:39


macieq.

Grafik






Wiek: 28
Na forum: 3513 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

Cze??,
Jak wida? na ss nie dzia?a mi login i nie wiem co to jest, wszystko jest podpi?te


[ Dodano: 2016-11-19, 01:40 ]
addEvent("onClientSendRegisterDataToServer"true)
addEventHandler("onClientSendRegisterDataToServer"getRootElement(), dodaj)
addEvent("logging:checkAccount"true)
addEventHandler("logging:checkAccount"resourceRoot, function(login,pass)
    local result=exports["og-db"]:getRekord("SELECT * FROM og_users WHERE login=?"login)
    if result and #result > 0 then
        if result[1].login == login and result[1].pass == md5(passthen
            setPlayerName(clientlogin)
            setElementData(client"player:uid"result[1].id)
            triggerClientEvent(client"logging:result"resourceRoottruenil)
        else
            triggerClientEvent(client"logging:result"resourceRootfalse"Podane dane s? nieprawid?owe.")
        end
    else
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login nie istnieje w bazie.")
    end
end)
addEvent("onClientSendRegisterDataToServer"true)
addEventHandler("onClientSendRegisterDataToServer"getRootElement(), dodaj)
addEvent("logging:newAccount"true)
addEventHandler("logging:newAccount"resourceRoot, function(login,pass)
    local result=exports["og-db"]:getRekord("SELECT * FROM og_users WHERE login=?"login)
    if result and #result > 0 then
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login ju? istnieje w bazie.")
    else
        local query=exports["og-db"]:setRekord("INSERT INTO og_users (login,pass) VALUES (?,?)"loginmd5(pass))
        if query then
            triggerClientEvent(client"logging:result"resourceRootfalse"Pomy?lnie zalogowa?e?(a?) si?")
        end
    end
end)

addEvent("core:spawnPlayer"true)
addEventHandler("core:spawnPlayer"resourceRoot, function()
local pozycja getElementData (source"player:spawn")
spawnPlayer (sourcepozycja,90.0,0)
fadeCamera(sourcefalse)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-19, 17:06


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

czy w mecie og-db jest:

<export function="getRekord" type="server"/>
<export function="setRekord" type="server"/>

i czy strony si? zgadzaj??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-19, 23:21


macieq.

Grafik






Wiek: 28
Na forum: 3513 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50


--[[
    ResourceOURGame v2
    DevelopersSplit <split.programista@gmail.com>
    Copyright <split.programista@gmail.com2015-2016
    You have no right to use this code without my permission.

    @update 25/03/2015
    Dodano Po??czenie MYSQL.
]]

-- Settings
SQL_HANDLER=nil
SQL_HOST="****"
SQL_DBNAME="****"
SQL_DBUSER="****"
SQL_DBPASS="****"

-- Functions
local function onConnect()
    SQL_HANDLER=dbConnect("mysql""dbname="..SQL_DBNAME..";host="..SQL_HOST..""SQL_DBUSERSQL_DBPASS"share=1");
    if SQL_HANDLER then
        outputDebugString("<og-db> Connecting to MYSQL...");
    else
        outputDebugString("<og-db> No Connecting to MYSQL...");
    end
end

function setRekord(...)
    if not {...} then return end
    local query=dbExec(SQL_HANDLER, ...)
    return query
end

function dbSet(...)
    if not {...} then return end
    local query=dbExec(SQL_HANDLER, ...)
    return query
end

function getRekord(...)
    if not {...} then return end
    local query=dbQuery(SQL_HANDLER, ...)
    local result=dbPoll(query, -1)
    return result
end


function dbGet(...)
    if not {...} then return end
    local query=dbQuery(SQL_HANDLER, ...)
    local result=dbPoll(query, -1)
    return result
end


function zapytanie(...) -- zostaw to lepiej
    local h=dbQuery(SQL_HANDLER,...)
    local result,numrows=dbPoll(h,-1)
    return numrows
end

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


[ Dodano: 2016-11-19, 23:22 ]
Nie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-20, 00:05


nanKy







Wiek: 22
Na forum: 3865 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

macieq.,
dodaj to do mety w og-db
<export function="getRekord" type="server"/>
<export function="setRekord" type="server"/>

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-20, 12:30


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

macieq., chodzi?o o plik meta.xml

Postaw piwo autorowi tego posta
 

 
Tagi: login :: effect
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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