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

Wysłany: 2016-08-29, 23:28


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

Kod:

--[[
Resource: OURGame v2
Developers: Split <split.programista@gmail.com>
You have no right to use this code without my permission.
(c) 2015 <split.programista@gmail.com>. All rights reserved.
]]
function sprawdzorganizacje(plr)
local x = exports['ogrpg-db']:dbGet("SELECT spawn from ogrpg_organization_list join ogrpg_organizations on ogrpg_organizations.code = ogrpg_organization_list.id WHERE uid=? and not(spawn=?)",getElementData(plr,"player:uid"),"0,0,0")
if x and #x > 0 then
local t = split(x[1].spawn, ",")
return
end
return false
end

addEvent("logging:checkAccount", true)
addEventHandler("logging:checkAccount", resourceRoot, function(login,pass)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?", login)
if result and #result > 0 then
if result[1].login == login and result[1].pass == md5(pass) then
local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Ryjek"),login)
triggerClientEvent(client, "logging:result", resourceRoot, false, "Zaaktualizowano twoj profil! Zaloguj sie ponownie!.")
return
end
if result[1].login == login and result[1].pass == teaEncode(pass,"Ryjek") then
for k, v in ipairs(getElementsByType("player")) do
if getElementData(v, "player:uid") == result[1].id then return end
end
setPlayerName(client, login)
setElementData(client, "player:uid", result[1].id)
triggerClientEvent(client, "logging:result", resourceRoot, true, nil)
triggerEvent("SprawdzDom",root,client)
setElementData(client,"player:organization:spawn",sprawdzorganizacje(client))

if result[1].register_serial == false then
local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET register_serial=? WHERE login=?",getPlayerSerial(client),login)
end
local logs=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_logs_login (name,serial,data) VALUES (?,?,NOW())", string.format(login.."("..result[1].id..")"),getPlayerSerial(client))
else
triggerClientEvent(client, "logging:result", resourceRoot, false, "Podane dane s? nieprawid?owe.")
end
else
triggerClientEvent(client, "logging:result", resourceRoot, false, "Podany login nie istnieje w bazie.")
end
end)

addEvent("logging:newAccount", true)
addEventHandler("logging:newAccount", resourceRoot, function(login,pass)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?", login)
if result and #result > 0 then
triggerClientEvent(client, "logging:result", resourceRoot, false, "Podany login ju? istnieje w bazie.")
else
local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass,register_serial) VALUES (?,?,?)", login, teaEncode(pass,"Ryjek"),getPlayerSerial(client))
if query then
triggerClientEvent(client, "logging:result", resourceRoot, false, "Pomy?lnie zalogowa?e?(a?) si?")
end
end
end)

mam te? kod ale nie wiem gdzie doda?
Kod:

local result = exports['ogrpg-db']:dbGet('select * from ogrpg_bans where uid=?', getElementData(source, 'player:uid'))

Kod:

if result and #result > 0 then

Kod:

kickPlayer(source, "Serwer", "Jeste? zbanowany")

Kod:

end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-30, 15:01


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Opisz mo?e co ci nie dzia?a? Nie jeste?my jasnowidzami.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-30, 22:51


mis14







Wiek: 25
Na forum: 3924 dni
Posty: 185

Piwa: 73

Respekt: -149

w mysQel dodaje bana ale nie sprawdza

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: wiem :: jak :: naprawić :: bany
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