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

Wysłany: 2014-09-10, 19:08


kamyrdol32







Wiek: 37
Na forum: 4667 dni
Posty: 75
Nick w MP: kamyrdol32

Piwa: 2

Respekt: 90

Witam, znalazlem w necie ostatnio bardzo fajny system logowania ale ma 1 wade, otoz gdy nick sklada sie np z T to otwiera sie Chat, da sie to jakos zablokowac? Te biny na chat?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-10, 19:16


KukiX







Wiek: 34
Na forum: 6718 dni
Posty: 567

Piwa: 17560

Respekt: 160
Respekt: 160Respekt: 160

np. mo?esz ukry? chat podczas logowania - https://wiki.multitheftauto.com/wiki/ShowChat

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-10, 19:19


krydianero

Samotny Wilk






Wiek: 33
Na forum: 4782 dni
Posty: 395
Nick w MP: Yoshida

Piwa: 1798

Respekt: 117,3
Respekt: 117,3

kamyrdol32, u?yj guiSetInputEnabled(true) po poprawnym zalogowaniu dajesz false

Podpis

Multi Drive Unlimited:Nowy projekt już wkrótce

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-10, 21:29


kamyrdol32







Wiek: 37
Na forum: 4667 dni
Posty: 75
Nick w MP: kamyrdol32

Piwa: 2

Respekt: 90

A moze ktos mi to wytlumaczyc jak to mam zrobic? Jestem zielony w tym.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-10, 21:57


krydianero

Samotny Wilk






Wiek: 33
Na forum: 4782 dni
Posty: 395
Nick w MP: Yoshida

Piwa: 1798

Respekt: 117,3
Respekt: 117,3

Wklej to co poda?em do kodu z okienkiem logowania...

Podpis

Multi Drive Unlimited:Nowy projekt już wkrótce

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-10, 22:35


kamyrdol32







Wiek: 37
Na forum: 4667 dni
Posty: 75
Nick w MP: kamyrdol32

Piwa: 2

Respekt: 90

Ale oco chodzi z tym false po zalogowaniu

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-10, 23:04


krydianero

Samotny Wilk






Wiek: 33
Na forum: 4782 dni
Posty: 395
Nick w MP: Yoshida

Piwa: 1798

Respekt: 117,3
Respekt: 117,3

We fragmencie kodu gdzie jest zamykane okno po zalogowaniu daj guiSetInputEnabled(false)

Podpis

Multi Drive Unlimited:Nowy projekt już wkrótce

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-11, 12:41


kamyrdol32







Wiek: 37
Na forum: 4667 dni
Posty: 75
Nick w MP: kamyrdol32

Piwa: 2

Respekt: 90

Mam takie pytanie z innej beczki, jak mog? doda? baz? do mojej przerobione mapy na serwerze?

[ Dodano: 2014-09-11, 14:11 ]
Kod:


To jest kod i gdzie tu mam to umiescic? - Client

-- -308.42431640625,1296.0610351563,115.47154998779
resourceRoot = getResourceRootElement(getThisResource())
localPlayer = getLocalPlayer()
marwinButtons = {}
font = {}
font[1] = guiCreateFont( "font.ttf", 12 )
font[2] = guiCreateFont( "font.ttf", 28 )

--Button
function createMarwinButton(x,y,widht,height,text,bool,parent,info)
button = guiCreateStaticImage(x,y,widht,height,"images/button_standart.png", bool,parent or nil)
table.insert(marwinButtons,button)
guiBringToFront(button)
label = guiCreateLabel(0,0,1,1,text,bool,button)
guiBringToFront(label)
setElementData(label,"parent",button)
setElementData(button,"info",info)
guiSetFont(label,font[1])
guiLabelSetVerticalAlign (label, "center")
guiLabelSetHorizontalAlign (label, "center")
addEventHandler("onClientMouseEnter",label,markButton,false)
addEventHandler("onClientMouseLeave",label,unmarkButton,false)
return label
end

