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

Wysłany: 2020-04-14, 16:58


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Witam ot??, jak naprawi? usuwanie maj?tku w panelu ogrpg, maj?tek usuwa gdy wyjdziemy podczas wybierania spawna.
Kod
c_side

if getElementData(localPlayer"player:uid"then return end

local root getRootElement()
local blur exports['blur']
local dxfont0_1 dxCreateFont("font/1.ttf"12)
local dxfont1_1 dxCreateFont("font/1.ttf"14)
local resourceRoot getResourceRootElement(getThisResource())
local screenWidthscreenHeight guiGetScreenSize()
ogloszenie=[[Witaj na serwerze It's Your World!

Adres forum; mta-its.pl
Adres ts3; iy-w.pl
Wersja serwera; 1.0

W?a?ciciele serwera;
- Rusek
- Shaman
- Kurianusz
- CrosRoad95


CREDITS;
Graphic; © Maker

Copyright © It's Your World
Wszelkie prawa zastrze?one!
]]

local blurStrength 2

local function isNumber(tekst)   --- Prosta funkcja by Kurianusz sprawdza czy tekst to liczby
    return (string.match(tekst,"[^%d]") == nilend

local myScreenSource dxCreateScreenSource(screenWidthscreenHeight)
blurShaderblurTec dxCreateShader("shaders/BlurShader.fx")


function renderblur()
    if blur == true then
        dxUpdateScreenSource(myScreenSource)

        dxSetShaderValue(blurShader"ScreenSource"myScreenSource);
        dxSetShaderValue(blurShader"BlurStrength"blurStrength);
        dxSetShaderValue(blurShader"UVSize"screenWidthscreenHeight);

        dxDrawImage(00screenWidthscreenHeightblurShader)
    end
end
addEventHandler("onClientRender"rootrenderblur)

addEventHandler("onClientResourceStop"resourceRoot,
function()
    if (blurShader) and blur then
        destroyElement(blurShader)
        blurShader nil
    end
end)

--x,y=2075.74,-1187.70-- my width
--intro_step=math.random(0,850)

local dxfont0_CaviarDreams_Bold dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf"10)
local dxfont1_CaviarDreams_Bold dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf"30)
local dxfont2_CaviarDreams_Bold dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf"20)
local dxfont3_CaviarDreams_Bold dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf"9)
local dxfont4_CaviarDreams_Bold dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf"10)
local dxfont6_CaviarDreams_Bold dxCreateFont(":guied/fonts/CaviarDreams_Bold.ttf"11)
local screenWscreenH guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=niltick=getTickCount(), checkbox={} }

function isMouseIn(pscreenW,pscreenH,psscreenW,psscreenH,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*screenW,cy*screenH
    if cx >= pscreenW and cx <= pscreenW+psscreenW and cy >= pscreenH and cy <= pscreenH+psscreenH then
        return true,cx,cy
    else
        return false
    end
end
local dist 400
local angler 0
function getPointFromDistanceRotation(xydistangler)
    local a math.rad(270 angler)
    local dx math.cos(a) * dist;
    local dy math.sin(a) * dist;
    return x+dxy+dy;
end

function getCenter(screenW,screenH)
    local screenWscreenH guiGetScreenSize()
    local x= (screenW screenW) /2,(screenH screenH) /2
    return xy
end
poscreenW,poscreenH=getCenter(740,462)
function getCenter(screenW,screenH)
    local screenWscreenH guiGetScreenSize()
    local x= (screenW screenW) /2,(screenH screenH) /2
    return xy
end
poscreenWx,poscreenHy=getCenter(365,30)

mojeW,mojeH 1366768
sW,sH guiGetScreenSize()
w= (sW/mojeW), (sH/mojeH)

-- KUREK TUTAJ BUTTON OD ZAPAMI?TNIA HAS?A I LOGINU W LOGOWANIU 
--[[

GUIEditor = {
    checkbox = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        GUIEditor.checkbox[1] = guiCreateCheckBox(11044119521"Pami?taj mnie! (w trakcie prac)"truefalse)    
    end
)

addEventHandler("onClientRender"root,
    function()
        dxDrawRectangle(1262849643tocolor(255255255255), false)
    end
)

--]]

aktualnie="logowanie"
function renderLoginBox()
    if screenW 1024 and screenH 768 then
        setTime(2,0)
        blur false
        windowxwindowy=screenW/2-768/2screenH/2-350/2
        dxDrawRectangle(windowxwindowy768350tocolor(000200), false)
        dxDrawText("Aby zagra? na serwerze zmie? ro?dzielczo?? na min. 1024x768\nPrzepraszamy za utrudnienia."windowx+768/2windowy+350/2768350tocolor(25500200), 1.00"clear""center""center"falsetruefalsefalsefalse)
        return
    end
    setTime(2,0)
    blur false
        dxDrawImage(0*w0*h1370*w770*h"backg.png"000tocolor(255255255255), false)
        dxDrawLine((screenW 0.0000) - 1, (screenH 0.2093) - 1, (screenW 0.0000) - 1screenH 0.8306tocolor(2341834200), 1false)
        dxDrawLine(screenW 0.2182, (screenH 0.2093) - 1, (screenW 0.0000) - 1, (screenH 0.2093) - 1tocolor(2341834200), 1false)
        dxDrawLine((screenW 0.0000) - 1screenH 0.8306screenW 0.2182screenH 0.8306tocolor(2341834200), 1false)
        dxDrawLine(screenW 0.2182screenH 0.8306screenW 0.2182, (screenH 0.2093) - 1tocolor(2341834200), 1false)
        dxDrawRectangle(screenW 0.0000screenH 0.2093screenW 0.2182screenH 0.6213tocolor(100200), false)
        
        dxDrawText("Login", (screenW 0.0052) - 1, (screenH 0.3944) - 1, (screenW 0.0359) - 1, (screenH 0.4556) - 1tocolor(100200), 1.00dxfont0_CaviarDreams_Bold"left""center"falsefalsefalsefalsefalse)
        dxDrawText("Login", (screenW 0.0052) + 1, (screenH 0.3944) - 1, (screenW 0.0359) + 1, (screenH 0.4556) - 1tocolor(100200), 1.00dxfont0_CaviarDreams_Bold"left""center"falsefalsefalsefalsefalse)
        dxDrawText("Login", (screenW 0.0052) - 1, (screenH 0.3944) + 1, (screenW 0.0359) - 1, (screenH 0.4556) + 1tocolor(100200), 1.00dxfont0_CaviarDreams_Bold"left""center"falsefalsefalsefalsefalse)
        dxDrawText("Login", (screenW 0.0052) + 1, (screenH 0.3944) + 1, (screenW 0.0359) + 1, (screenH 0.4556) + 1tocolor(100200), 1.00dxfont0_CaviarDreams_Bold"left""center"falsefalsefalsefalsefalse)
        dxDrawText("Login"screenW 0.0052screenH 0.3944screenW 0.0359screenH 0.4556tocolor(255255255255), 1.00dxfont0_CaviarDreams_Bold"left""center"falsefalsefalsefalsefalse)
        dxDrawText("Has?o"screenW 0.0052screenH 0.4898screenW 0.0359screenH 0.5509tocolor(255255255255), 1.00dxfont0_CaviarDreams_Bold"left""center"falsefalsefalsefalsefalse)
        
        dxDrawLine((screenW 0.0104) - 1, (screenH 0.5935) - 1, (screenW 0.0104) - 1screenH 0.6315tocolor(2341834200), 1false)
        dxDrawLine(screenW 0.1964, (screenH 0.5935) - 1, (screenW 0.0104) - 1, (screenH 0.5935) - 1tocolor(2341834200), 1false)
        dxDrawLine((screenW 0.0104) - 1screenH 0.6315screenW 0.1964screenH 0.6315tocolor(2341834200), 1false)
        dxDrawLine(screenW 0.1964screenH 0.6315screenW 0.1964, (screenH 0.5935) - 1tocolor(2341834200), 1false)
        
        
        dxDrawLine((screenW 0.0104) - 1, (screenH 0.6500) - 1, (screenW 0.0104) - 1screenH 0.6880tocolor(2341834200), 1false)
        dxDrawLine(screenW 0.1964, (screenH 0.6500) - 1, (screenW 0.0104) - 1, (screenH 0.6500) - 1tocolor(2341834200), 1false)
        dxDrawLine((screenW 0.0104) - 1screenH 0.6880screenW 0.1964screenH 0.6880tocolor(2341834200), 1false)
        dxDrawLine(screenW 0.1964screenH 0.6880screenW 0.1964, (screenH 0.6500) - 1tocolor(2341834200), 1false)
        
        
        dxDrawText("Wejd? Do Gry", (screenW 0.0104) - 1, (screenH 0.5926) - 1, (screenW 0.1964) - 1, (screenH 0.6315) - 1tocolor(004190), 1.00dxfont0_CaviarDreams_Bold"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Wejd? Do Gry", (screenW 0.0104) + 1, (screenH 0.5926) - 1, (screenW 0.1964) + 1, (screenH 0.6315) - 1tocolor(004190), 1.00dxfont0_CaviarDreams_Bold"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Wejd? Do Gry", (screenW 0.0104) - 1, (screenH 0.5926) + 1, (screenW 0.1964) - 1, (screenH 0.6315) + 1tocolor(004190), 1.00dxfont0_CaviarDreams_Bold"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Wejd? Do Gry", (screenW 0.0104) + 1, (screenH 0.5926) + 1, (screenW 0.1964) + 1, (screenH 0.6315) + 1tocolor(004190), 1.00dxfont0_CaviarDreams_Bold"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Wejd? Do Gry"screenW 0.0104screenH 0.5926screenW 0.1964screenH 0.6315tocolor(255255255255), 1.00dxfont0_CaviarDreams_Bold"center""center"falsefalsefalsefalsefalse)
        
        dxDrawText("Utw?rz Konto"screenW 0.0104screenH 0.6491screenW 0.1964screenH 0.6880tocolor(255255255255), 1.00dxfont0_CaviarDreams_Bold"center""center"falsefalsefalsefalsefalse)
        dxDrawText("Zapami?taj Has?o"screenW 0.0620screenH 0.5602screenW 0.1240screenH 0.5741tocolor(255255255255), 1.00dxfont0_CaviarDreams_Bold"left""center"falsefalsefalsefalsefalse)
        
        dxDrawImage(screenW 0.0000screenH 0.2324screenW 0.0802screenH 0.1306":guied/images/logoMove.png"000tocolor(255255255255), false)
        dxDrawText("ove"screenW 0.0578screenH 0.3148screenW 0.0995screenH 0.3537tocolor(2392020255), 1.00dxfont1_CaviarDreams_Bold"left""top"falsefalsefalsefalsefalse)
        dxDrawText("RPG"screenW 0.1010screenH 0.3009screenW 0.1594screenH 0.3676tocolor(255255255255), 1.00dxfont2_CaviarDreams_Bold"left""bottom"falsefalsefalsefalsefalse)

        dxDrawLine((screenW 0.5224) - 1, (screenH 0.2972) - 1, (screenW 0.5224) - 1screenH 0.5315tocolor(2522022255), 1false)
        dxDrawLine(screenW 1.0000, (screenH 0.2972) - 1, (screenW 0.5224) - 1, (screenH 0.2972) - 1tocolor(2522022255), 1false)
        dxDrawLine((screenW 0.5224) - 1screenH 0.5315screenW 1.0000screenH 0.5315tocolor(2522022255), 1false)
        dxDrawLine(screenW 1.0000screenH 0.5315screenW 1.0000, (screenH 0.2972) - 1tocolor(2522022255), 1false)
        dxDrawRectangle(screenW 0.5224screenH 0.2972screenW 0.4776screenH 0.2343tocolor(000210), false)
        dxDrawText("Ostatnie News'y"screenW 0.5219screenH 0.2972screenW 1.0000screenH 0.3435tocolor(255255255255), 1.00dxfont6_CaviarDreams_Bold"center""center"falsefalsefalsefalsefalse)
        dxDrawText(" 1.Start Serwera 30.06.2019\n 2.\n 3.\n 4.\n 5.\n 6.\n 7.\n 8.", (screenW 0.5219) - 1, (screenH 0.3444) - 1, (screenW 1.0000) - 1, (screenH 0.5278) - 1tocolor(000210), 1.00dxfont6_CaviarDreams_Bold"left""top"falsetruefalsefalsefalse)
        dxDrawText(" 1.Start Serwera 30.06.2019\n 2.\n 3.\n 4.\n 5.\n 6.\n 7.\n 8.", (screenW 0.5219) + 1, (screenH 0.3444) - 1, (screenW 1.0000) + 1, (screenH 0.5278) - 1tocolor(000210), 1.00dxfont6_CaviarDreams_Bold"left""top"falsetruefalsefalsefalse)
        dxDrawText(" 1.Start Serwera 30.06.2019\n 2.\n 3.\n 4.\n 5.\n 6.\n 7.\n 8.", (screenW 0.5219) - 1, (screenH 0.3444) + 1, (screenW 1.0000) - 1, (screenH 0.5278) + 1tocolor(000210), 1.00dxfont6_CaviarDreams_Bold"left""top"falsetruefalsefalsefalse)
        dxDrawText(" 1.Start Serwera 30.06.2019\n 2.\n 3.\n 4.\n 5.\n 6.\n 7.\n 8.", (screenW 0.5219) + 1, (screenH 0.3444) + 1, (screenW 1.0000) + 1, (screenH 0.5278) + 1tocolor(000210), 1.00dxfont6_CaviarDreams_Bold"left""top"falsetruefalsefalsefalse)
        dxDrawText(" 1.Start Serwera 30.06.2019\n 2.\n 3.\n 4.\n 5.\n 6.\n 7.\n 8."screenW 0.5219screenH 0.3444screenW 1.0000screenH 0.5278tocolor(255255255255), 1.00dxfont6_CaviarDreams_Bold"left""top"falsetruefalsefalsefalse)    
    

    if getTickCount()<data.tick then
        dxDrawText(data.info, (screenW 0.0000) - 1, (screenH 0.3759) - 1, (screenW 0.2151) - 1, (screenH 0.4009) - 1tocolor(10100255), 1.00dxfont3_CaviarDreams_Bold"center""top"falsefalsefalsefalsefalse)
        dxDrawText(data.info, (screenW 0.0000) + 1, (screenH 0.3759) - 1, (screenW 0.2151) + 1, (screenH 0.4009) - 1tocolor(10100255), 1.00dxfont3_CaviarDreams_Bold"center""top"falsefalsefalsefalsefalse)
        dxDrawText(data.info, (screenW 0.0000) - 1, (screenH 0.3759) + 1, (screenW 0.2151) - 1, (screenH 0.4009) + 1tocolor(10100255), 1.00dxfont3_CaviarDreams_Bold"center""top"falsefalsefalsefalsefalse)
        dxDrawText(data.info, (screenW 0.0000) + 1, (screenH 0.3759) + 1, (screenW 0.2151) + 1, (screenH 0.4009) + 1tocolor(10100255), 1.00dxfont3_CaviarDreams_Bold"center""top"falsefalsefalsefalsefalse)
        dxDrawText(data.infoscreenW 0.0000screenH 0.3759screenW 0.2151screenH 0.4009tocolor(255255255255), 1.00dxfont3_CaviarDreams_Bold"center""top"falsefalsefalsefalsefalse)    
    end
    local x,y=getPointFromDistanceRotation(1838.10, -1564.02distangler)
    setCameraMatrix(x,y,120, -1564.0260.57)
    angler=(angler+0.05)
end





addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(screenW 0.0104screenH 0.5935screenW 0.1859screenH 0.0380) and data.showed then
                local login=guiGetText(data.button[1])
                local pass=guiGetText(data.button[2])
                local zapamietaj=guiCheckBoxGetSelected(data.button[3])
                --local checkbox guiCreateCheckBox(590*w462*h188*w46*h"Pami?taj mnie! (w trakcie prac)"truefalse)  
                if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 3 then
                    data.info="Login i/lub has?o musz? mie? od 3 do 22 znak?w."
                    data.tick=getTickCount()+5000
                    return
                end
                triggerServerEvent("logging:checkAccount"resourceRootloginpasszapamietaj)
         elseif isMouseIn(screenW 0.0104screenH 0.6500screenW 0.1859screenH 0.0380) and data.showed then
                local login=guiGetText(data.button[1])
                local pass=guiGetText(data.button[2])
                if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 3 then
                    data.info="Login i/lub has?o musz? mie? od 3 do 22 znak?w."
                    data.tick=getTickCount()+5000
                    return
                end
                triggerServerEvent("logging:newAccount"resourceRootloginpass)
        end
    end
end)

addEvent("logging:result"true)
addEventHandler("logging:result"resourceRoot, function(value,info)
    if not info then info="" end
    if value then
        data.showed=false
        showZones(data.misc)
        -- Usuwamy elementy
        local time getRealTime()
        setTime(time.hour,time.minute)
        destroyElement(data.button[1])
        destroyElement(data.button[2])
        destroyElement(data.button[3])
        removeEventHandler("onClientRender"rootrenderLoginBox)
    else
        data.info=info
        data.tick=getTickCount()+5000
    end
end)

addEventHandler("onClientResourceStart"resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc0.5)
    setPlayerHudComponentVisible("all",false)
    guiSetInputMode("no_binds_when_editing")
    --setElementData(localPlayer,"status","Loguje si?")
    --setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    if screenW 1024 and screenH 768 then return end
    data.button[1]=guiCreateEdit(0.050.410.130.04""true)
    data.button[2]=guiCreateEdit(0.050.500.130.04""true)
    data.button[3]=guiCreateCheckBox(0.130.560.010.01"Zapami?taj mnie"falsetrue)
    guiEditSetMasked(data.button[2], true)
    loadSavedAccount()
    localPlayer:setData("player:hud_visible"true)
end)

