Jump to content

.Doctor

Members
  • Posts

    19
  • Joined

  • Last visited

2 Followers

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

.Doctor's Achievements

Square

Square (6/54)

2

Reputation

  1. Onde está o getElementData do server do seu ID?
  2. O erro persiste, realmente nao é mais um erro pois li IsTransferBoxActive e agora apenas não desativa resourceRoot = getResourceRootElement() local sx, sy = guiGetScreenSize() local link = "http://mta/n_Download/html/index.html" local initBrowser = guiCreateBrowser(0, 0, sx, sy, true, false, false) local browser = guiGetBrowser(initBrowser) guiSetInputMode("no_binds_when_editing") addEventHandler("onClientBrowserCreated", browser, function () fadeCamera(false,0) showCursor(true) loadBrowserURL(source, link) end ) function checkTransfer() if isTransferBoxActive() then setTimer(checkTransfer,2000) -- Check again after 2 seconds else destroyElement(initBrowser) end end addEventHandler("onClientResourceStart",resourceRoot,checkTransfer)
  3. O Erro Continua :3 local sx, sy = guiGetScreenSize() local link = "http://mta/n_Download/html/index.html" local initBrowser = guiCreateBrowser(0, 0, sx, sy, true, false, false) local browser = guiGetBrowser(initBrowser) guiSetInputMode("no_binds_when_editing") addEventHandler("onClientBrowserCreated", browser, function () fadeCamera(false,0) showCursor(true) loadBrowserURL(source, link) end ) function renderLoaldLogin() if getElementData(getLocalPlayer(),"load_notLogin") then if isTransferBoxActive() then return end setElementData(getLocalPlayer(),"load_notLogin",false) initBrowser = nil; destroyElement(initBrowser) showCursor(false) browser = nil; removeEventHandler("onClientBrowserCreated", getResourceRootElement(), browser); showChat(true) end end addEventHandler("onClientRender", root, renderLoaldLogin)
  4. Salve Guys blz? bom manos estou tento problemas com esse meu "sistema de tela de download" bom ele está funcionando mas quando um player termina o download o script continua rodando como posso remove-lo assim que o usuario terminar o download? local sx, sy = guiGetScreenSize() local link = "http://mta/n_Download/html/index.html" local initBrowser = guiCreateBrowser(0, 0, sx, sy, true, false, false) local browser = guiGetBrowser(initBrowser) guiSetInputMode("no_binds_when_editing") addEventHandler("onClientBrowserCreated", browser) addEventHandler("onClientBrowserCreated", browser, function () fadeCamera(false,0) showCursor(true) loadBrowserURL(source, link) end ) addEventHandler("onClientResourceStart", getResourceRootElement(), showPreload); function renderLoaldLogin() if getElementData(getLocalPlayer(),"load_notLogin") then if isTransferBoxActive() then return end setElementData(getLocalPlayer(),"load_notLogin",false) destroyElement(initBrowser) showCursor(false) browser = nil; initBrowser = nil; removeEventHandler("onClientBrowserCreated", getResourceRootElement(), browser); showChat(true) end end addEventHandler("onClientRender", root, renderLoaldLogin)
  5. Ok Consegui, estava invertendo as coisas obrigado
  6. o client envia os dados corretamente mas o erro continua segue o codigo server completo novamente root = resourceRoot() function PlayerJoin() triggerClientEvent ( source, "openLoginGUI", source, true ) end addEventHandler ( "onPlayerJoin", root, PlayerJoin ) banco = dbConnect( "mysql", "dbname=db_just;host=127.0.0.1", "root", "", "share=1" ) if banco then outputDebugString( "Conectado" ) else outputDebugString( "Desconectado" ) end function PlayerLogin(username,password) qh = dbQuery(banco, "SELECT * FROM accounts WHERE BINARY username=? and password=?", username, password) result , numrows, errmsg = dbPoll (qh, -1) local row = result[1] if row then triggerClientEvent(client, "login.success", client) local account = getAccount(username, password) if (account ~= false) then logIn(client, getAccount(username), password) else end setElementData(client, "isPlayedLoggedIn", true) setElementData(client, "getPlayerUsername", username) else outputChatBox("Atenção: Você digitou os dados errados.", client) end end addEvent( 'onRequestLogin', true ); addEventHandler( 'onRequestLogin', resourceRoot(), function( username, password ) qh = dbQuery( banco, 'SELECT * FROM accounts WHERE BINARY username = ? AND password = ?', username, password ); result, numrows, errmsg = dbPoll( qh, -1 ); local row = result[ 1 ]; if row then triggerClientEvent( client, 'login.success', client ); local account = getAccount( username, password ); if ( not account ) then local newAccount = addAccount( username, password ); if ( newAccount ) then logIn( client, getAccount( username ), password ); end else logIn( client, account, password ); end setElementData( client, 'isPlayedLoggedIn', true ); setElementData( client, 'getPlayerUsername', username ); else outputChatBox( 'Atenção: Você digitou os dados errados.', client ); end end );
  7. Ok, quando eu coloco o codigo ele me retorna um erro no console segue anexo o comdigo do server completo root = getRootElement() function PlayerJoin() triggerClientEvent ( source, "openLoginGUI", source, true ) end addEventHandler ( "onPlayerJoin", root, PlayerJoin ) banco = dbConnect( "mysql", "dbname=db_just;host=127.0.0.1", "root", "", "share=1" ) if banco then outputDebugString( "Conectado" ) else outputDebugString( "Desconectado" ) end function PlayerLogin(username,password) qh = dbQuery(banco, "SELECT * FROM accounts WHERE BINARY username=? and password=?", username, password) result , numrows, errmsg = dbPoll (qh, -1) local row = result[1] if row then triggerClientEvent(client, "login.success", client) local account = getAccount(username, password) if (account ~= false) then logIn(client, getAccount(username), password) else end setElementData(client, "isPlayedLoggedIn", true) setElementData(client, "getPlayerUsername", username) else outputChatBox("Atenção: Você digitou os dados errados.", client) end end addEvent( 'onRequestLogin', true ); addEventHandler( 'onRequestLogin', getRootElement( ), function( username, password ) qh = dbQuery( banco, 'SELECT * FROM accounts WHERE BINARY username = ? AND password = ?', username, password ); result, numrows, errmsg = dbPoll( qh, -1 ); local row = result[ 1 ]; if row then triggerClientEvent( client, 'login.success', client ); local account = getAccount( username, password ); if ( not account ) then local newAccount = addAccount( username, password ); if ( newAccount ) then logIn( client, getAccount( username ), password ); end else logIn( client, account, password ); end setElementData( client, 'isPlayedLoggedIn', true ); setElementData( client, 'getPlayerUsername', username ); else outputChatBox( 'Atenção: Você digitou os dados errados.', client ); end end ); Erro retornado "ERROR: Client triggered serverside event onRequestLogin, but event is not added serverside"
  8. Não, apenas registrados no banco mysql
×
×
  • Create New...