Wysłany: 2018-11-15, 19:56
CrimeProject
Wiek: 24 Na forum: 2760 dni Posty: 16
Nick w MP: Crime-Project
Piwa : 16
Cze??, mam problem poniewa?, m?czy?em si? wczoraj z (licznikiem do wypisu ze szpitala), licznik zlokalizowa?em i wy??czy?em, tylko teraz jak chc? wej?? do szpitala to mi pisze "Nie mo?esz opu?ci? szpitala przed wypisem".
Dodam, ?e jak dodam sobie rang? i wpisuje /wypisz swojnick to pisze ze nie mam bw...
/bwoff tez probowalem. Pomoze ktos ?
Za pomoc jakos sie odwdziecze Service#2274
Service#2274
Wysłany: 2018-11-15, 20:22
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
w panelu logowania (strona serwer) usu? funkcj? autoryzujSzpital czy co? takiego po zalogowaniu na konto i powinno dzia?a?
Wysłany: 2018-11-15, 20:38
CrimeProject
Wiek: 24 Na forum: 2760 dni Posty: 16
Nick w MP: Crime-Project
Piwa : 16
"Kalizman" napisał/a :w panelu logowania (strona serwer) usu? funkcj? autoryzujSzpital czy co? takiego po zalogowaniu na konto i powinno dzia?a?
Pomo?esz? Stawiam Piwko i Respekcik.
Wstawiam tutaj kod po stronie serwera.
Kod: local unlock=(
function(plr)
triggerClientEvent(plr,"evc",resourceRoot,"unlock")
end
)
local max_proby=10
setMinuteDuration(60000) -- 1 minuta == 60 realnych sekund
local forcePlayerName=(
function(plr,name)
if (getPlayerName(plr)==name) then
return true
end
return setPlayerName(plr,name)
end
)
function zbanujSerial(serial, nick)
exports.DB:zapytanie("INSERT INTO es_kary_bany SET dbid=0,serial=?,nick=?,od=NOW(),do_d=(NOW() + INTERVAL 7 DAY),powod=?,nadal=?", serial, nick, "Pr?ba w?amania na konto poprzez odzyskanie konta", "konsola")
exports["es-logi"]:outputUcho("BAN ODZYSKANIE: nick: "..nick.."; serial: "..serial.."; IP: "..getPlayerIP(getPlayerFromName(nick)))
kickPlayer(getPlayerFromName(nick), "Zosta?e? Zbanowany")
end
addEvent("ev",true)
addEventHandler("ev",resourceRoot,
function(ev,arg1,arg2)
if (ev=="rejestracja") or (ev=="logowanie") or (ev=="odzyskiwanie") then
local login=arg1
local haslo=arg2
if (string.len(login)<1) or (string.len(haslo)<1) then
triggerClientEvent(client,"evc",resourceRoot,"komunikat","Uzupe?nij wszystkie pola.")
unlock(client)
return
end
if (ev=="rejestracja") then
if (string.len(haslo)<6) then
triggerClientEvent(client,"evc",resourceRoot,"komunikat","Has?o musi zawiera? przynajmniej 6 znak?w.")
unlock(client)
return
end
local clear_login=string.gsub(login, "%w", "")
local clear_haslo=string.gsub(haslo, "%w", "")
if (string.len(clear_login)>0) or (string.len(clear_haslo)>0) then
triggerClientEvent(client,"evc",resourceRoot,"komunikat","Login i has?o nie mog? zawiera? znak?w specjalnych.")
unlock(client)
return
end
local ig=getPlayerFromName(login)
if ig and ig~=client then
triggerClientEvent(client,"evc",resourceRoot,"komunikat","Podany nick jest ju? zaj?ty. Wybierz inny.")
unlock(client)
return
end
-- sprawdzamy to samo ale w bazie danych
if exports.DB:pobierzWyniki("SELECT id FROM es_gracze WHERE nick=? LIMIT 1", login) then
triggerClientEvent(client,"evc",resourceRoot,"komunikat","Podany nick jest ju? zaj?ty. Wybierz inny.")
unlock(client)
return
end
-- sprwadzamy czy w ogole nick jest poprawny
if not forcePlayerName(client,login) then
triggerClientEvent(client,"evc",resourceRoot,"komunikat","Login posiada niedozwolone znaki.")
unlock(client)
return
end
local kod = math.random(100000,999999)
exports.DB:zapytanie("INSERT INTO es_gracze SET nick=?,haslo=SHA1(CONCAT(LOWER(?),'cbF0NdGo',?)),kod=?,skin=?,zarejestrowany=NOW()", login, string.format("%s%s",login,"89dXhg5dOY"),haslo, kod, 0)
--TO Z DODATKIEM PREMIUM--exports.DB:zapytanie("INSERT INTO es_gracze SET nick=?,haslo=SHA1(CONCAT(LOWER(?),'cbF0NdGo',?)),skin=?,zarejestrowany=NOW(),waznosc_premium_rozszerzony=?", login, string.format("%s%s",login,"89dXhg5dOY"),haslo, 0, "2016-12-04 16:38:56")
exports["es-logi"]:outputUcho("REJESTRACJA: login: "..login.."; serial: "..getPlayerSerial(client).."; IP: "..getPlayerIP(client))
triggerClientEvent(client,"evc",resourceRoot,"komunikat","Rejestracja przebieg?a pomy?lnie.",true)
exports["es-komunikaty"]:komunikat("Tw?j kod bezpiecze?stwa to: "..kod..". Prosimy o zapisanie go, bez tego kody nie odzyskasz konta przy utracie has?a! Pami?taj aby nie podawa? nikomu tego kodu!",client)
unlock(client)
elseif (ev=="odzyskiwanie") then
local login=arg1
local kod=arg2
local proby=getElementData(client, "proby_kod") or 0
local autoryzacja=exports.DB:pobierzWyniki("SELECT nick,kod,ranga FROM es_gracze WHERE nick=? LIMIT 1", login)
if not autoryzacja then
exports["es-komunikaty"]:komunikat("W bazie nie znaleziono konta o loginie: "..login..".",client)
unlock(client)
return
end
if autoryzacja.ranga ~= 0 then
exports["es-komunikaty"]:komunikat("Konto o loginie: "..login.." jest kontem administracyjnym i nie mo?esz odzyska? has?a, zg?o? si? do grona Guardian lub Developer.",client)
unlock(client)
return
end
if proby==max_proby then
zbanujSerial(getPlayerSerial(client), getPlayerName(client))
end
if not autoryzacja.kod then
exports["es-komunikaty"]:komunikat("Na tym koncie nie wygenerowano kodu bezpiecze?stwa.",client)
unlock(client)
return
end
if autoryzacja.kod ~= tonumber(kod) then
exports["es-komunikaty"]:komunikat("Kod bezpiecze?stwa jest b??dny.",client)
setElementData(client, "proby_kod", proby+1)
local proby=getElementData(client, "proby_kod")
exports["es-komunikaty"]:komunikat("Nieudane pr?by: "..proby.."/"..max_proby..".",client)
unlock(client)
return
end
triggerClientEvent(client, "evc", resourceRoot, "odzyskaj_sukces")
local nowe_haslo = math.random(100000,999999)
exports["es-komunikaty"]:komunikat("Kod poprawny nowe has?o to: "..nowe_haslo..".",client)
exports.DB:zapytanie("UPDATE es_gracze SET haslo=SHA1(CONCAT(LOWER(?),'cbF0NdGo',?)) WHERE nick=?", string.format("%s%s",login,"89dXhg5dOY"),nowe_haslo, login)
exports["es-logi"]:outputUcho("ODZYSKANIE KONTA: login: "..login.."; serial: "..getPlayerSerial(client).."; IP: "..getPlayerIP(client))
unlock(client)
elseif (ev=="logowanie") then
if getElementData(client, "dbid") then
unlock(client)
return
end
local autoryzacja=exports.DB:pobierzWyniki("SELECT id,nick,zarejestrowany,minuty,skin,ranga,ranga_dodatkowa,kasa,karta_bank,plec,frakcja,podfrakcja,wydzial,jail,poszukiwany,glod,czas_odsiadki,nazwa_celi,data_uplywu,data_uplywu>NOW() konto_aktywne,posiadanie_telefonu,prawko_teoria,prawko_praktyka_I,prawko_praktyka_II,prawko_A_teoria,prawko_praktyka_I_A,prawko_praktyka_II_A,prawko_CE_teoria,prawko_praktyka_I_CE,prawko_praktyka_II_CE,zbanowany,zbanowany<NOW() ban_dezaktywowany,waznosc_premium_podstawowy,waznosc_premium_podstawowy>NOW() premium_podstawowy_aktywne,waznosc_premium_rozszerzony,waznosc_premium_rozszerzony>NOW() premium_rozszerzony_aktywne,pozbawiony_prawka,pozbawiony_prawka<NOW() prawko_oddane,ilosc_pojazdow,sloty_pojazdow,punkty_karne,dzialalnosc,mandaty,szpital,organizacja,mute,mute<NOW() mute_oddane FROM es_gracze WHERE nick=? AND haslo=SHA1(CONCAT(LOWER(?),'cbF0NdGo',?)) LIMIT 1", login, string.format("%s%s",login,"89dXhg5dOY"),haslo)
if not autoryzacja then
if exports.DB:pobierzWyniki("SELECT id FROM es_gracze WHERE nick=? LIMIT 1", login) then
triggerClientEvent(client, "evc", resourceRoot, "komunikat", "B??dny login lub has?o.")
exports["es-logi"]:outputUcho("NIEUDANE LOGOWANIE: login: "..login.."; nick: "..getPlayerName(client).."; serial: "..getPlayerSerial(client).."; IP: "..getPlayerIP(client))
unlock(client)
return
else
triggerClientEvent(client, "evc", resourceRoot, "komunikat", "Konto o takim nicku nie istnieje.")
unlock(client)
return
end
end
if not forcePlayerName(client, autoryzacja.nick) then
kickPlayer(client, "Nie udalo sie zmienic Twojego nicku - zglos to administracji na forum.")
return
end
exports["es-logi"]:outputUcho("LOGOWANIE: login: "..login.."; serial: "..getPlayerSerial(client).."; IP: "..getPlayerIP(client))
exports.DB:zapytanie("UPDATE es_gracze SET ostatni_serial=? WHERE id=?", getPlayerSerial(client), autoryzacja.id)
autoryzujRanga(client, autoryzacja.id) -- autoryzacja rangi
autoryzujDzialalnosc(client, autoryzacja.id) -- autoryzacja dzia?alno?ci
autoryzujFrakcje(client, autoryzacja.id) -- autoryzacja frakcji, podfrakcji, wydzia??w
autoryzujPremium(client, autoryzacja.id) -- autoryzacja premium
autoryzujJailSzpital(client, autoryzacja.id) -- autoryzacja wi?zienia, szpitala, statusu poszukiwanego
autoryzujTelBank(client, autoryzacja.id) -- autoryzacja telefonu, wa?no?ci konta, karty bankowej
autoryzujOrganizacja(client, autoryzacja.id) -- autoryzacja organizacji
autoryzujPrawko(client, autoryzacja.id) -- autoryzacja prawka
autoryzujMute(client, autoryzacja.id) -- autoryzacja mute
autoryzujBana(client, autoryzacja.id, login) -- autoryzacja bana
if autoryzacja.id == 18702 or autoryzacja.id == 12613 or autoryzacja.id == 1176 then
setElementData(client, "ranga:dev", true)
exports["es-komunikaty"]:komunikat("Posiadasz rang?: Programista.",client)
end
if not isElement(client) then return end
local level_magazyn=exports.DB:pobierzWyniki("SELECT level FROM es_praca_magazyn WHERE id=? LIMIT 1", autoryzacja.id)
if level_magazyn then
setElementData(client,"magazyn:level",level_magazyn.level)
end
local niepowtarzaj=string.format("%s%s",autoryzacja.id,getPlayerSerial(client))
exports.DB:zapytanie("INSERT IGNORE INTO es_powiazania SET id=?,serial=?,niepowtarzaj=?", autoryzacja.id,getPlayerSerial(client),niepowtarzaj)
local sloty_na_pojazdy=autoryzacja.sloty_pojazdow
if ((sloty_na_pojazdy-1)<=0) then
sloty_na_pojazdy=1
end
setElementData(client, "skin", autoryzacja.skin or 0)
setElementData(client, "minuty", autoryzacja.minuty or 0)
setElementData(client, "dbid", autoryzacja.id)
setElementData(client, "plec", autoryzacja.plec)
setElementData(client, "zarejestrowany", autoryzacja.zarejestrowany)
setElementData(client, "ilosc_pojazdow", autoryzacja.ilosc_pojazdow)
setElementData(client, "sloty_pojazdow", sloty_na_pojazdy)
setElementData(client, "punkty_karne", autoryzacja.punkty_karne)
setElementData(client, "mandaty", autoryzacja.mandaty)
setElementData(client, "jedzenie", autoryzacja.glod)
setPlayerMoney(client, autoryzacja.kasa)
triggerClientEvent(client, "evc", resourceRoot, "zalogowano")
setPlayerNametagShowing(client, false)
--fadeCamera(client, false)
local gracz=client
--setTimer(function()
exports["es-spawnowanie"]:pokazPanel(gracz)
if (autoryzacja.ranga>0) then
exports["es-logi"]:odpalanie_ucha(gracz)
end
outputChatBox("Witaj na EmStories! Regulamin i inne wa?ne informacje uzyskasz w przewodniku pod klawiszem F1.", gracz)
--fadeCamera(gracz, true)
--end, 1000, 1)
end
end
end
)
addEventHandler("onPlayerQuit",root,
function()
exports["es-logi"]:outputUcho("QUIT: "..tostring(getPlayerName(source)).." DBID: "..tostring(getElementData(source,"dbid")).." opuszcza serwer.")
end
)
function autoryzujOrganizacja(client, id)
if not isElement(client) then return end
local autoryzacja=exports.DB:pobierzWyniki("SELECT organizacja FROM es_gracze WHERE id=?",id)
if autoryzacja.organizacja then
setElementData(client,"organizacja",autoryzacja.organizacja)
local org=exports.DB:pobierzWyniki("SELECT ranga FROM org_"..autoryzacja.organizacja.." WHERE dbid=? LIMIT 1",id)
if org then
setElementData(client,"organizacja:ranga",org.ranga)
end
end
end
function autoryzujTelBank(client, id)
if not isElement(client) then return end
local autoryzacja=exports.DB:pobierzWyniki("SELECT posiadanie_telefonu, karta_bank, data_uplywu, data_uplywu>NOW() konto_aktywne FROM es_gracze WHERE id=?",id)
if autoryzacja.posiadanie_telefonu then
setElementData(client, "telefon", autoryzacja.posiadanie_telefonu)
end
if autoryzacja.karta_bank=="tak" then
setElementData(client,"bank:karta",true)
end
if autoryzacja.data_uplywu then
if (autoryzacja.konto_aktywne==1) then
setElementData(client, "telefony:waznosckonta", autoryzacja.data_uplywu)
elseif (autoryzacja.konto_aktywne==0) then
exports.DB:zapytanie("UPDATE es_gracze SET data_uplywu=? WHERE id=?", nil, id)
setElementData(client, "telefony:waznosckonta", "konto zablokowane\nkup do?adowanie")
end
else
setElementData(client, "telefony:waznosckonta", "konto zablokowane\nkup do?adowanie")
end
end
function autoryzujJailSzpital(client, id)
if not isElement(client) then return end
local autoryzacja=exports.DB:pobierzWyniki("SELECT poszukiwany, jail, szpital, czas_odsiadki, powod_jail, nazwa_celi FROM es_gracze WHERE id=?",id)
if autoryzacja.poszukiwany then
setElementData(client, "Policja:poszukiwany", autoryzacja.poszukiwany)
end
if autoryzacja.jail then
setElementData(client, "jail", autoryzacja.jail)
setElementData(client, "jail:czas", autoryzacja.czas_odsiadki)
setElementData(client, "powod:jail", autoryzacja.powod_jail or "Brak")
setElementData(client, "jail:cela", autoryzacja.nazwa_celi or "sf1")
setElementData(client, "poszukiwany", 1)
end
if autoryzacja.szpital then
setElementData(client,"PR:pacjent",true)
end
end
function autoryzujRanga(client, id)
if not isElement(client) then return end
local autoryzacja=exports.DB:pobierzWyniki("SELECT ranga, ranga_dodatkowa FROM es_gracze WHERE id=?",id)
if autoryzacja.ranga and autoryzacja.ranga>0 and autoryzacja.ranga<6 then
if autoryzacja.ranga == 4 then
ranga="Developer"
elseif autoryzacja.ranga == 3 then
ranga="Guardian"
elseif autoryzacja.ranga == 2 then
ranga="Administrator"
elseif autoryzacja.ranga == 1 then
ranga="Supporter"
end
setElementData(client, "ranga", autoryzacja.ranga)
exports["es-komunikaty"]:komunikat("Posiadasz rang?: "..ranga..".",client)
end
if autoryzacja.ranga_dodatkowa and autoryzacja.ranga_dodatkowa < 4 then
if autoryzacja.ranga_dodatkowa == 3 then
ranga_dod="Grafik"
elseif autoryzacja.ranga_dodatkowa == 2 then
ranga_dod="Modeler"
elseif autoryzacja.ranga_dodatkowa == 1 then
ranga_dod="Mapper"
end
setElementData(client, "ranga_dodatkowa", autoryzacja.ranga_dodatkowa)
exports["es-komunikaty"]:komunikat("Posiadasz rang? dodatkow?: "..ranga_dod..".",client)
end
end
function autoryzujPremium(client, id)
if not isElement(client) then return end
local autoryzacja=exports.DB:pobierzWyniki("SELECT waznosc_premium_podstawowy,waznosc_premium_podstawowy>NOW() premium_podstawowy_aktywne,waznosc_premium_rozszerzony,waznosc_premium_rozszerzony>NOW() premium_rozszerzony_aktywne FROM es_gracze WHERE id=?",id)
if autoryzacja.waznosc_premium_podstawowy then
if (autoryzacja.premium_podstawowy_aktywne==0) then
exports.DB:zapytanie("UPDATE es_gracze SET waznosc_premium_podstawowy=? WHERE id=?", nil, id)
exports["es-komunikaty"]:komunikat("Konto PREMIUM z pakietem podstawowym w?a?nie Ci si? sko?czy?o. Kup pod /premium.", client)
elseif (autoryzacja.premium_podstawowy_aktywne==1) then
setElementData(client, "premium:podstawowy", true)
exports["es-komunikaty"]:komunikat("Wa?no?? PREMIUM pakiet podstawowy trwa do: "..autoryzacja.waznosc_premium_podstawowy..".",client)
end
end
if autoryzacja.waznosc_premium_rozszerzony then
if (autoryzacja.premium_rozszerzony_aktywne==0) then
exports.DB:zapytanie("UPDATE es_gracze SET waznosc_premium_rozszerzony=? WHERE id=?", nil, id)
exports["es-komunikaty"]:komunikat("Konto PREMIUM z pakietem rozszerzonym w?a?nie Ci si? sko?czy?o. Kup pod /premium.", client)
elseif (autoryzacja.premium_rozszerzony_aktywne==1) then
setElementData(client, "premium:rozszerzony", true)
exports["es-komunikaty"]:komunikat("Wa?no?? PREMIUM pakiet rozszerzony trwa do: "..autoryzacja.waznosc_premium_rozszerzony..".",client)
end
end
if getElementData(client, "premium:podstawowy") or getElementData(client, "premium:rozszerzony") or ((getElementData(client, "ranga") or 0)>0) then
bindKey(client, "p", "down", "chatbox", "premiumChat")
end
end
function autoryzujFrakcje(client, id)
if not isElement(client) then return end
local autoryzacja=exports.DB:pobierzWyniki("SELECT frakcja, podfrakcja, wydzial, dzialalnosc FROM es_gracze WHERE id=?",id)
if (autoryzacja.frakcja~="") then
setElementData(client, "frakcja", autoryzacja.frakcja)
local pobieranie_rangi=exports.DB:pobierzWyniki("SELECT ranga,stopien,zawieszony FROM es_frakcja_"..getElementData(client, "frakcja").." WHERE dbid=? LIMIT 1", id)
if pobieranie_rangi then
setElementData(client, getElementData(client, "frakcja")..":ranga", pobieranie_rangi.ranga)
exports["es-komunikaty"]:komunikat("Jeste? zatrudniony/a we frakcji: "..getElementData(client, "frakcja").." jako "..pobieranie_rangi.stopien..".", client)
if pobieranie_rangi.zawieszony then
setElementData(client, "zawieszony", autoryzacja.frakcja)
exports["es-komunikaty"]:komunikat("Jeste? zawieszony/a we frakcji: "..getElementData(client, "frakcja")..".", client)
end
else
exports.DB:zapytanie("UPDATE es_gracze SET frakcja=? WHERE id=?", "", id)
setElementData(client, "frakcja", false)
end
end
if (autoryzacja.podfrakcja~="") then
setElementData(client, "podfrakcja", autoryzacja.podfrakcja)
local pobieranie_rangi=exports.DB:pobierzWyniki("SELECT ranga,stopien FROM es_frakcja_"..getElementData(client, "podfrakcja").." WHERE dbid=? LIMIT 1", id)
if pobieranie_rangi then
setElementData(client, getElementData(client, "podfrakcja")..":ranga", pobieranie_rangi.ranga)
exports["es-komunikaty"]:komunikat("Jeste? zatrudniony/a w podfrakcji: "..getElementData(client, "podfrakcja").." jako "..pobieranie_rangi.stopien..".", client)
if pobieranie_rangi.zawieszony then
setElementData(client, "zawieszony", autoryzacja.podfrakcja)
exports["es-komunikaty"]:komunikat("Jeste? zawieszony/a we podfrakcji: "..getElementData(client, "podfrakcja")..".", client)
end
else
exports.DB:zapytanie("UPDATE es_gracze SET podfrakcja=? WHERE id=?", "", id)
setElementData(client, "podfrakcja", false)
end
end
if (autoryzacja.wydzial~="") then
setElementData(client, "wydzial", autoryzacja.wydzial)
local pobieranie_rangi=exports.DB:pobierzWyniki("SELECT ranga,stopien FROM es_frakcja_"..getElementData(client, "wydzial").." WHERE dbid=? LIMIT 1", id)
if pobieranie_rangi then
setElementData(client, getElementData(client, "wydzial")..":ranga", pobieranie_rangi.ranga)
exports["es-komunikaty"]:komunikat("Jeste? zatrudniony/a w wydziale: "..getElementData(client, "wydzial").." jako "..pobieranie_rangi.stopien..".", client)
if pobieranie_rangi.zawieszony then
setElementData(client, "zawieszony", autoryzacja.wydzial)
exports["es-komunikaty"]:komunikat("Jeste? zawieszony/a we wydziale: "..getElementData(client, "wydzial")..".", client)
end
else
exports.DB:zapytanie("UPDATE es_gracze SET wydzial=? WHERE id=?", "", id)
setElementData(client, "wydzial", false)
end
end
if autoryzacja.dzialalnosc then
setElementData(client, "dzialalnosc", autoryzacja.dzialalnosc)
local pobieranie_rangi=exports.DB:pobierzWyniki("SELECT ranga,stopien FROM es_dzialalnosc_"..getElementData(client, "dzialalnosc").." WHERE id=? LIMIT 1", id)
if pobieranie_rangi then
setElementData(client, getElementData(client, "dzialalnosc")..":ranga", pobieranie_rangi.ranga)
exports["es-komunikaty"]:komunikat("Jeste? zatrudniony/a w dzialalnosci: "..getElementData(client, "dzialalnosc").." jako "..pobieranie_rangi.stopien..".", client)
if pobieranie_rangi.zawieszony then
setElementData(client, "zawieszony", autoryzacja.dzialalnosc)
exports["es-komunikaty"]:komunikat("Jeste? zawieszony/a we dzialanosci: "..getElementData(client, "dzialalnosc")..".", client)
end
else
exports.DB:zapytanie("UPDATE es_gracze SET wydzial=? WHERE id=?", "", id)
setElementData(client, "wydzial", false)
end
end
end
function autoryzujDzialalnosc(client, id)
if not isElement(client) then return end
local dane=exports.DB:pobierzWyniki("SELECT ranga FROM es_grupa_pozorantow WHERE dbid=? LIMIT 1",id)
if dane then
setElementData(client,"dzialalnosc","pozoranci")
if dane.ranga>=12 then
exports["es-komunikaty"]:komunikat("Nale?ysz do Zarz?du Grupy Pozorant?w.",client)
setElementData(client,"pozoranci:zarzad",true)
end
end
end
function autoryzujMute(client, id)
if not isElement(client) then return end
local wyciszenie=exports.DB:pobierzWyniki("SELECT powod,nadal,serial,do_d,do_d<NOW() wyciszony FROM es_kary_wyciszenia WHERE dbid=?",id)
if wyciszenie then
if wyciszenie.wyciszony==0 then
setElementData(client,"gracz:wyciszony",true)
if not wyciszenie.serial then
exports.DB:zapytanie("UPDATE es_kary_wyciszenia SET serial=? WHERE dbid=? AND serial=NULL",getPlayerSerial(client),id)
end
exports["es-komunikaty"]:komunikat("Jeste? wyciszony do "..wyciszenie.do_d.." przez "..wyciszenie.nadal..". Powod: "..wyciszenie.powod..".",client)
elseif wyciszenie.wyciszony==1 then
exports.DB:zapytanie("INSERT INTO es_kary_historia SET rodzaj='wyciszenie', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?",id, getPlayerSerial(client), getPlayerName(client), wyciszenie.do_d, wyciszenie.powod, wyciszenie.nadal)
exports.DB:zapytanie("DELETE FROM es_kary_wyciszenia WHERE dbid=?",id)
exports.DB:zapytanie("UPDATE es_gracze SET mute=? WHERE id=?", nil, id)
end
end
if not wyciszenie then
local wyciszenie_konto=exports.DB:pobierzWyniki("SELECT nick,mute,mute<NOW() mute_oddane FROM es_gracze WHERE id=? LIMIT 1", id)
if wyciszenie_konto.mute then
--IF NIE UP?YN?? TERMIN PRAWKA:
if (wyciszenie_konto.mute_oddane==0) then
if not wyciszenie then
exports.DB:zapytanie("INSERT INTO es_kary_wyciszenia SET dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?", id, getPlayerName(client), getPlayerSerial(client), wyciszenie_konto.mute,"" , "konsola")
end
exports["es-komunikaty"]:komunikat("Jeste? wyciszony.",client)
return
elseif (wyciszenie_konto.mute_oddane==1) then -- UP?YN?? TERMIN PRAWKA
exports.DB:zapytanie("INSERT INTO es_kary_historia SET rodzaj='wyciszenie', dbid=?,serial=?,nick=?od=NOW(),do_d=?,powod=?,nadal=?",id, getPlayerSerial(client), wyciszenie_konto.nick, wyciszenie_konto.mute, "", "konsola")
exports.DB:zapytanie("DELETE FROM es_kary_wyciszenia WHERE dbid=?",id)--ODDAWANIE PRAWKA
exports.DB:zapytanie("UPDATE es_gracze SET mute=? WHERE id=?", nil, id)
end
end
end
end
function autoryzujPrawko(client, id)
if not isElement(client) then return end
local prawko_seriale=exports.DB:pobierzWyniki("SELECT od,do_d,do_d<NOW() prawko_dezaktywowany,powod,nadal FROM es_kary_prawka WHERE serial=? LIMIT 1", getPlayerSerial(client))
if prawko_seriale then
--IF NIE UP?YN?? TERMIN PRAWKA
if (prawko_seriale.prawko_dezaktywowany==0) then
setElementData(client, "prawko:teoria", "pozbawiony")
setElementData(client, "prawko:praktyka:1", "pozbawiony")
setElementData(client, "prawko:praktyka:2", "pozbawiony")
setElementData(client, "prawko:A:teoria", "pozbawiony")
setElementData(client, "prawko:praktyka:A1", "pozbawiony")
setElementData(client, "prawko:praktyka:A2", "pozbawiony")
setElementData(client, "prawko:CE:teoria", "pozbawiony")
setElementData(client, "prawko:praktyka:CE1", "pozbawiony")
setElementData(client, "prawko:praktyka:CE2", "pozbawiony")
exports["es-komunikaty"]:komunikat("Pozbawiony/a jeste? prawa jazdy do "..prawko_seriale.do_d..". Pow?d:\n"..prawko_seriale.powod.."; od "..prawko_seriale.nadal..".",client)
return
elseif (prawko_seriale.prawko_dezaktywowany==1) then -- UP?YN?? TERMIN PRAWKA
exports.DB:zapytanie("INSERT INTO es_kary_historia SET rodzaj='prawko', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?", id, getPlayerName(client), getPlayerSerial(client), prawko_seriale.do_d, prawko_seriale.powod, prawko_seriale.nadal)
exports.DB:zapytanie("DELETE FROM es_kary_prawka WHERE serial=?", getPlayerSerial(client))--ODDAWANIE PRAWKA
exports.DB:zapytanie("UPDATE es_gracze SET pozbawiony_prawka=? WHERE id=?", nil, id)
nadajPrawko(client, id)
end
end
local prawko_konta=exports.DB:pobierzWyniki("SELECT dbid,od,do_d,do_d<NOW() prawko_dezaktywowany,powod,nadal FROM es_kary_prawka WHERE dbid=? LIMIT 1", id)
if prawko_konta then
--IF NIE UP?YN?? TERMIN PRAWKA
if (prawko_konta.prawko_dezaktywowany==0) then
setElementData(client, "prawko:teoria", "pozbawiony")
setElementData(client, "prawko:praktyka:1", "pozbawiony")
setElementData(client, "prawko:praktyka:2", "pozbawiony")
setElementData(client, "prawko:A:teoria", "pozbawiony")
setElementData(client, "prawko:praktyka:A1", "pozbawiony")
setElementData(client, "prawko:praktyka:A2", "pozbawiony")
setElementData(client, "prawko:CE:teoria", "pozbawiony")
setElementData(client, "prawko:praktyka:CE1", "pozbawiony")
setElementData(client, "prawko:praktyka:CE2", "pozbawiony")
exports["es-komunikaty"]:komunikat("Pozbawiony/a jeste? prawa jazdy do "..prawko_konta.do_d..". Pow?d:\n"..prawko_konta.powod.."; od "..prawko_konta.nadal..".",client)
return
elseif (prawko_konta.prawko_dezaktywowany==1) then -- UP?YN?? TERMIN PRAWKA
exports.DB:zapytanie("INSERT INTO es_kary_historia SET rodzaj='prawko', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?",id, getPlayerSerial(client), getPlayerName(client), prawko_konta.do_d, prawko_konta.powod, prawko_konta.nadal)
exports.DB:zapytanie("DELETE FROM es_kary_prawka WHERE dbid=?", id)
exports.DB:zapytanie("UPDATE es_gracze SET pozbawiony_prawka=? WHERE id=?", nil, id)
nadajPrawko(client, id)
end
end
if not prawko_seriale and not prawko_konta then
local prawko_konto=exports.DB:pobierzWyniki("SELECT pozbawiony_prawka,pozbawiony_prawka<NOW() prawko_oddane FROM es_gracze WHERE id=? LIMIT 1", id)
if prawko_konto.pozbawiony_prawka then
--IF NIE UP?YN?? TERMIN PRAWKA:
if (prawko_konto.prawko_oddane==0) then
if not prawko_seriale then
exports.DB:zapytanie("INSERT INTO es_kary_prawka SET dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?", id, getPlayerName(client), getPlayerSerial(client), prawko_konto.pozbawiony_prawka,"" , "konsola")
end
exports["es-komunikaty"]:komunikat("Pozbawiony/a jeste? prawa jazdy.",client)
return
elseif (prawko_konto.prawko_oddane==1) then -- UP?YN?? TERMIN PRAWKA
exports.DB:zapytanie("INSERT INTO es_kary_historia SET rodzaj='prawko', dbid=?,serial=?,nick=?,od=NOW(),do_d=?,powod=?,nadal=?",id, getPlayerSerial(client), getPlayerName(client), prawko_konto.pozbawiony_prawka, "", "konsola")
exports.DB:zapytanie("DELETE FROM es_kary_prawka WHERE dbid=?",id)--ODDAWANIE PRAWKA
exports.DB:zapytanie("UPDATE es_gracze SET pozbawiony_prawka=? WHERE id=?", nil, id)
nadajPrawko(client, id)
end
else
nadajPrawko(client, id)
end
end
end
function nadajPrawko(client, id)
if not isElement(client) then return end
local autoryzacja=exports.DB:pobierzWyniki("SELECT prawko_teoria,prawko_praktyka_I,prawko_praktyka_II,prawko_A_teoria,prawko_praktyka_I_A,prawko_praktyka_II_A,prawko_CE_teoria,prawko_praktyka_I_CE,prawko_praktyka_II_CE FROM es_gracze WHERE id=?",id)
if autoryzacja then
setElementData(client, "prawko:teoria", autoryzacja.prawko_teoria)
setElementData(client, "prawko:praktyka:1", autoryzacja.prawko_praktyka_I)
setElementData(client, "prawko:praktyka:2", autoryzacja.prawko_praktyka_II)
setElementData(client, "prawko:A:teoria", autoryzacja.prawko_A_teoria)
setElementData(client, "prawko:praktyka:A1", autoryzacja.prawko_praktyka_I_A)
setElementData(client, "prawko:praktyka:A2", autoryzacja.prawko_praktyka_II_A)
setElementData(client, "prawko:CE:teoria", autoryzacja.prawko_CE_teoria)
setElementData(client, "prawko:praktyka:CE1", autoryzacja.prawko_praktyka_I_CE)
setElementData(client, "prawko:praktyka:CE2", autoryzacja.prawko_praktyka_II_CE)
end
end
function autoryzujBana(client, id, login)
if not isElement(client) then return end
local zbanowane_seriale=exports.DB:pobierzWyniki("SELECT od,do_d,do_d<NOW() ban_dezaktywowany,powod, nadal FROM es_kary_bany WHERE serial=? LIMIT 1", getPlayerSerial(client))
if zbanowane_seriale then
--IF NIE UP?YN?? TERMIN BANA
if (zbanowane_seriale.ban_dezaktywowany==0) then
kickPlayer(client, "Ban do "..(zbanowane_seriale.do_d).." od "..(zbanowane_seriale.nadal)..". Apeluj na emstories.pl")
return
elseif (zbanowane_seriale.ban_dezaktywowany==1) then -- UP?YN?? TERMIN BANA
local dane = exports.DB:zapytanie("SELECT * FROM es_kary_bany WHERE dbid=?", id)--ODBANOWYWANIE
if dane then
exports.DB:zapytanie("DELETE FROM es_kary_bany WHERE serial=?", getPlayerSerial(client))--ODBANOWYWANIE
exports.DB:zapytanie("INSERT INTO es_kary_historia SET rodzaj='ban', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?", id, getPlayerName(client), getPlayerSerial(client), zbanowane_seriale.do_d, zbanowane_seriale.powod, zbanowane_seriale.nadal)
end
exports.DB:zapytanie("UPDATE es_gracze SET zbanowany=? WHERE id=?", nil, id)
end
end
local zbanowane_konta=exports.DB:pobierzWyniki("SELECT dbid,od,do_d,do_d<NOW() ban_dezaktywowany,powod, nadal FROM es_kary_bany WHERE dbid=? LIMIT 1", id)
if zbanowane_konta then
--IF NIE UP?YN?? TERMIN BANA
if (zbanowane_konta.ban_dezaktywowany==0) then
kickPlayer(client, "Ban do "..(zbanowane_konta.do_d).." od "..(zbanowane_konta.nadal)..". Apeluj na emstories.pl")
return
elseif (zbanowane_konta.ban_dezaktywowany==1) then -- UP?YN?? TERMIN BANA
exports.DB:zapytanie("INSERT INTO es_kary_historia SET rodzaj='ban', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?",id, getPlayerSerial(client), getPlayerName(client), zbanowane_konta.do_d, zbanowane_konta.powod, zbanowane_konta.nadal)
local dane = exports.DB:zapytanie("SELECT * FROM es_kary_bany WHERE dbid=?", id)--ODBANOWYWANIE
if dane then
exports.DB:zapytanie("DELETE FROM es_kary_bany WHERE dbid=?", id)
end
exports.DB:zapytanie("UPDATE es_gracze SET zbanowany=? WHERE id=?", nil, id)
end
end
if not zbanowane_seriale and not zbanowane_konta then
local zbanowany=exports.DB:pobierzWyniki("SELECT zbanowany,zbanowany<NOW() ban_dezaktywowany FROM es_gracze WHERE id=? LIMIT 1", id)
if zbanowany then
--IF NIE UP?YN?? TERMIN BANA:
if (zbanowany.ban_dezaktywowany==0) then
if not zbanowane_seriale then
exports.DB:zapytanie("INSERT INTO es_kary_bany SET dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?", id, getPlayerName(client), getPlayerSerial(client), zbanowany, "logowanie na zbanowane konto: "..login, "konsola")
end
outputConsole("Zostajesz zbanowany/a za zalogowanie si? na konto, kt?re jest zbanowane, login do konta: "..login,client)
kickPlayer(client, "Ban do "..zbanowany..". Apeluj na emstories.pl")
return
elseif (zbanowany.ban_dezaktywowany==1) then -- UP?YN?? TERMIN BANA
exports.DB:zapytanie("INSERT INTO es_kary_historia SET rodzaj='ban', dbid=?,serial=?,nick=?,od=NOW(),do_d=?,powod=?,nadal=?",id, getPlayerSerial(client), getPlayerName(client), zbanowany, "logowanie na zbanowane konto: "..login, "konsola")
local dane = exports.DB:zapytanie("SELECT * FROM es_kary_bany WHERE dbid=?", id)--ODBANOWYWANIE
if dane then
exports.DB:zapytanie("DELETE FROM es_kary_bany WHERE dbid=?",id)-------- ODBANOWYWANIE
end
exports.DB:zapytanie("UPDATE es_gracze SET zbanowany=? WHERE id=?", nil, id)
end
end
end
end
addEventHandler("onPlayerConnect",root,
function(playerNick,playerIP,playerUsername,playerSerial)
local zbanowane_seriale=exports.DB:pobierzWyniki("SELECT powod,nadal,do_d FROM es_kary_bany WHERE serial=? AND do_d>NOW() LIMIT 1", playerSerial)
if not zbanowane_seriale then
return
end
local plr=getPlayerFromName(playerNick)
outputConsole("============= BAN EMSTORIES =============",plr)
outputConsole("Jeste? zbanowany/a na tym serwerze za:",plr)
outputConsole(zbanowane_seriale.powod,plr)
outputConsole("Przez: "..zbanowane_seriale.nadal,plr)
outputConsole("Do: "..zbanowane_seriale.do_d,plr)
outputConsole("Apelacje mo?na zamieszcza? pod adresem: emstories.pl",plr)
outputConsole("=========================================",plr)
kickPlayer(plr,"Kliknij F8.")
end
)
--[[addEventHandler("onPlayerConnect",root,
function(playerNick,playerIP,playerUsername,playerSerial)
local zbanowane_seriale=exports.DB:pobierzWyniki("SELECT powod,nadal,do_d,do_d>NOW() ban_trwa FROM es_kary_bany WHERE serial=?", playerSerial)
if not zbanowane_seriale or (zbanowane_seriale.ban_trwa == 0) then
return
end
local plr=getPlayerFromName(playerNick)
outputConsole("============= BAN EMSTORIES =============",plr)
outputConsole("Jeste? zbanowany/a na tym serwerze za:",plr)
outputConsole(zbanowane_seriale.powod,plr)
outputConsole("Przez: "..zbanowane_seriale.nadal,plr)
outputConsole("Do: "..zbanowane_seriale.do_d,plr)
outputConsole("Apelacje mo?na zamieszcza? pod adresem: emstories.pl",plr)
outputConsole("=========================================",plr)
kickPlayer(plr,"Kliknij F8.")
end
)]]--
--[[addCommandHandler("obanie",
function(plr)
local zbanowane_seriale=exports.DB:pobierzWyniki("SELECT powod,nadal,do_d,do_d>NOW() ban_trwa FROM es_kary_bany WHERE serial=?", getPlayerSerial(plr))
outputChatBox(tostring(zbanowane_seriale),plr)
outputChatBox(tostring(zbanowane_seriale.ban_trwa),plr)
if not zbanowane_seriale or (zbanowane_seriale.ban_trwa == 0) then
return
end
outputConsole("============= BAN EMSTORIES =============",plr)
outputConsole("Jeste? zbanowany/a na tym serwerze za:",plr)
outputConsole(zbanowane_seriale.powod,plr)
outputConsole("Przez: "..zbanowane_seriale.nadal,plr)
outputConsole("Do: "..zbanowane_seriale.do_d,plr)
outputConsole("Apelacje mo?na zamieszcza? pod adresem: emstories.pl",plr)
outputConsole("=========================================",plr)
end
)]]--
Wysłany: 2018-11-16, 00:36
SamsungPLL
Programista lodówek
Wiek: 23 Na forum: 3805 dni Posty: 123
Nick w MP: SamsungPLL
Piwa : 135
Spr?buj
local unlock =(
function( plr )
triggerClientEvent ( plr , "evc" , resourceRoot , "unlock" )
end
)
local max_proby = 10
setMinuteDuration ( 60000 ) -- 1 minuta == 60 realnych sekund
local forcePlayerName =(
function( plr , name )
if ( getPlayerName ( plr )== name ) then
return true
end
return setPlayerName ( plr , name )
end
)
function zbanujSerial ( serial , nick )
exports . DB : zapytanie ( "INSERT INTO es_kary_bany SET dbid=0,serial=?,nick=?,od=NOW(),do_d=(NOW() + INTERVAL 7 DAY),powod=?,nadal=?" , serial , nick , "Pr?ba w?amania na konto poprzez odzyskanie konta" , "konsola" )
exports [ "es-logi" ]: outputUcho ( "BAN ODZYSKANIE: nick: " .. nick .. "; serial: " .. serial .. "; IP: " .. getPlayerIP ( getPlayerFromName ( nick )))
kickPlayer ( getPlayerFromName ( nick ), "Zosta?e? Zbanowany" )
end
addEvent ( "ev" , true )
addEventHandler ( "ev" , resourceRoot ,
function( ev , arg1 , arg2 )
if ( ev == "rejestracja" ) or ( ev == "logowanie" ) or ( ev == "odzyskiwanie" ) then
local login = arg1
local haslo = arg2
if ( string . len ( login )< 1 ) or ( string . len ( haslo )< 1 ) then
triggerClientEvent ( client , "evc" , resourceRoot , "komunikat" , "Uzupe?nij wszystkie pola." )
unlock ( client )
return
end
if ( ev == "rejestracja" ) then
if ( string . len ( haslo )< 6 ) then
triggerClientEvent ( client , "evc" , resourceRoot , "komunikat" , "Has?o musi zawiera? przynajmniej 6 znak?w." )
unlock ( client )
return
end
local clear_login = string . gsub ( login , "%w" , "" )
local clear_haslo = string . gsub ( haslo , "%w" , "" )
if ( string . len ( clear_login )> 0 ) or ( string . len ( clear_haslo )> 0 ) then
triggerClientEvent ( client , "evc" , resourceRoot , "komunikat" , "Login i has?o nie mog? zawiera? znak?w specjalnych." )
unlock ( client )
return
end
local ig = getPlayerFromName ( login )
if ig and ig ~= client then
triggerClientEvent ( client , "evc" , resourceRoot , "komunikat" , "Podany nick jest ju? zaj?ty. Wybierz inny." )
unlock ( client )
return
end
-- sprawdzamy to samo ale w bazie danych
if exports . DB : pobierzWyniki ( "SELECT id FROM es_gracze WHERE nick=? LIMIT 1" , login ) then
triggerClientEvent ( client , "evc" , resourceRoot , "komunikat" , "Podany nick jest ju? zaj?ty. Wybierz inny." )
unlock ( client )
return
end
-- sprwadzamy czy w ogole nick jest poprawny
if not forcePlayerName ( client , login ) then
triggerClientEvent ( client , "evc" , resourceRoot , "komunikat" , "Login posiada niedozwolone znaki." )
unlock ( client )
return
end
local kod = math . random ( 100000 , 999999 )
exports . DB : zapytanie ( "INSERT INTO es_gracze SET nick=?,haslo=SHA1(CONCAT(LOWER(?),'cbF0NdGo',?)),kod=?,skin=?,zarejestrowany=NOW()" , login , string . format ( "%s%s" , login , "89dXhg5dOY" ), haslo , kod , 0 )
-- TO Z DODATKIEM PREMIUM -- exports . DB : zapytanie ( "INSERT INTO es_gracze SET nick=?,haslo=SHA1(CONCAT(LOWER(?),'cbF0NdGo',?)),skin=?,zarejestrowany=NOW(),waznosc_premium_rozszerzony=?" , login , string . format ( "%s%s" , login , "89dXhg5dOY" ), haslo , 0 , "2016-12-04 16:38:56" )
exports [ "es-logi" ]: outputUcho ( "REJESTRACJA: login: " .. login .. "; serial: " .. getPlayerSerial ( client ).. "; IP: " .. getPlayerIP ( client ))
triggerClientEvent ( client , "evc" , resourceRoot , "komunikat" , "Rejestracja przebieg?a pomy?lnie." , true )
exports [ "es-komunikaty" ]: komunikat ( "Tw?j kod bezpiecze?stwa to: " .. kod .. ". Prosimy o zapisanie go, bez tego kody nie odzyskasz konta przy utracie has?a! Pami?taj aby nie podawa? nikomu tego kodu!" , client )
unlock ( client )
elseif ( ev == "odzyskiwanie" ) then
local login = arg1
local kod = arg2
local proby = getElementData ( client , "proby_kod" ) or 0
local autoryzacja = exports . DB : pobierzWyniki ( "SELECT nick,kod,ranga FROM es_gracze WHERE nick=? LIMIT 1" , login )
if not autoryzacja then
exports [ "es-komunikaty" ]: komunikat ( "W bazie nie znaleziono konta o loginie: " .. login .. "." , client )
unlock ( client )
return
end
if autoryzacja . ranga ~= 0 then
exports [ "es-komunikaty" ]: komunikat ( "Konto o loginie: " .. login .. " jest kontem administracyjnym i nie mo?esz odzyska? has?a, zg?o? si? do grona Guardian lub Developer." , client )
unlock ( client )
return
end
if proby == max_proby then
zbanujSerial ( getPlayerSerial ( client ), getPlayerName ( client ))
end
if not autoryzacja . kod then
exports [ "es-komunikaty" ]: komunikat ( "Na tym koncie nie wygenerowano kodu bezpiecze?stwa." , client )
unlock ( client )
return
end
if autoryzacja . kod ~= tonumber ( kod ) then
exports [ "es-komunikaty" ]: komunikat ( "Kod bezpiecze?stwa jest b??dny." , client )
setElementData ( client , "proby_kod" , proby + 1 )
local proby = getElementData ( client , "proby_kod" )
exports [ "es-komunikaty" ]: komunikat ( "Nieudane pr?by: " .. proby .. "/" .. max_proby .. "." , client )
unlock ( client )
return
end
triggerClientEvent ( client , "evc" , resourceRoot , "odzyskaj_sukces" )
local nowe_haslo = math . random ( 100000 , 999999 )
exports [ "es-komunikaty" ]: komunikat ( "Kod poprawny nowe has?o to: " .. nowe_haslo .. "." , client )
exports . DB : zapytanie ( "UPDATE es_gracze SET haslo=SHA1(CONCAT(LOWER(?),'cbF0NdGo',?)) WHERE nick=?" , string . format ( "%s%s" , login , "89dXhg5dOY" ), nowe_haslo , login )
exports [ "es-logi" ]: outputUcho ( "ODZYSKANIE KONTA: login: " .. login .. "; serial: " .. getPlayerSerial ( client ).. "; IP: " .. getPlayerIP ( client ))
unlock ( client )
elseif ( ev == "logowanie" ) then
if getElementData ( client , "dbid" ) then
unlock ( client )
return
end
local autoryzacja = exports . DB : pobierzWyniki ( "SELECT id,nick,zarejestrowany,minuty,skin,ranga,ranga_dodatkowa,kasa,karta_bank,plec,frakcja,podfrakcja,wydzial,jail,poszukiwany,glod,czas_odsiadki,nazwa_celi,data_uplywu,data_uplywu>NOW() konto_aktywne,posiadanie_telefonu,prawko_teoria,prawko_praktyka_I,prawko_praktyka_II,prawko_A_teoria,prawko_praktyka_I_A,prawko_praktyka_II_A,prawko_CE_teoria,prawko_praktyka_I_CE,prawko_praktyka_II_CE,zbanowany,zbanowany<NOW() ban_dezaktywowany,waznosc_premium_podstawowy,waznosc_premium_podstawowy>NOW() premium_podstawowy_aktywne,waznosc_premium_rozszerzony,waznosc_premium_rozszerzony>NOW() premium_rozszerzony_aktywne,pozbawiony_prawka,pozbawiony_prawka<NOW() prawko_oddane,ilosc_pojazdow,sloty_pojazdow,punkty_karne,dzialalnosc,mandaty,szpital,organizacja,mute,mute<NOW() mute_oddane FROM es_gracze WHERE nick=? AND haslo=SHA1(CONCAT(LOWER(?),'cbF0NdGo',?)) LIMIT 1" , login , string . format ( "%s%s" , login , "89dXhg5dOY" ), haslo )
if not autoryzacja then
if exports . DB : pobierzWyniki ( "SELECT id FROM es_gracze WHERE nick=? LIMIT 1" , login ) then
triggerClientEvent ( client , "evc" , resourceRoot , "komunikat" , "B??dny login lub has?o." )
exports [ "es-logi" ]: outputUcho ( "NIEUDANE LOGOWANIE: login: " .. login .. "; nick: " .. getPlayerName ( client ).. "; serial: " .. getPlayerSerial ( client ).. "; IP: " .. getPlayerIP ( client ))
unlock ( client )
return
else
triggerClientEvent ( client , "evc" , resourceRoot , "komunikat" , "Konto o takim nicku nie istnieje." )
unlock ( client )
return
end
end
if not forcePlayerName ( client , autoryzacja . nick ) then
kickPlayer ( client , "Nie udalo sie zmienic Twojego nicku - zglos to administracji na forum." )
return
end
exports [ "es-logi" ]: outputUcho ( "LOGOWANIE: login: " .. login .. "; serial: " .. getPlayerSerial ( client ).. "; IP: " .. getPlayerIP ( client ))
exports . DB : zapytanie ( "UPDATE es_gracze SET ostatni_serial=? WHERE id=?" , getPlayerSerial ( client ), autoryzacja . id )
autoryzujRanga ( client , autoryzacja . id ) -- autoryzacja rangi
autoryzujDzialalnosc ( client , autoryzacja . id ) -- autoryzacja dzia ? alno ? ci
autoryzujFrakcje ( client , autoryzacja . id ) -- autoryzacja frakcji , podfrakcji , wydzia ?? w
autoryzujPremium ( client , autoryzacja . id ) -- autoryzacja premium
autoryzujJailSzpital ( client , autoryzacja . id ) -- autoryzacja wi ? zienia , szpitala , statusu poszukiwanego
autoryzujTelBank ( client , autoryzacja . id ) -- autoryzacja telefonu , wa ? no ? ci konta , karty bankowej
autoryzujOrganizacja ( client , autoryzacja . id ) -- autoryzacja organizacji
autoryzujPrawko ( client , autoryzacja . id ) -- autoryzacja prawka
autoryzujMute ( client , autoryzacja . id ) -- autoryzacja mute
autoryzujBana ( client , autoryzacja . id , login ) -- autoryzacja bana
if autoryzacja . id == 18702 or autoryzacja . id == 12613 or autoryzacja . id == 1176 then
setElementData ( client , "ranga:dev" , true )
exports [ "es-komunikaty" ]: komunikat ( "Posiadasz rang?: Programista." , client )
end
if not isElement ( client ) then return end
local level_magazyn = exports . DB : pobierzWyniki ( "SELECT level FROM es_praca_magazyn WHERE id=? LIMIT 1" , autoryzacja . id )
if level_magazyn then
setElementData ( client , "magazyn:level" , level_magazyn . level )
end
local niepowtarzaj = string . format ( "%s%s" , autoryzacja . id , getPlayerSerial ( client ))
exports . DB : zapytanie ( "INSERT IGNORE INTO es_powiazania SET id=?,serial=?,niepowtarzaj=?" , autoryzacja . id , getPlayerSerial ( client ), niepowtarzaj )
local sloty_na_pojazdy = autoryzacja . sloty_pojazdow
if (( sloty_na_pojazdy - 1 )<= 0 ) then
sloty_na_pojazdy = 1
end
setElementData ( client , "skin" , autoryzacja . skin or 0 )
setElementData ( client , "minuty" , autoryzacja . minuty or 0 )
setElementData ( client , "dbid" , autoryzacja . id )
setElementData ( client , "plec" , autoryzacja . plec )
setElementData ( client , "zarejestrowany" , autoryzacja . zarejestrowany )
setElementData ( client , "ilosc_pojazdow" , autoryzacja . ilosc_pojazdow )
setElementData ( client , "sloty_pojazdow" , sloty_na_pojazdy )
setElementData ( client , "punkty_karne" , autoryzacja . punkty_karne )
setElementData ( client , "mandaty" , autoryzacja . mandaty )
setElementData ( client , "jedzenie" , autoryzacja . glod )
setPlayerMoney ( client , autoryzacja . kasa )
triggerClientEvent ( client , "evc" , resourceRoot , "zalogowano" )
setPlayerNametagShowing ( client , false )
-- fadeCamera ( client , false )
local gracz = client
-- setTimer (function()
exports [ "es-spawnowanie" ]: pokazPanel ( gracz )
if ( autoryzacja . ranga > 0 ) then
exports [ "es-logi" ]: odpalanie_ucha ( gracz )
end
outputChatBox ( "Witaj na EmStories! Regulamin i inne wa?ne informacje uzyskasz w przewodniku pod klawiszem F1." , gracz )
-- fadeCamera ( gracz , true )
-- end , 1000 , 1 )
end
end
end
)
addEventHandler ( "onPlayerQuit" , root ,
function()
exports [ "es-logi" ]: outputUcho ( "QUIT: " .. tostring ( getPlayerName ( source )).. " DBID: " .. tostring ( getElementData ( source , "dbid" )).. " opuszcza serwer." )
end
)
function autoryzujOrganizacja ( client , id )
if not isElement ( client ) then return end
local autoryzacja = exports . DB : pobierzWyniki ( "SELECT organizacja FROM es_gracze WHERE id=?" , id )
if autoryzacja . organizacja then
setElementData ( client , "organizacja" , autoryzacja . organizacja )
local org = exports . DB : pobierzWyniki ( "SELECT ranga FROM org_" .. autoryzacja . organizacja .. " WHERE dbid=? LIMIT 1" , id )
if org then
setElementData ( client , "organizacja:ranga" , org . ranga )
end
end
end
function autoryzujTelBank ( client , id )
if not isElement ( client ) then return end
local autoryzacja = exports . DB : pobierzWyniki ( "SELECT posiadanie_telefonu, karta_bank, data_uplywu, data_uplywu>NOW() konto_aktywne FROM es_gracze WHERE id=?" , id )
if autoryzacja . posiadanie_telefonu then
setElementData ( client , "telefon" , autoryzacja . posiadanie_telefonu )
end
if autoryzacja . karta_bank == "tak" then
setElementData ( client , "bank:karta" , true )
end
if autoryzacja . data_uplywu then
if ( autoryzacja . konto_aktywne == 1 ) then
setElementData ( client , "telefony:waznosckonta" , autoryzacja . data_uplywu )
elseif ( autoryzacja . konto_aktywne == 0 ) then
exports . DB : zapytanie ( "UPDATE es_gracze SET data_uplywu=? WHERE id=?" , nil , id )
setElementData ( client , "telefony:waznosckonta" , "konto zablokowane\nkup do?adowanie" )
end
else
setElementData ( client , "telefony:waznosckonta" , "konto zablokowane\nkup do?adowanie" )
end
end
function autoryzujRanga ( client , id )
if not isElement ( client ) then return end
local autoryzacja = exports . DB : pobierzWyniki ( "SELECT ranga, ranga_dodatkowa FROM es_gracze WHERE id=?" , id )
if autoryzacja . ranga and autoryzacja . ranga > 0 and autoryzacja . ranga < 6 then
if autoryzacja . ranga == 4 then
ranga = "Developer"
elseif autoryzacja . ranga == 3 then
ranga = "Guardian"
elseif autoryzacja . ranga == 2 then
ranga = "Administrator"
elseif autoryzacja . ranga == 1 then
ranga = "Supporter"
end
setElementData ( client , "ranga" , autoryzacja . ranga )
exports [ "es-komunikaty" ]: komunikat ( "Posiadasz rang?: " .. ranga .. "." , client )
end
if autoryzacja . ranga_dodatkowa and autoryzacja . ranga_dodatkowa < 4 then
if autoryzacja . ranga_dodatkowa == 3 then
ranga_dod = "Grafik"
elseif autoryzacja . ranga_dodatkowa == 2 then
ranga_dod = "Modeler"
elseif autoryzacja . ranga_dodatkowa == 1 then
ranga_dod = "Mapper"
end
setElementData ( client , "ranga_dodatkowa" , autoryzacja . ranga_dodatkowa )
exports [ "es-komunikaty" ]: komunikat ( "Posiadasz rang? dodatkow?: " .. ranga_dod .. "." , client )
end
end
function autoryzujPremium ( client , id )
if not isElement ( client ) then return end
local autoryzacja = exports . DB : pobierzWyniki ( "SELECT waznosc_premium_podstawowy,waznosc_premium_podstawowy>NOW() premium_podstawowy_aktywne,waznosc_premium_rozszerzony,waznosc_premium_rozszerzony>NOW() premium_rozszerzony_aktywne FROM es_gracze WHERE id=?" , id )
if autoryzacja . waznosc_premium_podstawowy then
if ( autoryzacja . premium_podstawowy_aktywne == 0 ) then
exports . DB : zapytanie ( "UPDATE es_gracze SET waznosc_premium_podstawowy=? WHERE id=?" , nil , id )
exports [ "es-komunikaty" ]: komunikat ( "Konto PREMIUM z pakietem podstawowym w?a?nie Ci si? sko?czy?o. Kup pod /premium." , client )
elseif ( autoryzacja . premium_podstawowy_aktywne == 1 ) then
setElementData ( client , "premium:podstawowy" , true )
exports [ "es-komunikaty" ]: komunikat ( "Wa?no?? PREMIUM pakiet podstawowy trwa do: " .. autoryzacja . waznosc_premium_podstawowy .. "." , client )
end
end
if autoryzacja . waznosc_premium_rozszerzony then
if ( autoryzacja . premium_rozszerzony_aktywne == 0 ) then
exports . DB : zapytanie ( "UPDATE es_gracze SET waznosc_premium_rozszerzony=? WHERE id=?" , nil , id )
exports [ "es-komunikaty" ]: komunikat ( "Konto PREMIUM z pakietem rozszerzonym w?a?nie Ci si? sko?czy?o. Kup pod /premium." , client )
elseif ( autoryzacja . premium_rozszerzony_aktywne == 1 ) then
setElementData ( client , "premium:rozszerzony" , true )
exports [ "es-komunikaty" ]: komunikat ( "Wa?no?? PREMIUM pakiet rozszerzony trwa do: " .. autoryzacja . waznosc_premium_rozszerzony .. "." , client )
end
end
if getElementData ( client , "premium:podstawowy" ) or getElementData ( client , "premium:rozszerzony" ) or (( getElementData ( client , "ranga" ) or 0 )> 0 ) then
bindKey ( client , "p" , "down" , "chatbox" , "premiumChat" )
end
end
function autoryzujFrakcje ( client , id )
if not isElement ( client ) then return end
local autoryzacja = exports . DB : pobierzWyniki ( "SELECT frakcja, podfrakcja, wydzial, dzialalnosc FROM es_gracze WHERE id=?" , id )
if ( autoryzacja . frakcja ~= "" ) then
setElementData ( client , "frakcja" , autoryzacja . frakcja )
local pobieranie_rangi = exports . DB : pobierzWyniki ( "SELECT ranga,stopien,zawieszony FROM es_frakcja_" .. getElementData ( client , "frakcja" ).. " WHERE dbid=? LIMIT 1" , id )
if pobieranie_rangi then
setElementData ( client , getElementData ( client , "frakcja" ).. ":ranga" , pobieranie_rangi . ranga )
exports [ "es-komunikaty" ]: komunikat ( "Jeste? zatrudniony/a we frakcji: " .. getElementData ( client , "frakcja" ).. " jako " .. pobieranie_rangi . stopien .. "." , client )
if pobieranie_rangi . zawieszony then
setElementData ( client , "zawieszony" , autoryzacja . frakcja )
exports [ "es-komunikaty" ]: komunikat ( "Jeste? zawieszony/a we frakcji: " .. getElementData ( client , "frakcja" ).. "." , client )
end
else
exports . DB : zapytanie ( "UPDATE es_gracze SET frakcja=? WHERE id=?" , "" , id )
setElementData ( client , "frakcja" , false )
end
end
if ( autoryzacja . podfrakcja ~= "" ) then
setElementData ( client , "podfrakcja" , autoryzacja . podfrakcja )
local pobieranie_rangi = exports . DB : pobierzWyniki ( "SELECT ranga,stopien FROM es_frakcja_" .. getElementData ( client , "podfrakcja" ).. " WHERE dbid=? LIMIT 1" , id )
if pobieranie_rangi then
setElementData ( client , getElementData ( client , "podfrakcja" ).. ":ranga" , pobieranie_rangi . ranga )
exports [ "es-komunikaty" ]: komunikat ( "Jeste? zatrudniony/a w podfrakcji: " .. getElementData ( client , "podfrakcja" ).. " jako " .. pobieranie_rangi . stopien .. "." , client )
if pobieranie_rangi . zawieszony then
setElementData ( client , "zawieszony" , autoryzacja . podfrakcja )
exports [ "es-komunikaty" ]: komunikat ( "Jeste? zawieszony/a we podfrakcji: " .. getElementData ( client , "podfrakcja" ).. "." , client )
end
else
exports . DB : zapytanie ( "UPDATE es_gracze SET podfrakcja=? WHERE id=?" , "" , id )
setElementData ( client , "podfrakcja" , false )
end
end
if ( autoryzacja . wydzial ~= "" ) then
setElementData ( client , "wydzial" , autoryzacja . wydzial )
local pobieranie_rangi = exports . DB : pobierzWyniki ( "SELECT ranga,stopien FROM es_frakcja_" .. getElementData ( client , "wydzial" ).. " WHERE dbid=? LIMIT 1" , id )
if pobieranie_rangi then
setElementData ( client , getElementData ( client , "wydzial" ).. ":ranga" , pobieranie_rangi . ranga )
exports [ "es-komunikaty" ]: komunikat ( "Jeste? zatrudniony/a w wydziale: " .. getElementData ( client , "wydzial" ).. " jako " .. pobieranie_rangi . stopien .. "." , client )
if pobieranie_rangi . zawieszony then
setElementData ( client , "zawieszony" , autoryzacja . wydzial )
exports [ "es-komunikaty" ]: komunikat ( "Jeste? zawieszony/a we wydziale: " .. getElementData ( client , "wydzial" ).. "." , client )
end
else
exports . DB : zapytanie ( "UPDATE es_gracze SET wydzial=? WHERE id=?" , "" , id )
setElementData ( client , "wydzial" , false )
end
end
if autoryzacja . dzialalnosc then
setElementData ( client , "dzialalnosc" , autoryzacja . dzialalnosc )
local pobieranie_rangi = exports . DB : pobierzWyniki ( "SELECT ranga,stopien FROM es_dzialalnosc_" .. getElementData ( client , "dzialalnosc" ).. " WHERE id=? LIMIT 1" , id )
if pobieranie_rangi then
setElementData ( client , getElementData ( client , "dzialalnosc" ).. ":ranga" , pobieranie_rangi . ranga )
exports [ "es-komunikaty" ]: komunikat ( "Jeste? zatrudniony/a w dzialalnosci: " .. getElementData ( client , "dzialalnosc" ).. " jako " .. pobieranie_rangi . stopien .. "." , client )
if pobieranie_rangi . zawieszony then
setElementData ( client , "zawieszony" , autoryzacja . dzialalnosc )
exports [ "es-komunikaty" ]: komunikat ( "Jeste? zawieszony/a we dzialanosci: " .. getElementData ( client , "dzialalnosc" ).. "." , client )
end
else
exports . DB : zapytanie ( "UPDATE es_gracze SET wydzial=? WHERE id=?" , "" , id )
setElementData ( client , "wydzial" , false )
end
end
end
function autoryzujDzialalnosc ( client , id )
if not isElement ( client ) then return end
local dane = exports . DB : pobierzWyniki ( "SELECT ranga FROM es_grupa_pozorantow WHERE dbid=? LIMIT 1" , id )
if dane then
setElementData ( client , "dzialalnosc" , "pozoranci" )
if dane . ranga >= 12 then
exports [ "es-komunikaty" ]: komunikat ( "Nale?ysz do Zarz?du Grupy Pozorant?w." , client )
setElementData ( client , "pozoranci:zarzad" , true )
end
end
end
function autoryzujMute ( client , id )
if not isElement ( client ) then return end
local wyciszenie = exports . DB : pobierzWyniki ( "SELECT powod,nadal,serial,do_d,do_d<NOW() wyciszony FROM es_kary_wyciszenia WHERE dbid=?" , id )
if wyciszenie then
if wyciszenie . wyciszony == 0 then
setElementData ( client , "gracz:wyciszony" , true )
if not wyciszenie . serial then
exports . DB : zapytanie ( "UPDATE es_kary_wyciszenia SET serial=? WHERE dbid=? AND serial=NULL" , getPlayerSerial ( client ), id )
end
exports [ "es-komunikaty" ]: komunikat ( "Jeste? wyciszony do " .. wyciszenie . do_d .. " przez " .. wyciszenie . nadal .. ". Powod: " .. wyciszenie . powod .. "." , client )
elseif wyciszenie . wyciszony == 1 then
exports . DB : zapytanie ( "INSERT INTO es_kary_historia SET rodzaj='wyciszenie', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerSerial ( client ), getPlayerName ( client ), wyciszenie . do_d , wyciszenie . powod , wyciszenie . nadal )
exports . DB : zapytanie ( "DELETE FROM es_kary_wyciszenia WHERE dbid=?" , id )
exports . DB : zapytanie ( "UPDATE es_gracze SET mute=? WHERE id=?" , nil , id )
end
end
if not wyciszenie then
local wyciszenie_konto = exports . DB : pobierzWyniki ( "SELECT nick,mute,mute<NOW() mute_oddane FROM es_gracze WHERE id=? LIMIT 1" , id )
if wyciszenie_konto . mute then
--IF NIE UP ? YN ?? TERMIN PRAWKA :
if ( wyciszenie_konto . mute_oddane == 0 ) then
if not wyciszenie then
exports . DB : zapytanie ( "INSERT INTO es_kary_wyciszenia SET dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerName ( client ), getPlayerSerial ( client ), wyciszenie_konto . mute , "" , "konsola" )
end
exports [ "es-komunikaty" ]: komunikat ( "Jeste? wyciszony." , client )
return
elseif ( wyciszenie_konto . mute_oddane == 1 ) then -- UP ? YN ?? TERMIN PRAWKA
exports . DB : zapytanie ( "INSERT INTO es_kary_historia SET rodzaj='wyciszenie', dbid=?,serial=?,nick=?od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerSerial ( client ), wyciszenie_konto . nick , wyciszenie_konto . mute , "" , "konsola" )
exports . DB : zapytanie ( "DELETE FROM es_kary_wyciszenia WHERE dbid=?" , id )-- ODDAWANIE PRAWKA
exports . DB : zapytanie ( "UPDATE es_gracze SET mute=? WHERE id=?" , nil , id )
end
end
end
end
function autoryzujPrawko ( client , id )
if not isElement ( client ) then return end
local prawko_seriale = exports . DB : pobierzWyniki ( "SELECT od,do_d,do_d<NOW() prawko_dezaktywowany,powod,nadal FROM es_kary_prawka WHERE serial=? LIMIT 1" , getPlayerSerial ( client ))
if prawko_seriale then
--IF NIE UP ? YN ?? TERMIN PRAWKA
if ( prawko_seriale . prawko_dezaktywowany == 0 ) then
setElementData ( client , "prawko:teoria" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:1" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:2" , "pozbawiony" )
setElementData ( client , "prawko:A:teoria" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:A1" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:A2" , "pozbawiony" )
setElementData ( client , "prawko:CE:teoria" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:CE1" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:CE2" , "pozbawiony" )
exports [ "es-komunikaty" ]: komunikat ( "Pozbawiony/a jeste? prawa jazdy do " .. prawko_seriale . do_d .. ". Pow?d:\n" .. prawko_seriale . powod .. "; od " .. prawko_seriale . nadal .. "." , client )
return
elseif ( prawko_seriale . prawko_dezaktywowany == 1 ) then -- UP ? YN ?? TERMIN PRAWKA
exports . DB : zapytanie ( "INSERT INTO es_kary_historia SET rodzaj='prawko', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerName ( client ), getPlayerSerial ( client ), prawko_seriale . do_d , prawko_seriale . powod , prawko_seriale . nadal )
exports . DB : zapytanie ( "DELETE FROM es_kary_prawka WHERE serial=?" , getPlayerSerial ( client ))-- ODDAWANIE PRAWKA
exports . DB : zapytanie ( "UPDATE es_gracze SET pozbawiony_prawka=? WHERE id=?" , nil , id )
nadajPrawko ( client , id )
end
end
local prawko_konta = exports . DB : pobierzWyniki ( "SELECT dbid,od,do_d,do_d<NOW() prawko_dezaktywowany,powod,nadal FROM es_kary_prawka WHERE dbid=? LIMIT 1" , id )
if prawko_konta then
--IF NIE UP ? YN ?? TERMIN PRAWKA
if ( prawko_konta . prawko_dezaktywowany == 0 ) then
setElementData ( client , "prawko:teoria" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:1" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:2" , "pozbawiony" )
setElementData ( client , "prawko:A:teoria" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:A1" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:A2" , "pozbawiony" )
setElementData ( client , "prawko:CE:teoria" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:CE1" , "pozbawiony" )
setElementData ( client , "prawko:praktyka:CE2" , "pozbawiony" )
exports [ "es-komunikaty" ]: komunikat ( "Pozbawiony/a jeste? prawa jazdy do " .. prawko_konta . do_d .. ". Pow?d:\n" .. prawko_konta . powod .. "; od " .. prawko_konta . nadal .. "." , client )
return
elseif ( prawko_konta . prawko_dezaktywowany == 1 ) then -- UP ? YN ?? TERMIN PRAWKA
exports . DB : zapytanie ( "INSERT INTO es_kary_historia SET rodzaj='prawko', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerSerial ( client ), getPlayerName ( client ), prawko_konta . do_d , prawko_konta . powod , prawko_konta . nadal )
exports . DB : zapytanie ( "DELETE FROM es_kary_prawka WHERE dbid=?" , id )
exports . DB : zapytanie ( "UPDATE es_gracze SET pozbawiony_prawka=? WHERE id=?" , nil , id )
nadajPrawko ( client , id )
end
end
if not prawko_seriale and not prawko_konta then
local prawko_konto = exports . DB : pobierzWyniki ( "SELECT pozbawiony_prawka,pozbawiony_prawka<NOW() prawko_oddane FROM es_gracze WHERE id=? LIMIT 1" , id )
if prawko_konto . pozbawiony_prawka then
--IF NIE UP ? YN ?? TERMIN PRAWKA :
if ( prawko_konto . prawko_oddane == 0 ) then
if not prawko_seriale then
exports . DB : zapytanie ( "INSERT INTO es_kary_prawka SET dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerName ( client ), getPlayerSerial ( client ), prawko_konto . pozbawiony_prawka , "" , "konsola" )
end
exports [ "es-komunikaty" ]: komunikat ( "Pozbawiony/a jeste? prawa jazdy." , client )
return
elseif ( prawko_konto . prawko_oddane == 1 ) then -- UP ? YN ?? TERMIN PRAWKA
exports . DB : zapytanie ( "INSERT INTO es_kary_historia SET rodzaj='prawko', dbid=?,serial=?,nick=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerSerial ( client ), getPlayerName ( client ), prawko_konto . pozbawiony_prawka , "" , "konsola" )
exports . DB : zapytanie ( "DELETE FROM es_kary_prawka WHERE dbid=?" , id )-- ODDAWANIE PRAWKA
exports . DB : zapytanie ( "UPDATE es_gracze SET pozbawiony_prawka=? WHERE id=?" , nil , id )
nadajPrawko ( client , id )
end
else
nadajPrawko ( client , id )
end
end
end
function nadajPrawko ( client , id )
if not isElement ( client ) then return end
local autoryzacja = exports . DB : pobierzWyniki ( "SELECT prawko_teoria,prawko_praktyka_I,prawko_praktyka_II,prawko_A_teoria,prawko_praktyka_I_A,prawko_praktyka_II_A,prawko_CE_teoria,prawko_praktyka_I_CE,prawko_praktyka_II_CE FROM es_gracze WHERE id=?" , id )
if autoryzacja then
setElementData ( client , "prawko:teoria" , autoryzacja . prawko_teoria )
setElementData ( client , "prawko:praktyka:1" , autoryzacja . prawko_praktyka_I )
setElementData ( client , "prawko:praktyka:2" , autoryzacja . prawko_praktyka_II )
setElementData ( client , "prawko:A:teoria" , autoryzacja . prawko_A_teoria )
setElementData ( client , "prawko:praktyka:A1" , autoryzacja . prawko_praktyka_I_A )
setElementData ( client , "prawko:praktyka:A2" , autoryzacja . prawko_praktyka_II_A )
setElementData ( client , "prawko:CE:teoria" , autoryzacja . prawko_CE_teoria )
setElementData ( client , "prawko:praktyka:CE1" , autoryzacja . prawko_praktyka_I_CE )
setElementData ( client , "prawko:praktyka:CE2" , autoryzacja . prawko_praktyka_II_CE )
end
end
function autoryzujBana ( client , id , login )
if not isElement ( client ) then return end
local zbanowane_seriale = exports . DB : pobierzWyniki ( "SELECT od,do_d,do_d<NOW() ban_dezaktywowany,powod, nadal FROM es_kary_bany WHERE serial=? LIMIT 1" , getPlayerSerial ( client ))
if zbanowane_seriale then
--IF NIE UP ? YN ?? TERMIN BANA
if ( zbanowane_seriale . ban_dezaktywowany == 0 ) then
kickPlayer ( client , "Ban do " ..( zbanowane_seriale . do_d ).. " od " ..( zbanowane_seriale . nadal ).. ". Apeluj na emstories.pl" )
return
elseif ( zbanowane_seriale . ban_dezaktywowany == 1 ) then -- UP ? YN ?? TERMIN BANA
local dane = exports . DB : zapytanie ( "SELECT * FROM es_kary_bany WHERE dbid=?" , id )-- ODBANOWYWANIE
if dane then
exports . DB : zapytanie ( "DELETE FROM es_kary_bany WHERE serial=?" , getPlayerSerial ( client ))-- ODBANOWYWANIE
exports . DB : zapytanie ( "INSERT INTO es_kary_historia SET rodzaj='ban', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerName ( client ), getPlayerSerial ( client ), zbanowane_seriale . do_d , zbanowane_seriale . powod , zbanowane_seriale . nadal )
end
exports . DB : zapytanie ( "UPDATE es_gracze SET zbanowany=? WHERE id=?" , nil , id )
end
end
local zbanowane_konta = exports . DB : pobierzWyniki ( "SELECT dbid,od,do_d,do_d<NOW() ban_dezaktywowany,powod, nadal FROM es_kary_bany WHERE dbid=? LIMIT 1" , id )
if zbanowane_konta then
--IF NIE UP ? YN ?? TERMIN BANA
if ( zbanowane_konta . ban_dezaktywowany == 0 ) then
kickPlayer ( client , "Ban do " ..( zbanowane_konta . do_d ).. " od " ..( zbanowane_konta . nadal ).. ". Apeluj na emstories.pl" )
return
elseif ( zbanowane_konta . ban_dezaktywowany == 1 ) then -- UP ? YN ?? TERMIN BANA
exports . DB : zapytanie ( "INSERT INTO es_kary_historia SET rodzaj='ban', dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerSerial ( client ), getPlayerName ( client ), zbanowane_konta . do_d , zbanowane_konta . powod , zbanowane_konta . nadal )
local dane = exports . DB : zapytanie ( "SELECT * FROM es_kary_bany WHERE dbid=?" , id )-- ODBANOWYWANIE
if dane then
exports . DB : zapytanie ( "DELETE FROM es_kary_bany WHERE dbid=?" , id )
end
exports . DB : zapytanie ( "UPDATE es_gracze SET zbanowany=? WHERE id=?" , nil , id )
end
end
if not zbanowane_seriale and not zbanowane_konta then
local zbanowany = exports . DB : pobierzWyniki ( "SELECT zbanowany,zbanowany<NOW() ban_dezaktywowany FROM es_gracze WHERE id=? LIMIT 1" , id )
if zbanowany then
--IF NIE UP ? YN ?? TERMIN BANA :
if ( zbanowany . ban_dezaktywowany == 0 ) then
if not zbanowane_seriale then
exports . DB : zapytanie ( "INSERT INTO es_kary_bany SET dbid=?,nick=?,serial=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerName ( client ), getPlayerSerial ( client ), zbanowany , "logowanie na zbanowane konto: " .. login , "konsola" )
end
outputConsole ( "Zostajesz zbanowany/a za zalogowanie si? na konto, kt?re jest zbanowane, login do konta: " .. login , client )
kickPlayer ( client , "Ban do " .. zbanowany .. ". Apeluj na emstories.pl" )
return
elseif ( zbanowany . ban_dezaktywowany == 1 ) then -- UP ? YN ?? TERMIN BANA
exports . DB : zapytanie ( "INSERT INTO es_kary_historia SET rodzaj='ban', dbid=?,serial=?,nick=?,od=NOW(),do_d=?,powod=?,nadal=?" , id , getPlayerSerial ( client ), getPlayerName ( client ), zbanowany , "logowanie na zbanowane konto: " .. login , "konsola" )
local dane = exports . DB : zapytanie ( "SELECT * FROM es_kary_bany WHERE dbid=?" , id )-- ODBANOWYWANIE
if dane then
exports . DB : zapytanie ( "DELETE FROM es_kary_bany WHERE dbid=?" , id )-------- ODBANOWYWANIE
end
exports . DB : zapytanie ( "UPDATE es_gracze SET zbanowany=? WHERE id=?" , nil , id )
end
end
end
end
addEventHandler ( "onPlayerConnect" , root ,
function( playerNick , playerIP , playerUsername , playerSerial )
local zbanowane_seriale = exports . DB : pobierzWyniki ( "SELECT powod,nadal,do_d FROM es_kary_bany WHERE serial=? AND do_d>NOW() LIMIT 1" , playerSerial )
if not zbanowane_seriale then
return
end
local plr = getPlayerFromName ( playerNick )
outputConsole ( "============= BAN EMSTORIES =============" , plr )
outputConsole ( "Jeste? zbanowany/a na tym serwerze za:" , plr )
outputConsole ( zbanowane_seriale . powod , plr )
outputConsole ( "Przez: " .. zbanowane_seriale . nadal , plr )
outputConsole ( "Do: " .. zbanowane_seriale . do_d , plr )
outputConsole ( "Apelacje mo?na zamieszcza? pod adresem: emstories.pl" , plr )
outputConsole ( "=========================================" , plr )
kickPlayer ( plr , "Kliknij F8." )
end
)
--[[ addEventHandler ( "onPlayerConnect" , root ,
function( playerNick , playerIP , playerUsername , playerSerial )
local zbanowane_seriale = exports . DB : pobierzWyniki ( "SELECT powod,nadal,do_d,do_d>NOW() ban_trwa FROM es_kary_bany WHERE serial=?" , playerSerial )
if not zbanowane_seriale or ( zbanowane_seriale . ban_trwa == 0 ) then
return
end
local plr = getPlayerFromName ( playerNick )
outputConsole ( "============= BAN EMSTORIES =============" , plr )
outputConsole ( "Jeste? zbanowany/a na tym serwerze za:" , plr )
outputConsole ( zbanowane_seriale . powod , plr )
outputConsole ( "Przez: " .. zbanowane_seriale . nadal , plr )
outputConsole ( "Do: " .. zbanowane_seriale . do_d , plr )
outputConsole ( "Apelacje mo?na zamieszcza? pod adresem: emstories.pl" , plr )
outputConsole ( "=========================================" , plr )
kickPlayer ( plr , "Kliknij F8." )
end
)]]--
--[[ addCommandHandler ( "obanie" ,
function( plr )
local zbanowane_seriale = exports . DB : pobierzWyniki ( "SELECT powod,nadal,do_d,do_d>NOW() ban_trwa FROM es_kary_bany WHERE serial=?" , getPlayerSerial ( plr ))
outputChatBox ( tostring ( zbanowane_seriale ), plr )
outputChatBox ( tostring ( zbanowane_seriale . ban_trwa ), plr )
if not zbanowane_seriale or ( zbanowane_seriale . ban_trwa == 0 ) then
return
end
outputConsole ( "============= BAN EMSTORIES =============" , plr )
outputConsole ( "Jeste? zbanowany/a na tym serwerze za:" , plr )
outputConsole ( zbanowane_seriale . powod , plr )
outputConsole ( "Przez: " .. zbanowane_seriale . nadal , plr )
outputConsole ( "Do: " .. zbanowane_seriale . do_d , plr )
outputConsole ( "Apelacje mo?na zamieszcza? pod adresem: emstories.pl" , plr )
outputConsole ( "=========================================" , plr )
end
)]]--
Podpis
1000 DNI NA FORUM: 28.09.2018r.
100 POSTÓW NA FORUM: 01.12.2017r.
Wysłany: 2018-11-16, 10:48
CrimeProject
Wiek: 24 Na forum: 2760 dni Posty: 16
Nick w MP: Crime-Project
Piwa : 16
Podacie discordy swoje? Bedzie latwiej.
[ Dodano : 2018-11-16, 14:13 ]
Jestem w stanie zap?aci? za pomoc b?d? odbugowanie tego gma.
Ostatnio zmieniony przez Allansso 2018-11-16, 17:05, w całości zmieniany 1 raz
Tagi: ems
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: