Jump to content

KyonaxDEV

Members
  • Posts

    7
  • Joined

  • Last visited

About KyonaxDEV

  • Birthday 31/07/2000

Details

  • Gang
    Synchronous
  • Location
    Colombia
  • Occupation
    Boss
  • Interests
    Learn

Recent Profile Visitors

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

KyonaxDEV's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. Ok, I did this but the call of the function still return nil [14:47:42] ERROR: [init]\login\LoginBackend.lua 27: attempt to call global 'getError' (a nil value) ---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•--- ---| |--- ---| Script by "Kyonax - Pilar Perfeccionista" Synchronous member |--- ---| Github: https://github.com/Kyonax • G-Mail: [email protected] |--- ---| code script from Montgomery Country RP |--- ---| Resource-Script: [init] |--- ---| Name-Script: [LoginBackend] |--- ---| Function-Script: Try to acces to an Account by the parameters gived |--- ---| by the Browser GUI using an Event |--- ---| |--- ---| DEV-DATE: 21/06/2020 |--- ---| Server Script |--- ---| number: 002 |--- ---| MIT License |--- ---| |--- ---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•--- --- Server Variables event = {add = addEventHandler, load = addEvent, execute = triggerClientEvent} -- Make simple calls for addEvent and triggerClientEvent by the variable event --- Variable Error local error = { message = { account = "No se ha podido encontrar la cuenta en la Base de Datos [ERROR 3]", information = "La información ingresada es incorrecta. Inténtelo nuevamente [ERROR 4]" }, type = "ERROR" } -- Make simple String calls for errors (account, information) by the variable error local test = getError('notFoundAccount').message local test2 = getError('notFoundAccount').type --- Functions function loginAttempt(player, user, password) local account = getAccount(user) -- Check on the Database the User if not account then -- If the account doesn't exist event.execute(player, 'login-tooltip-browser:show', player, test, test2) -- Trigger an Event that shows the error.account on the Browser else local hashed_password = getAccountData(account, 'hashed_password') -- Get the encrypt password from the Account passwordVerify(password, hashed_password, function(areEqual) if not areEqual then -- If the Password is incorrect event.execute(player, 'login-tooltip-browser:show', player, error.message.information, error.type) -- Trigger an Event that shows the error.information on the Browser else if logIn(player, account, hashed_password) then spawnPlayer(player, 1280, 250, 20) fadeCamera(player, true) setCameraTarget(player, player) for i = 1, 16 do outputChatBox(' ', player) end return event.execute(player, 'login-browser:remove', player) -- Trigger an Event that Removes the Browser GUI end -- If the User login succesfully then spawn and set the camera to the Player end end) -- Verify if the Password is equal to the Account Password end -- Verify if the account exists end -- This function try to Login into the account if it can't send an Error --- Events Created event.load("login-backend:execute", true) event.add("login-backend:execute", root, function(user, password) loginAttempt(client, user, password) end) -- An Event that try to acces to the Account by the User and Password --- MTA Events event.add("onPlayerLogout", root, function() event.execute(source, "login-browser:show", source) end) -- When the Player Logout the Session Open the Browser GUI
  2. I don't know if that is the problem, I call all my resources like that, and they work normally, the name of that resource is [init] and I called like that ...the problem is... I only want to know how to call a function from a file to another in the same resource.
  3. Yeah my bad... But I called the resource like that , I have in that folder the meta.xml, and It's working, only I need is call the functions inside the InitTooltipMessage.lua to the file RegisterBackend.lua
  4. Hello dear community. I'm doing a Error Tooltip Resource, I created an Error Client File for all the Errors from my Main Register Resource, and I tried to call that resource by Functions on the same resource, How can I call a Function from the same resource and get The Object File that I want?... This is my code - Error File (InitTooltipMessage.lua) ---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•--- ---| |--- ---| Script by "Kyonax - Pilar Perfeccionista" Synchronous member |--- ---| Github: https://github.com/Kyonax • G-Mail: [email protected] |--- ---| Code Script from Montgomery Country RP |--- ---| Resource-Script: [init] |--- ---| Name-Script: [InitTooltipMessage] |--- ---| Function-Script: Save all the posible Script Errors |--- ---| |--- ---| DEV-DATE: 31/08/2020 |--- ---| Server Script |--- ---| number: 001 |--- ---| MIT License |--- ---| |--- ---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•---•--- local tooltip = { error = { notDataDigit = { name = 'notDataDigit', syntax = 'NULL LABEL', message = 'El campo actual debe ser completado', description = 'El campo en donde te encuentras, es un campo de entrada, es decir necesitas ingresar información para poder continuar.', type = 'ERROR', number = '1' }, notFoundAccount={ name = 'notFoundAccount', syntax = 'NULL QUERY LOGIN', message = 'No se ha podido encontrar la cuenta en la Base de Datos.', description='Se ha recibido valor NULL al realizar la búsqueda Query del Usuario en la Base de Datos, es decir que el valor Buscado no existe en la Base de Datos.', type = 'ERROR', number = '2' }, notEqual = { name = 'notEqual', syntax = 'NOT EQUAL LABEL', message = 'Los datos ingresados no son iguales.', description = 'Se ha obtenido un ERROR de similitud a la hora de comparar dos valores que deben ser exactamente iguales.', type = 'ERROR', number = '3' } incorrectInformation ={ name = 'incorrectInformation', syntax = 'NOT EQUAL QUERY', message = 'La información ingresada es incorrecta.', description = 'La comparación de el dato obtenido de la Base de Datos y el Ingresado ha devuelto un ERROR de similitud, es decir los datos ingresados no son iguales a los registrados en la base de datos.', type = 'ERROR', number = '4' }, notFoundVariables = { name = 'notFoundVariables', syntax = 'NULL INFORMATION', message = 'Las variables esenciales tienen como valor NULL.', description = 'Variables necesarias para le ejecución del código son de valor NULL, lo que indica que los valores no han sido digitadas o que han sido corrompidos.', type = 'ERROR', number = '5' }, existAccount = { name = 'existAccount', syntax = 'MULTIPLE VALUES QUERY', message = 'El usuario digitado no se encuentra disponible.', description = 'El nombre de usuario para crear la cuenta ya se encuentra registrado en la Base de Datos, lo que causa un error de multiples valores registrados.', type = 'ERROR', number = '6' }, existDiscordID = { name = 'existDiscordID', syntax = 'MULTIPLE VALUES QUERY', message = 'La ID de Discord digitada ya se encuentra en uso.', description = 'La ID de Discord se encontró en la base de datos, lo que quiere decir que otra cuenta está registrada con esta ID.', type = 'ERROR', number = '7' }, notValidPassword = { name = 'notValidPassword', syntax = 'LOW SECURITY ACCOUNT', message = 'La contraseña no es segura', description = 'Existen algunos requerimientos para acceder al Servidor, uno de ellos es tener una contraseña de más de 6 carácteres.', type = 'ERROR', number = '8' } } } local function getError(name) return tooltip.error[name] end local function getTooltip(name) return tooltip.error[name].syntax...' '...tooltip.error[name].message...' '...' ['...tooltip.error[name].type...' #' ...tooltip.error[name].number...']' end and I tried to call the getTooltip Function from another File called - RegisterBackend.lua - It's a Server Lua File local test = exports['[init]']:getTooltip('notFoundAccount').message local test2 = exports['[init]']:getError('notFoundAccount').type Both Files are on the same Resource call [Init] And this is my Meta.xml Code <!--ERROR--> <file src="src/error/InitTooltipMessage.lua" type='client'></file> <!--Exported Functions--> <export function='getError' type='client'></export> <export function='getTooltip' type='client'></export> The error that I get when I run the Code is this What I need to do? to call correctly Plss I'm Stuck in this
  5. ¿Que problema necesitabas solucionar? o ya lo solucionaste? estuve un tiempo inactivo.

    1. KyonaxDEV

      KyonaxDEV

      Ya solucioné ese problema, aún así ahora tengo otros problemas.

  6. Okay... the solution was very simple, only make the CEF, page and browser global variables ...like this event = {add = addEventHandler, load = addEvent, execute = triggerServerEvent} local WINDOW_WIDTH, WINDOW_HEIGHT = guiGetScreenSize() -- HTML Web Page Creation page = "http://mta/player/html/login.html" CEF = guiCreateBrowser(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, true, false, false) local browser = guiGetBrowser(CEF) Then delete the onClientBrowserDocumentReady event, and that's it function sendErrorLabel(error) executeBrowserJavascript(browser, "document.querySelector('.error:nth-child(5)').innerHTML = '" .. error .. "'"); executeBrowserJavascript(browser, "document.querySelector('.error:nth-child(5)').style = 'display: initial; top: 90%; left:40.5%'"); end All the code works fine
  7. El link del discord no funciona, aún así... Cuanto cobras para resolver un problema?
  8. Hello I have an issue when I trigger an event that call a function using onClientBrowserDocumentReady, i don't know what is the issue... This is my code: The issue is... onClientBrowserDocumentReady doesn't found the browser and it can't in into the event. the executeBrowserJavascript doesn't work event = {add = addEventHandler, load = addEvent, execute = triggerServerEvent} local WINDOW_WIDTH, WINDOW_HEIGHT = guiGetScreenSize() local CEF = nil local browser = nil function deleteWebPage() if isElement(CEF) then destroyElement(CEF) showCursor(false) end end function createWebPage() page = "http://mta/player/html/login.html" CEF = guiCreateBrowser(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, true, false, false) browser = guiGetBrowser(CEF) addEventHandler("onClientBrowserCreated", browser, function() loadBrowserURL(source, page) showCursor(true) end) end function sendErrorLabel(error) addEventHandler("onClientBrowserDocumentReady", browser, function() executeBrowserJavascript(browser, "document.querySelector('.error:nth-child(5)').innerHTML = '" .. error .. "'"); executeBrowserJavascript(browser, "document.querySelector('.error:nth-child(5)').style = 'display: initial; top: 90%; left:40.5%'"); end) end event.load('login-data:send', true) event.add('login-data:send', root, function(user, password) event.execute('login-menu:execute', resourceRoot, user, password) end, true) event.load("onClientPlayerLogout", true) event.add("onClientPlayerLogout", root, function() createWebPage() end) event.load("show-label:error", true) event.add("show-label:error", root, function(error) sendErrorLabel(error) end) event.load('login-menu:remove', true) event.add('login-menu:remove', root, function() deleteWebPage() end) event.add("onClientResourceStart", resourceRoot, function() createWebPage() end)
×
×
  • Create New...