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

Wysłany: 2016-08-10, 11:38


NeroNix







Wiek: 27
Na forum: 3614 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
Witam u?ywam panelu logowania, kt?ry jest tutaj na forum i mam jeden problem. Nie chce on teleportowa?..

local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function renderZoneBox()
    dxDrawImage(0/1440*sx0/900*sy1440/1440*sx900/900*sy"tlo.png"000tocolor(255255255255), false)
    if data.info then dxDrawText(data.infosx*252/1024sy*232/768sx*800/1024sy*255/768tocolor(23700255), 1.00"default""center""center"falseend
    if not isMouseIn(sx*98/1024sy*294/768sx*225/1024sy*92/768then dxDrawRectangle(sx*98/1024sy*294/768sx*225/1024sy*92/768tocolor(353535193), false)
    else dxDrawRectangle(sx*98/1024sy*294/768sx*225/1024sy*92/768tocolor(0155200193), falseend
    if not isMouseIn(sx*415/1024sy*294/768sx*225/1024sy*92/768then dxDrawRectangle(sx*415/1024sy*294/768sx*225/1024sy*92/768tocolor(353535193), false)
    else dxDrawRectangle(sx*415/1024sy*294/768sx*225/1024sy*92/768tocolor(0155200193), falseend
    if not isMouseIn(sx*710/1024sy*294/768sx*225/1024sy*92/768then dxDrawRectangle(sx*710/1024sy*294/768sx*225/1024sy*92/768tocolor(353535193), false)
    else dxDrawRectangle(sx*710/1024sy*294/768sx*225/1024sy*92/768tocolor(0155200193), falseend
    dxDrawText("San Fierro"sx*98/1024sy*293/768sx*323/1024sy*386/768white1.00"default-bold""center""center"false)
    dxDrawText("Przechowywalnia"sx*416/1024sy*293/768sx*641/1024sy*386/768white1.00"default-bold""center""center"false)
    dxDrawText("Urz?d"sx*712/1024sy*293/768sx*937/1024sy*386/768white1.00"default-bold""center""center"false)
end

addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*98/1024sy*294/768sx*225/1024sy*92/768) and data.showed then
            setElementData(localPlayer,"spawnPlayer",{-1936.03883.5138.51})
            closeZones()
        end
        if isMouseIn(sx*415/1024sy*294/768sx*225/1024sy*92/768) and data.showed then
            setElementData(localPlayer,"player:spawn",{-2058.26466.3635.17})
            closeZones()
        end
        if isMouseIn(sx*710/1024sy*294/768sx*225/1024sy*92/768) and data.showed then
            setElementData(localPlayer,"player:spawn",{-1903.52486.8635.17})
               closeZones()
        end
    end
end)

function closeZones()
    showChat(true);
    showCursor(false);
    fadeCamera(false);
    setCameraTarget localPlayer )
    stopSound(data.misc)
    showPlayerHudComponent("all",true)
    showPlayerHudComponent("money",false)
    data.showed=false

    setTimer(triggerServerEvent20001"core:spawningPlayer"localPlayer)
    removeEventHandler("onClientRender"rootrenderZoneBox)
end

function showZones(misc)
    data.misc=misc
    data.showed=true
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    addEventHandler("onClientRender"rootrenderZoneBoxend

Za pomoc R* i :piwo: DB3 nic nie pokazuje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-10, 11:54


Brzysiek

Skrypter pralek






Wiek: 27
Na forum: 5198 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360

Poka? stron? serwera

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-10, 12:14


NeroNix







Wiek: 27
Na forum: 3614 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
Brzysiek,
C_logging

local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

local dist 10    
local angler 0
function getPointFromDistanceRotation(xydistangler)
    local a math.rad(20 angler)
    local dx math.cos(a) * dist;
    local dy math.sin(a) * dist;
    return x+dxy+dy;
end

function renderLoginBox()
    dxDrawImage(001366775"tlo.png"000tocolor(255255255255), false)
    if data.info then dxDrawText(data.infosx*252/1024sy*222/768sx*800/1024sy*255/768tocolor(2370155255), 1.00"default""center""center"falseend
    dxDrawText("Login U?ytkownika:"522348788394tocolor(255255255255), 1.00"default-bold""left""top"falsefalsefalsefalsefalse)
    dxDrawText("Has?o U?ytkownika:"522440788476tocolor(255255255255), 1.00"default-bold""left""top"falsefalsefalsefalsefalse)
    if not isMouseIn(77837516542then dxDrawRectangle(77837516542tocolor(353535193), false)
    else dxDrawRectangle(77837516542tocolor(051169150), falseend
    if not isMouseIn(77847016540then dxDrawRectangle(77847016540tocolor(353535193), false)
    else dxDrawRectangle(77847013540tocolor(0511691150), falseend
    dxDrawText("Zaloguj"836389973422tocolor(255235255255), 1.00"default-bold""left""top"falsefalsefalsefalsefalse)
    dxDrawText("Zarejestruj"8304801014515tocolor(2535255255255), 1.00"default-bold""left""top"falsefalsefalsefalsefalse)

    local x,y=getPointFromDistanceRotation(1479.85486,-1700.9080distangler)
    setCameraMatrix(x,y,50)
    angler=(angler+0.1)
end
    
    
addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(77837516542) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info=" "
                return
            end
            triggerServerEvent("onServerPlayerLogin"resourceRootloginpass)
        end
        if isMouseIn(77847016540) and data.showed then
            local login=guiGetText(data.button[1])
            local pass=guiGetText(data.button[2])
            if string.len(login) < or string.len(pass) < 2 then
                data.info=" "
                return
            end
            if string.len(login) > 22 or string.len(pass) > 30 then
                data.info="Login/Has?o musi mie? mniej ni? 22/30 znak?w."
                return
            end
            triggerServerEvent("onServerPlayerRegister"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)
        
        destroyElement(data.button[1])
        destroyElement(data.button[2])
        removeEventHandler("onClientRender"rootrenderLoginBox)
    else
        data.info=tostring(info)
        setTimer(function() data.info=nil end30001)
    end
end)


addEventHandler("onClientResourceStart"resourceRoot, function()
    showChat(false)
    showCursor(true)
    fadeCamera(true)
    data.showed=true
    showPlayerHudComponent("all",false)
    setElementAlpha(localPlayer,0)
    data.misc=playSound("misc/intro.mp3",true)
    setSoundVolume(data.misc1.0)
    guiSetInputMode("no_binds_when_editing")
    setElementData(localPlayer,"status","Loguje si?")
    setElementData(localPlayer,"player:logged",false)
    addEventHandler("onClientRender"rootrenderLoginBox)
    data.button[1] = guiCreateEdit(44437529239""false)
    data.button[2] = guiCreateEdit(44447029240""falseend)

addEvent("hideLoginWindow"true)
addEventHandler("hideLoginWindow"getResourceRootElement(getThisResource()), hideLoginWindow)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-10, 13:37


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
Drugi raz pokaza?e? to samo...

Poka? plik o nazwie "S_logging"

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-10, 15:16


NeroNix







Wiek: 27
Na forum: 3614 dni
Posty: 69

Piwa: 1

Respekt: 40,5

Ostrzeżeń: 100%
_Wicek_,
U g?ry da?em kod c_zone.lua
Nad tym tematem c_logging.lua
a w s_logging.lua nic nie ma dotycz?cego teleportacji xD

s_logging

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


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-19, 04:03


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4049 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

Respekt: 460
Respekt: 460

Mo?e masz ?le baz? wgrano czyli lub mo?e zmieni?e? nazw? db mo?e masz ogrpg-db lub inn? mo?e dlatego nie zadzia?a? bo u mnie dzia?a jak powinno

Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Tagi: brak :: teleportacji
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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