function markButton ()
parent = getElementData(source,"parent")
guiStaticImageLoadImage (parent,"images/button_mouse.png")
setElementData(getLocalPlayer(),"clickedButton",parent)
end

function unmarkButton (b,s)
parent = getElementData(source,"parent")
guiStaticImageLoadImage (parent,"images/button_standart.png")
setElementData(getLocalPlayer(),"clickedButton",false)
end
--false to disable all debug messages
idb = false

function loginPanel()
showCursor(true,false)
screenw,screenh = guiGetScreenSize()
local namep = getPlayerName(getLocalPlayer())
login_window = guiCreateStaticImage(0, 0, screenw, screenh, "images/bg.png", false)
login_login = createMarwinButton(0.1,0.455,0.095,0.03,"Logowanie",true,login_window,"login")
name = guiCreateLabel(5, 700, 175, 48, namep, false, login_window)
guiSetFont ( name, font[2] )
--login_error = guiCreateLabel(5, 5, 175, 48, "", false, login_window)
addEventHandler ( "onClientGUIClick", login_login, function()
guiSetVisible(login_window2,false)
guiSetVisible(register_window,false)
createLogin()
--if idb == true then
--outputChatBox("got reg click")
--end
--username = guiGetText(login_username)
--password = guiGetText(login_password)
--if username ~= "" and password ~= "" then
-- guiSetText(login_error,"")
-- triggerServerEvent("onClientSendLoginDataToServer", getLocalPlayer(), username, password)
--else
--guiSetText(login_error,"Ошибка: Заполните все поля!")
--end
end, false )
---
login_register = createMarwinButton(0.1,0.495,0.095,0.03,"Rejestracja",true,login_window,"login")
addEventHandler ( "onClientGUIClick", login_register, function()
guiSetVisible(register_window,false)
guiSetVisible(login_window2,false)
guiSetVisible(register_window,false)
createRegistration()


end, false )
login_exit = createMarwinButton(0.1,0.535,0.095,0.03,"=========",true,login_window,"quit")
addEventHandler ( "onClientGUIClick", login_exit, function()
guiSetVisible(login_window2,false)
guiSetVisible(register_window,false)

end, false )
login_error = guiCreateLabel(5, 5, 175, 48, "", false, login_window)
guiLabelSetColor(login_error, 197, 0, 0)
guiLabelSetHorizontalAlign(login_error, "left", true)
end


function createRegistration()
screenw,screenh = guiGetScreenSize()
register_window = guiCreateStaticImage(350, 270, 200, 250, "images/menu.png", false)
infol1 = guiCreateLabel(0.27, 0.05, 0.80, 0.30,"Rejestracja",true,register_window)
guiSetFont(infol1,font[1])
infol4 = guiCreateLabel(0.38, 0.16, 0.80, 0.30,"Nick",true,register_window)
guiSetFont(infol4,font[1])
infol5 = guiCreateLabel(0.36, 0.38, 0.80, 0.30,"Haslo",true,register_window)
guiSetFont(infol5,font[1])
register_username = guiCreateEdit(30, 60, 134, 28, "", false, register_window)
guiSetAlpha(register_username, 0.60)
register_password = guiCreateEdit(30, 120, 134, 28, "", false, register_window)
guiSetAlpha(login_password, 0.60)
guiEditSetMasked(register_password, true)
regbutt = createMarwinButton(0.14,0.695,0.695,0.110,"Rejestracja",true,register_window,"login")
-- regbutt = guiCreateButton( 7, 180, 175, 48, "Pr?xima!", false, register_window)
addEventHandler ( "onClientGUIClick", regbutt, function()
if idb == true then
outputChatBox("got reg click")
end
username = guiGetText(register_username)
pass1 = guiGetText(register_password)
if username ~= "" and pass1 ~= "" then
guiSetText(login_error,"")
triggerServerEvent("onClientSendRegisterDataToServer", getLocalPlayer(), username, pass1)
else
guiSetText(login_error,"Erro: Preencher todos os campos!")
end
end, false )
end