addEvent("createsaved:login",true)
addEventHandler("createsaved:login",localPlayer,function(l,h)
if not fileExists("savedpassword.txt"then
local file=fileCreate("savedpassword.txt")
if file then
str=""..l..","..teaEncode(h"6N5u7MCtZgp3PbJVvJKbzuDk")..""
if not fileWrite(filestrthen
fileDelete("savedpassword.txt")
end
fileClose(file)
end
end
end)

function loadSavedAccount()
if File.exists("savedpassword.txt"then
file fileOpen("savedpassword.txt"true)
if not file then return end
local txt fileRead(filefileGetSize(file)) or "" 
local tabela=split(txt",")
guiSetText(data.button[1], tabela[1])
guiSetText(data.button[2], teaDecode(tabela[2], "6N5u7MCtZgp3PbJVvJKbzuDk"))
guiCheckBoxSetSelected(data.button[3],true)
fileClose(file)
end
end

addEvent("deletesaved:login",true)
addEventHandler("deletesaved:login",localPlayer,function()
if fileExists("savedpassword.txt"then
fileDelete("savedpassword.txt")
end
end)

s_side



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 and #x > 0 then
local t split(x[1].spawn",")
    return t
end
return false
end

function getAdmin(plr,level)
    if level then
        local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=? AND level=?"getPlayerSerial(plr), level)
        if result and #result > 0 then
            return true
        else
            return false
        end
    else
        local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=?"getPlayerSerial(plr))
        if result and #result > 0 then
            return true
        else
            return false
        end
    end
end

addEvent("logging:checkAccount"true)
addEventHandler("logging:checkAccount"resourceRoot, function(login,pass,save)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        serial=getPlayerSerial(client)
        if result[1].register_serial~=serial then
            tak=true
            for i,v in ipairs(split(result[1].seriale,",")) do
                if v==serial then tak=false end
            end
            if tak then
                return triggerClientEvent(client"logging:result"resourceRootfalse"Nie mo?esz si? zalogowa? na to konto!","nope")
            end
        end
        if result[1].login == login and result[1].pass == md5(passthen
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Ryjek"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Trujeczka"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"*****"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"*****"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"wypierdalacchuje"),login)
            triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"wypierdalacchuje"then
            for i,player in pairs(getElementsByType("player")) do
                if getElementData(player,"player:uid") == result[1].id then
                triggerClientEvent(client"logging:result"resourceRootfalse"Kto? jest zalogowany na to konto!!!!!.","blad")
                return
            end
            end
            --local result2=exports['ogrpg-db']:dbGet("SELECT login2 from ogrpg_users where id=?",result[1].id)
            if result[1].login2 == false then
            setPlayerName(clientlogin)
            else
            setPlayerName(clientresult[1].login2)
            triggerClientEvent(client"iyw_notifications:send"client"info""Wykupiono us?uge zmiana pseudonimu, tw?j nick to: "..result[1].login2.."")
            end
            q=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
            exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=logowania_nagroda+1 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
            q3=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
            if(tonumber(q[1].logowania_nagroda)<q3[1].logowania_nagroda)then
                nagrody[q3[1].logowania_nagroda](client)
                if(q3[1].logowania_nagroda==7)then
                    exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
                end
            else
                exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online)<DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
            end
            if(savethen
                triggerClientEvent(client"createsaved:login",client,login,pass)
            else
                triggerClientEvent(client"deletesaved:login",client)
            end
            exports["ogrpg-db"]:dbSet("update ogrpg_users set ostatnio_online=NOW() where id=?"result[1].id)
            setElementData(client"player:uid"result[1].id)
            triggerClientEvent(client"logging:result"resourceRoottrue"Zalogowa?e? si? pomyslnie","git")
            triggerEvent("SprawdzDom",root,client)
            setElementData(client,"player:organization:spawn",sprawdzorganizacje(client))
            setElementData(client,"p:title",result[1].rp_tytul)
            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"resourceRootfalse"Podane dane s? nieprawid?owe.","blad")
        end
    else
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login nie istnieje w bazie.","blad")
    end
end)
local maks_ilosc_kont -- Maksymalna ilosc kont do rejestracji
addEvent("logging:newAccount"true)
addEventHandler("logging:newAccount"resourceRoot, function(login,pass)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE register_serial=?"getPlayerSerial(client))
    if result and #result >= maks_ilosc_kont then
        triggerClientEvent(client"logging:result"resourceRootfalse"Na ten serial zostala utworzona maksymalna ilosc kont.","blad")
    return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        triggerClientEvent(client"logging:result"resourceRootfalse"Podany login ju? istnieje w bazie.","blad")
    else
        local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass,register_serial,changedpw) VALUES (?,?,?,?)"loginteaEncode(pass,"wypierdalacchuje"),getPlayerSerial(client),1)
        if query then
            triggerClientEvent(client"logging:result"resourceRootfalse"Pomyslnie zarejestrowales(as) sie!","git")
            setElementData(client"player:logged"true)
        end
    end
end)


nagrody={
[1]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To twoj pierwszy dzien kiedy jestes u nas pod rzad! Niedlugo otrzymasz na nagrode")
end,
[2]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j drugi dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 500PLN!")
    plr:giveMoney(500)
end,
[3]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j trzeci dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 600PLN!")
    plr:giveMoney(600)
end,
[4]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j czwarty dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 750PLN!")
    plr:giveMoney(750)
end,
[5]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j pi?ty dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 900PLN!")
    plr:giveMoney(900)
end,
[6]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j sz?sty dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 1000PLN!")
    plr:giveMoney(1000)
end,
[7]=function(plr)
    triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j si?dmy dzie? kiedy jeste? u nas pod rz?d! 1 punkt premium!")
    exports["ogrpg-db"]:dbSet("update ogrpg_users set pp=pp+1 where id=? limit 1",plr:getData("player:uid"))
end,
 
}


[ Dodano: 2020-04-14, 16:59 ]
I tutaj c_zone, bo na gtao nie mog?em tego doda? (error z "Twoja wiadomo?? jest zad?uga maksymalnie 35000znak?w".
https://pastebin.com/wx3JrX6C

Podpis
amta
Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-14, 17:19


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Zapewne dopiero po wyborze spawnu wczytuje dane z konta. Musisz je przenie?? aby od razu po zalogowaniu

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-14, 17:26


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Qwertick, a nie wiesz gdzie ta element data, czy co? na ogrpg, bo tego doszuka? nie mg.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-04-14, 21:30


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Zobacz to
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 and #x > 0 then
    local t split(x[1].spawn",")
        return t
    end
    return false
    end
    
    function getAdmin(plr,level)
        if level then
            local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=? AND level=?"getPlayerSerial(plr), level)
            if result and #result > 0 then
                return true
            else
                return false
            end
        else
            local result=exports["ogrpg-db"]:dbGet("SELECT * from ogrpg_admins WHERE serial=?"getPlayerSerial(plr))
            if result and #result > 0 then
                return true
            else
                return false
            end
        end
    end
    
    addEvent("logging:checkAccount"true)
    addEventHandler("logging:checkAccount"resourceRoot, function(login,pass,save)
        local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
        if result and #result > 0 then
            serial=getPlayerSerial(client)
            if result[1].register_serial~=serial then
                tak=true
                for i,v in ipairs(split(result[1].seriale,",")) do
                    if v==serial then tak=false end
                end
                if tak then
                    return triggerClientEvent(client"logging:result"resourceRootfalse"Nie mo?esz si? zalogowa? na to konto!","nope")
                end
            end
            if result[1].login == login and result[1].pass == md5(passthen
                local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
                triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
                return
            end
            if result[1].login == login and result[1].pass == teaEncode(pass,"Ryjek"then
                local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
                triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
                return
            end
            if result[1].login == login and result[1].pass == teaEncode(pass,"Trujeczka"then
                local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"*****"),login)
                triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
                return
            end
            if result[1].login == login and result[1].pass == teaEncode(pass,"*****"then
                local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"wypierdalacchuje"),login)
                triggerClientEvent(client"logging:result"resourceRootfalse"Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","git")
                return
            end
            if result[1].login == login and result[1].pass == teaEncode(pass,"wypierdalacchuje"then
                for i,player in pairs(getElementsByType("player")) do
                    if getElementData(player,"player:uid") == result[1].id then
                    triggerClientEvent(client"logging:result"resourceRootfalse"Kto? jest zalogowany na to konto!!!!!.","blad")
                    return
                end
                end
                --local result2=exports['ogrpg-db']:dbGet("SELECT login2 from ogrpg_users where id=?",result[1].id)
                if result[1].login2 == false then
                setPlayerName(clientlogin)
                else
                setPlayerName(clientresult[1].login2)
                triggerClientEvent(client"iyw_notifications:send"client"info""Wykupiono us?uge zmiana pseudonimu, tw?j nick to: "..result[1].login2.."")
                end
                q=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
                exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=logowania_nagroda+1 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
                q3=exports["ogrpg-db"]:dbGet("select logowania_nagroda from ogrpg_users where id=? limit 1",result[1].id)
                if(tonumber(q[1].logowania_nagroda)<q3[1].logowania_nagroda)then
                    nagrody[q3[1].logowania_nagroda](client)
                    if(q3[1].logowania_nagroda==7)then
                        exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online) = DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
                    end
                else
                    exports["ogrpg-db"]:dbSet("update ogrpg_users set logowania_nagroda=0 WHERE DATE(ostatnio_online)<DATE(NOW() - INTERVAL 1 DAY) and id=? limit 1",result[1].id)
                end
                if(savethen
                    triggerClientEvent(client"createsaved:login",client,login,pass)
                else
                    triggerClientEvent(client"deletesaved:login",client)
                end
                exports["ogrpg-db"]:dbSet("update ogrpg_users set ostatnio_online=NOW() where id=?"result[1].id)
                setElementData(client"player:uid"result[1].id)
                triggerClientEvent(client"logging:result"resourceRoottrue"Zalogowa?e? si? pomyslnie","git")
                triggerEvent("load:player"client)
                triggerEvent("SprawdzDom",root,client)
                setElementData(client,"player:organization:spawn",sprawdzorganizacje(client))
                setElementData(client,"p:title",result[1].rp_tytul)
                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"resourceRootfalse"Podane dane s? nieprawid?owe.","blad")
            end
        else
            triggerClientEvent(client"logging:result"resourceRootfalse"Podany login nie istnieje w bazie.","blad")
        end
    end)
    local maks_ilosc_kont -- Maksymalna ilosc kont do rejestracji
    addEvent("logging:newAccount"true)
    addEventHandler("logging:newAccount"resourceRoot, function(login,pass)
        local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE register_serial=?"getPlayerSerial(client))
        if result and #result >= maks_ilosc_kont then
            triggerClientEvent(client"logging:result"resourceRootfalse"Na ten serial zostala utworzona maksymalna ilosc kont.","blad")
        return end
        local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
        if result and #result > 0 then
            triggerClientEvent(client"logging:result"resourceRootfalse"Podany login ju? istnieje w bazie.","blad")
        else
            local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass,register_serial,changedpw) VALUES (?,?,?,?)"loginteaEncode(pass,"wypierdalacchuje"),getPlayerSerial(client),1)
            if query then
                triggerClientEvent(client"logging:result"resourceRootfalse"Pomyslnie zarejestrowales(as) sie!","git")
                setElementData(client"player:logged"true)
                triggerEvent("load:player"client)
            end
        end
    end)
    
    
    nagrody={
    [1]=function(plr)
        triggerClientEvent(client"iyw_notifications:send"client"info""To twoj pierwszy dzien kiedy jestes u nas pod rzad! Niedlugo otrzymasz na nagrode")
    end,
    [2]=function(plr)
        triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j drugi dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 500PLN!")
        plr:giveMoney(500)
    end,
    [3]=function(plr)
        triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j trzeci dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 600PLN!")
        plr:giveMoney(600)
    end,
    [4]=function(plr)
        triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j czwarty dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 750PLN!")
        plr:giveMoney(750)
    end,
    [5]=function(plr)
        triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j pi?ty dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 900PLN!")
        plr:giveMoney(900)
    end,
    [6]=function(plr)
        triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j sz?sty dzie? kiedy jeste? u nas pod rz?d! Otrzymujesz 1000PLN!")
        plr:giveMoney(1000)
    end,
    [7]=function(plr)
        triggerClientEvent(client"iyw_notifications:send"client"info""To tw?j si?dmy dzie? kiedy jeste? u nas pod rz?d! 1 punkt premium!")
        exports["ogrpg-db"]:dbSet("update ogrpg_users set pp=pp+1 where id=? limit 1",plr:getData("player:uid"))
    end,
     
    }

I jeszcze musisz usun?? z ogrpg-core/s.base t? linijk?
    local load=loadPlayerData(client)
    if load then     triggerClientEvent(client,"addNotification",root,"* Wczytano Twoje dane","info"end


Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Pyrek24
Wysłany: 2020-04-14, 23:36


Pyrek24







Wiek: 25
Na forum: 3438 dni
Posty: 546
Nick w MP: Pyrek

Piwa: 10

Respekt: 50

Qwertick dalej to samo, jak wyjd? podczas wyboru spawnu to nie zapisuje.

[ Dodano: 2020-04-15, 19:43 ]
Qwertick, doda?em root, do triggera i dzia?a dzi?ki.

[ Dodano: 2020-04-15, 21:06 ]
Temat do zamkni?cia.

Postaw piwo autorowi tego posta
 

 
Tagi: usuwa :: majątek
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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