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

Wysłany: 2013-02-26, 18:55


Mr.Varsit







Wiek: 28
Na forum: 4848 dni
Posty: 5



Respekt: 50

Witam wszystkich, mam pytanie w jaki spos?b moge po??czy? dwa skrypty aby dzia?a?y ze sob? . Stworzy?em zewn?trzny wygl?d okienka logowania :
Kod:

GUIEditor = {
memo = {},
button = {},
label = {},
window = {},
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(215, 115, 383, 238, "Witaj na Polskim Serwerze RPG w wersji 0.1 Beta !", false)
guiWindowSetMovable(GUIEditor.window[1], false)
guiWindowSetSizable(GUIEditor.window[1], false)
guiSetAlpha(GUIEditor.window[1], 0.90)

GUIEditor.memo[1] = guiCreateMemo(25, 122, 331, 36, "", false, GUIEditor.window[1])
GUIEditor.memo[2] = guiCreateMemo(25, 122, 331, 36, "", false, GUIEditor.window[1])
GUIEditor.memo[3] = guiCreateMemo(25, 122, 331, 36, "Haslo", false, GUIEditor.window[1])

GUIEditor.memo[4] = guiCreateMemo(0, -74, 55, 33, "", false, GUIEditor.memo[3])

GUIEditor.memo[5] = guiCreateMemo(25, 75, 332, 37, "Login", false, GUIEditor.window[1])
GUIEditor.button[6] = guiCreateButton(46, 168, 135, 44, "Zaloguj si?", false, GUIEditor.window[1])
GUIEditor.button[7] = guiCreateButton(201, 168, 136, 44, "Zarejestruj si?", false, GUIEditor.window[1])
GUIEditor.label[2] = guiCreateLabel(51, 34, 281, 33, "Je?eli chcesz rozpocz?? gre musisz si? zalogowa? . Nie masz konta? Zarejestruj si? !", false, GUIEditor.window[1])
guiLabelSetHorizontalAlign(GUIEditor.label[2], "left", true)
GUIEditor.label[3] = guiCreateLabel(288, 217, 95, 21, "By Varsit", false, GUIEditor.window[1])

end

Oraz

Skrypt logowania (niedorobiony):

Kod:

function loginPlayer(player, username, password, thePlayer)
local account = getAccount(username, password)
if (account ~= false) then
if (logIn(player, account, password) == true) then

fadeCamera ( player, false, 1.0, 0, 0, 0 )

setTimer ( fadeCamera, 5000, 1, player, true, 0.5 )

setElementFrozen(player, true)
setTimer( setCameraTarget,3200,1,player)

triggerClientEvent (player, "hideLoginWindow", getRootElement())
else
outputChatBox("Nieznany B??d! Skontaktuj si? z Mr.Varsitem!",player)
end

else
outputChatBox ("?le wpisale? login lub has?o!",player)
end
end

function ustawienieKameryOnPlayerJoin()
fadeCamera(source, true, 5)
setTimer ( fadeCamera, 5000, 1, source, true, 0.5 )
setCameraMatrix(source, 1000.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316)

end
addEventHandler("OnPlayerJoin" , getRootElement() , ustawienieKameryOnPlayerJoin)

function logoutHandler()
local accountname = getAccountName (getPlayerAccount(source))
if (isGuestAccount(getPlayerAccount(source)) == true) then
cancelEvent()
end
end
addEventHandler("onPlayerLogout",getRootElement(),logoutHandler)

addEvent("loginFromClient", true)
addEventHandler("loginFromClient", getRootElement(), loginPlayer)




Potrafiliby?cie mi w tym pom?c? Chodzi mi o to by przydzieli? klawiszom funkcje .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-07, 15:25


PanGrzybulek







Wiek: 28
Na forum: 4823 dni
Posty: 47
Nick w MP: Mentosik

Piwa: 3

Respekt: 50

Ostrzeżeń: 100%
mtasa.com/wiki

Skad mam wiedziec jakie ty te funkcje chcesz?

Postaw piwo autorowi tego posta
 

 
Tagi: okienko :: logowania
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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