function createLogin()
screenw,screenh = guiGetScreenSize()
login_window2 = guiCreateStaticImage(350, 270, 200, 250, "images/menu.png", false)
infol = guiCreateLabel(0.27, 0.05, 0.80, 0.30,"Logowanie",true,login_window2)
guiSetFont(infol,font[1])
infol2 = guiCreateLabel(0.38, 0.16, 0.80, 0.30,"Nick",true,login_window2)
guiSetFont(infol2,font[1])
infol3 = guiCreateLabel(0.36, 0.38, 0.80, 0.30,"Haslo",true,login_window2)
guiSetFont(infol3,font[1])
--login_window2 = guiCreateWindow(450, 250, 200, 250, "Entrar", false)
--register_window = guiCreateWindow ( 450, 250, 200, 250, "Register", true )
login_username = guiCreateEdit(30, 60, 134, 28, "", false, login_window2)
guiSetAlpha(register_username, 0.60)
login_password = guiCreateEdit(30, 120, 134, 28, "", false, login_window2)
guiSetAlpha(login_password, 0.60)
guiEditSetMasked(login_password, true)
loginbutt = createMarwinButton(0.14,0.695,0.695,0.110,"Logowanie",true,login_window2,"login")
addEventHandler ( "onClientGUIClick", loginbutt, function()
if idb == true then
outputChatBox("got reg click")
end
username = guiGetText(login_username)
password = guiGetText(login_password)
if username ~= "" and password ~= "" then
guiSetText(login_error,"")
triggerServerEvent("onClientSendLoginDataToServer", getLocalPlayer(), username, password)
else
guiSetText(login_error,"Erro: Por favor, preencha todos os campos!")
end
end, false )
config = xmlLoadFile("fragconf.xml")
if config then
uname = xmlNodeGetAttribute(config,"username")
pass = xmlNodeGetAttribute(config,"pass")
guiSetText(login_username,uname)
guiSetText(login_password,pass)
else
config = xmlCreateFile("fragconf.xml","account")
xmlNodeSetAttribute(config, "username", "")
xmlNodeSetAttribute(config, "pass", "")
xmlSaveFile(config)
end
end

addEvent("regerror",true)
function registererror(etype)
local enames = {}
enames[0] = "Conta j? existe!"
enames[1] = "Preencha todos os campos!"
enames[2] = "Erro desconhecido!"
enames[3] = "Nome de usu?rio ou senha incorreta!"
guiSetText(login_error,"Erro: "..enames[etype])
end
addEventHandler ( "regerror", getLocalPlayer(), registererror)

function finishlogin()
config = xmlLoadFile("fragconf.xml")
xmlNodeSetAttribute(config, "username",guiGetText(login_username))
xmlNodeSetAttribute(config, "pass",guiGetText(login_password))
xmlSaveFile(config)
guiSetVisible(login_bg,false)
guiSetVisible(login_window,false)
showCursor(false)
guiSetVisible(register_window,false)
guiSetVisible(login_window2,false)
end
addEvent("onPlayerDoneLogin", true)
addEventHandler("onPlayerDoneLogin", getRootElement(), finishlogin)

addEventHandler("onClientResourceStart", resourceRoot,
function ()
loginPanel()
setPlayerHudComponentVisible ("radar", false )
ped = createPed ( 73, 2661.5905761719, 2729.5161132813, 10.8203125, 440,true )
setPedAnimation( ped, "ped", "endchat_01",nil,true,true,false,false)
guiSetInputMode("no_binds_when_editing")
fadeCamera (true)
setCameraMatrix(2658.2626953125, 2728.0246582031, 10.541299819946, 2659.0986328125, 2728.521484375, 10.774273872375)
end
)
--playSound("music.mp3")


Postaw piwo autorowi tego posta
 

 
Tagi: probelm :: skrypttem
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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