Wysłany: 2016-04-25, 14:52
amama5
Wiek: 37 Na forum: 4269 dni Posty: 57
Nick w MP: kamiloooswas
Piwa : 2
Witam, jak doda? do logowania ogrpg v2 Funkcj? , ?e po rejerstracji wywala z serwera pod pretekstem wej?cia jeszcze raz?
--[[
Resource : OURGame
Developers : Split < split . programista @ gmail . com >
Copyright < split . programista @ gmail . com > 2015 - 2016
You have no right to use this code without my permission .
@ updates
- Dodano porawk ? przy sprawdzaniu loginu
]]
addEvent ( 'onServerPlayerLogin' , true )
addEventHandler ( 'onServerPlayerLogin' , root , function( login , pass )
local result = exports [ 'og-db' ]: getRekord ( 'SELECT * FROM og_users WHERE login=? AND pass=MD5(?)' , login , pass )
if result [ 1 ] and result [ 1 ]. id then
source : setName ( result [ 1 ]. login )
source : setData ( 'player:uid' , result [ 1 ]. id )
local organizations = exports [ 'og-db' ]: getRekord ( 'SELECT * FROM og_orgplayers WHERE uid=?' , result [ 1 ]. id )
if organizations [ 1 ] and organizations [ 1 ]. id then
local organizationsPlayer = exports [ 'og-db' ]: getRekord ( 'SELECT * FROM og_organizations WHERE id=?' , organizations [ 1 ]. id )
if organizationsPlayer [ 1 ] and organizationsPlayer [ 1 ]. Shortcut then
if organizationsPlayer [ 1 ]. Shortcut then
source : setData ( 'organization:ShroutName' , organizationsPlayer [ 1 ]. Shortcut )
end
end
end
triggerClientEvent ( source , 'onClientLoginRequestResponse' , resourceRoot , { success = true , komunikat = '' })
else
triggerClientEvent ( source , 'onClientLoginRequestResponse' , resourceRoot , { success = false , komunikat = 'Podane dane s? nieprawid?owe' })
end
end )
addEvent ( 'onServerPlayerRegister' , true )
addEventHandler ( 'onServerPlayerRegister' , root , function( login , pass )
local result = exports [ 'og-db' ]: getRekord ( 'SELECT * FROM og_users WHERE login=?' , login )
if result [ 1 ] and result [ 1 ]. id then
triggerClientEvent ( source , 'onClientLoginRequestResponse' , resourceRoot , { success = false , komunikat = 'Podany login ju? istnieje' })
else
local result = exports [ 'og-db' ]: getRekord ( 'SELECT * FROM og_users WHERE serial=?' , getPlayerSerial ( source ))
if result [ 555 ] and result [ 555 ]. id then
triggerClientEvent ( source , 'onClientLoginRequestResponse' , resourceRoot , { success = false , komunikat = 'Konto na tym serialu ju? istnieje' })
else
local result = exports [ 'og-db' ]: setRekord ( 'INSERT INTO og_users (login, pass, serial) VALUES (?,MD5(?),?)' , login , pass , getPlayerSerial ( source ))
if result then
triggerClientEvent ( source , 'onClientLoginRequestResponse' , resourceRoot , { success = true , komunikat = 'Pomy?lnie za?o?ono konto' })
else
triggerClientEvent ( source , 'onClientLoginRequestResponse' , resourceRoot , { success = false , komunikat = 'Nie uda?o si? stworzy? konta\nPowiadom administratora' })
end
end
end
end )
Za pomoc i
Wysłany: 2016-04-25, 14:54
Emm
***** ***
Wiek: 31 Na forum: 3404 dni Posty: 3191
Nick w MP: Emm
Piwa : 6115
Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Więcej informacji znajdziesz w Wikipedii MTA: kickPlayer
Podpis
Użytkownik : 20.10.2015r
GTAO Member : 06.03.2016r
Support-Team : 20.01.2016r
Moderator : 30.03.2016r
Mod-Team : 08.10.2016r
Vice Admin : 04.05.2018r
Administrator : 03.05.2022r
[you]
! Koniecznie zapoznaj się z
regulaminem forum .
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również
regulaminy działów , w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez
Administrację , przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w
tym dziale .
Najważniejsze informacje od
Administracji możesz przeczytać
tutaj oraz
tutaj .
Wysłany: 2016-04-25, 14:58
amama5
Wiek: 37 Na forum: 4269 dni Posty: 57
Nick w MP: kamiloooswas
Piwa : 2
Emm ,
a jak to by wygl?da?o w kodzie bo tu jest komenda /kick a ja chce automatycznie
Sorry ale nie jestem za dobry w te klocki
Tagi: logowanie :: ogrpg
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: