Witajcie, dzisiaj chcia? bym was, poprosi? o pomoc w zrobieniu mojego pierwszego, panelu logowania. Stron? Clienta zrobi?em poprawnie, wszystko ?adnie dzia?a. Teraz tylko strona servera. Chchia? bym kogo? poprosi?, o nakierowanie mnie na w?a?ciwy kurs.
Dobra, zrobi?em bez tego matrixa, bo nei wiem gdzie wsadzic. Kod wygl?da tak:
function loguj ( player, user, pass )
local account = getAccount ( user, pass )
if ( account ~= false ) then
if (logIn ( player, account, pass ) == true) then
triggerClientEvent ( "pokaz", getRootElement())
else
outputChatBox ( "B??d w logowaniu!", player, 255, 255, 0 ) -- Output they got the details wrong.
end
else
outputChatBox ( "Z?y login lub has?o.!", player, 255, 255, 0 ) -- Output they got the details wrong.
end
end
addEvent( "loguj", true )
addEventHandler( "loguj", getRootElement(), loguj )
function rejestruj ( player, user, pass )
local account = getAccount ( user, pass )
if ( account ~= false ) then
if (logIn ( player, account, pass ) == true) then
triggerClientEvent ( "pokaz", getRootElement())
else
outputChatBox ( "B??d logowania!", player, 255, 255, 0 ) -- Output they got the details wrong.
end
else
account = addAccount ( user, pass )
if (logIn ( player, account, pass ) == true) then
triggerClientEvent ( "pokaz", getRootElement())
else
outputChatBox ( "Logowanie/Rejstracja, nie powiod?y si? !", player, 255, 255, 0 ) -- Output they got the details wrong.
end
end
end
addEvent( "rejestruj", true )
addEventHandler( "rejestruj", getRootElement(), onRegister )
Strona Serwera.
function pokaz()
for id, playeritem in ipairs(getElementsByType("player")) do
end
guiSetVisible(GUIEditor_Image[1], GUIEditor_Image[3] , true)
showCursor(true)
end
addEventHandler("onClientResourceStart",getRootElement(),pokaz)
function loguj()
local login = guiGetText(GUIEditor_Edit[1])
local haslo = guiGetText(GUIEditor_Edit[2])
if login~= "" and haslo ~= "" then
triggerServerEvent("loguj", getLocalPlayer(), login,haslo,getLocalPlayer())
end
end
addEventHandler( "onClientGUIClick", GUIEditor_Button[1], loguj )
function rejestruj()
local reje = guiGetText(GUIEditor_Edit[1])
local haslo = guiGetText(GUIEditor_Edit[2])
if reje ~= "" and haslo ~= "" then
triggerServerEvent("rejestruj", getLocalPlayer(), reje,haslo,getLocalPlayer())
end
end
addEventHandler( "onClientGUIClick", GUIEditor_Button[2], rejestruj )
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