Jump to content

.Doctor

Members
  • Posts

    19
  • Joined

  • Last visited

Everything posted by .Doctor

  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
  9. 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(),PlayerLogin) Ok, No Caso a função "Login" a conta precisa estar criada no servidor? ou ela ira usar os dados do mysql via call?
  10. Boa noite clã, bom eu tenho um painel de login funcional com MySql... porem quando um player cria uma conta no site e eu tenho algum script que necessite que a conta estaja na acl ela não funciona nem mesmo com admins, então teria algum modo de fazer as contas mysql funcionarem com a ACL? help ae
  11. Hello friends can you help me? this save data script "Mysql" is working ... but it is using the module mta_mysql.dll and this module does not work in 64bit could someone solve and instead of "MysqlModule" change the commands to "dbConnect" ?? thank you database = mysql_connect( "127.0.0.1", "root", "", "db_just" ) if database then outputDebugString ('Connect') else outputDebugString ("Trouble") end function saveAccounts () -- Save in the database local serial = getPlayerSerial ( source ) local x,y,z = getElementPosition( source ) local i = getElementInterior( source ) local d = getElementDimension( source ) local skin = getPedSkin ( source ) local money = getPlayerMoney ( source ) local health = getElementHealth ( source ) local armor = getPedArmor ( source ) local wanted = getPlayerWantedLevel ( source ) local q = mysql_query(database,"SELECT * FROM `accounts` WHERE `serial` = '".. serial .."'") if(mysql_num_rows(q) == 0) then mysql_query( database, "INSERT INTO accounts ( `serial` , x, y, z, intterior, demension, skin, money, health, armor, wanted ) VALUES ( '" .. serial .. "', " .. x .. ", " .. y .. ", " .. z .. "," .. i .. ", " .. d .. "," .. skin .. "," .. money .. ", ".. health ..", ".. armor ..", " .. wanted .. " )" ) else res = mysql_query ( database, "UPDATE `accounts` SET x = ".. x ..", y = ".. y ..", z = ".. z ..", intterior = ".. i ..", demension = ".. d ..", skin = ".. skin ..", money = ".. money ..", health = ".. health ..", armor = ".. armor ..", wanted = ".. wanted .." WHERE `serial` = '"..serial.."'") end end function loadAccounts () local serial = getPlayerSerial ( source ) local result = mysql_query ( database ,"SELECT * FROM `accounts` WHERE `serial` = '"..serial.."'") if result then while true do local row = mysql_fetch_assoc(result) if not row then break end setElementPosition ( source, row.x, row.y, row.z) setElementInterior ( source, row.intterior ) setElementDimension ( source, row.demension ) setPedSkin ( source, row.skin ) setPlayerMoney ( source, row.money ) setElementHealth ( source, row.health) setPedArmor ( source, row.armor ) setPlayerWantedLevel ( source, row.wanted ) break end end end addEventHandler ( "onPlayerJoin", getRootElement(), loadAccounts ) addEventHandler ( "onPlayerQuit", getRootElement(), saveAccounts )
×
×
  • Create New...