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

Wysłany: 2015-08-29, 19:33


LorrettoPL







Wiek: 32
Na forum: 4560 dni
Posty: 8
Nick w MP: Hexi

Piwa: 1

Respekt: 60

Je?li umie?ci?em to w niew?a?ciwym dziale prosz? o przeniesienie :) .

Witam zaczynam si? uczy? lua i ostatnio stworzy?em skrypt na panel logowania ale jak wchodz? na serwer gdzie ten panel logowania jest w??czony to dzia?a muzyczka i obraz i w og?le ale nie pojawia si? w og?le gui ?? ? czemu
Prosz? o pomoc.

Client
Kod:



function cameraMoveSoft(camPosX, camPosY, camPosZ, newCamPosX, newCamPosY, newCamPosZ, camLookX, camLookY, camLookZ, newCamLookX, newCamLookY, newCamLookZ, typeCameraMove)
local x = 0
local y = 0

function moveCamera()
x = x + 0.00011
y = y + 0.1000
local cameraX, cameraY, cameraZ = interpolateBetween(camPosX, camPosY, camPosZ, newCamPosX, newCamPosY, newCamPosZ, x, "Linear")
local lookX, lookY, lookZ = interpolateBetween(camLookX, camLookY, camLookZ, newCamLookX, newCamLookY, newCamLookZ, y, "Linear")
setCameraMatrix(cameraX, cameraY, cameraZ, lookX, lookY, lookZ)
if cameraX == newCamPosX and cameraY == newCamPosY and cameraZ == newCamPosZ and lookX == newCamLookX and lookY == newCamLookY and lookZ == newCamLookZ then
removeEventHandler("onClientRender", getRootElement(), moveCamera)
end
end
addEventHandler("onClientRender", getRootElement(), moveCamera)

end


cameraMoveSoft(-2681,1408,70, -2681,2122, 100, 0, 0, 0, 0, 200000, 0, "Linear")


showPlayerHudComponent ( "all", false )
local localPlayer = getLocalPlayer()

sound = playSound("logowanie.mp3")
setSoundVolume(sound, 100)

GUIEditor = {
staticimage = {},
label = {},
button = {},
window = {},
memo = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
local screenW, screenH = guiGetScreenSize()
GUIEditor.window[1] = guiCreateWindow(10, (screenH - 768) / 2, 318, 768, "Your Better Life - Twoje Lepsze ?ycie", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.staticimage[1] = guiCreateStaticImage(10, 42, 298, 137, ":guieditor/images/YBL.png", false, GUIEditor.window[1])
GUIEditor.memo[1] = guiCreateMemo(132, 311, 176, 31, "", false, GUIEditor.window[1])
GUIEditor.memo[2] = guiCreateMemo(132, 374, 176, 31, "", false, GUIEditor.window[1])
GUIEditor.label[1] = guiCreateLabel(0, 311, 153, 21, " Login", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[1], "default-bold-small")
GUIEditor.label[2] = guiCreateLabel(86, 373, 95, 42, "Has?o", false, GUIEditor.window[1])
guiSetFont(GUIEditor.label[2], "default-bold-small")
GUIEditor.button[1] = guiCreateButton(9, 434, 127, 30, "Zaloguj", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(146, 434, 162, 30, "Zarejestruj si?", false, GUIEditor.window[1])
GUIEditor.label[3] = guiCreateLabel(11, 743, 307, 15, "Logowanie dla serwera Your better Life by Hexi", false, GUIEditor.window[1])


GUIEditor.window[2] = guiCreateWindow(10, (screenH - 768) / 2, 318, 768, "Your Better Life - Twoje Lepsze ?ycie", false)
guiWindowSetSizable(GUIEditor.window[2], false)

GUIEditor.staticimage[2] = guiCreateStaticImage(10, 42, 298, 137, "zdjecia/logo.png", false, GUIEditor.window[2])
GUIEditor.memo[3] = guiCreateMemo(132, 311, 176, 31, "", false, GUIEditor.window[2])
GUIEditor.memo[4] = guiCreateMemo(132, 374, 176, 31, "", false, GUIEditor.window[2])
GUIEditor.label[4] = guiCreateLabel(0, 311, 153, 21, " Login", false, GUIEditor.window[2])
guiSetFont(GUIEditor.label[4], "default-bold-small")
GUIEditor.label[5] = guiCreateLabel(86, 373, 95, 42, "Has?o", false, GUIEditor.window[2])
guiSetFont(GUIEditor.label[5], "default-bold-small")
GUIEditor.button[3] = guiCreateButton(9, 434, 127, 30, "Zaloguj", false, GUIEditor.window[2])
GUIEditor.button[4] = guiCreateButton(146, 434, 162, 30, "Zarejestruj si?", false, GUIEditor.window[2])
GUIEditor.label[6] = guiCreateLabel(11, 743, 307, 15, "Logowanie dla serwera Your better Life by Hexi", false, GUIEditor.window[2])

guiSetVisible ( GUIEditor.window[1], false )

local localPlayer = getLocalPlayer ( )

function windowHandler( )
local playername = getPlayerName(localPlayer)

guiSetText(LoginUsername, "")
guiSetText(EditRegisterUsername, "")

guiSetText(LoginUsername, playername)
guiSetText(EditRegisterUsername, playername)

guiSetVisible ( GUIEditor.window[1], true )

guiSetInputEnabled(true)
showCursor ( true )
end

function onClickBtn ( button, state )
if (source == GUIEditor.button[1]) then
triggerServerEvent ( "onLogin", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword) )
end
end

function onClickBtn2 ( button, state )
if (source == GUIEditor.button[2]) then
triggerServerEvent ( "onRegister", getRootElement(), localPlayer, guiGetText(EditRegisterUsername), guiGetText(EditRegisterPassword))
end
end


function hideLoginWindow()
guiSetInputEnabled(false)
guiSetVisible ( GUIEditor.window[1], false )
showCursor ( false )
fadeCamera ( false, 2.0, 0, 0, 0)
setTimer (Kamera, 2000, 1 )
stopSound( sound )
end
addEvent( "hideLoginWindow", true )
addEventHandler( "hideLoginWindow", getRootElement(), hideLoginWindow )

addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler )

addEventHandler ( "onClientGUIClick", GUIEditor.button[1], onClickBtn, false )
addEventHandler ( "onClientGUIClick", GUIEditor.button[2], onClickBtn2, false )

function Kamera()
fadeCamera(true,5)
removeEventHandler("onClientRender", getRootElement(), moveCamera)
setCameraTarget(localPlayer )
showPlayerHudComponent ( "all", true )
end



Server


Kod:



function onLogin ( player, user, pass )
local account = getAccount ( user, pass )
if ( account ~= false ) then
if (logIn ( player, account, pass ) == true) then
triggerClientEvent ( "hideLoginWindow", getRootElement())
else
outputChatBox ( "Z?y Login lub Has?o", player, 255, 0, 0 )
end
else
outputChatBox ( "Zly login lub haslo!", player, 255, 0, 0 )
end
end

addEvent( "onLogin", true )
addEventHandler( "onLogin", getRootElement(), onLogin )

function onRegister ( player, user, pass )
local account = getAccount ( user, pass )
if ( account ~= false ) then
if (logIn ( player, account, pass ) == true) then
triggerClientEvent ( "hideLoginWindow", getRootElement())
else
outputChatBox ( "B??d Przy Rejestracji", player, 255, 0, 0 )
end
else
account = addAccount ( user, pass )
if (logIn ( player, account, pass ) == true) then
triggerClientEvent ( "hideLoginWindow", getRootElement())
else
outputChatBox ( "B??d przy Logowaniu/Rejestracji!", player, 255, 0, 0 )
end
end
end

addEvent( "onRegister", true )
addEventHandler( "onRegister", getRootElement(), onRegister )




Stawiam piwka za pomoc. :)

Ostatnio zmieniony przez LorrettoPL 2015-08-30, 12:09, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-29, 20:16


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
[prze]

[Nt]

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: logowania. :: niedziała! :: prosze :: pomoc!
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Panel Logowania. Niedziała! Prosze o pomoc! 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