TheMasterNico Posted June 11, 2015 Posted June 11, 2015 Estaba programando cuando fui a probar me salio ese error en la consola. addEvent("onPlayerLoginBG", true) addEventHandler("onPlayerLoginBG", resourceRoot, function(user, pass) local contra = hash("sha512", string.sub(user, 0, math.floor(string.len(user)/2)) .. pass .. user) -- Crear el hash dbQuery(--Comprobar que la cuenta no exista function(hand) local result, num_affected_rows, last_insert_id = dbPoll(hand, 0) CheckConsulta(result, num_affected_rows, last_insert_id) if result then if num_affected_rows == 0 then outputChatBox(" ** #fff714El nombre de usuario no existe.", client, 255, 0, 0, true) else for _, row in ipairs ( result ) do outputChatBox("Password: " .. row["Password"], client, 255, 0, 0, true) if row["Password"] == contra then outputChatBox("#ffffffBienvenido a #ff0000Blod Gamer", client, 0, 0, 0, true) triggerClientEvent(getRootElement(), "OnPlayerFinishLogin", getRootElement()) -- Obtener datos de la db y guardarlos for column, value in pairs ( row ) do exports.LoginRegister:set_data(client, column, value) end else outputChatBox("#fff714La contraseña es incorrecta", client, 0, 0, 0, true) end end end end end, MYSQL, "SELECT `Password` FROM `userdata` WHERE `Cuenta` = ?", user) -- Si existe o no la cuenta end ) En la linea: triggerClientEvent(getRootElement(), "OnPlayerFinishLogin", getRootElement()) Lo solucione colocando getRootElement(), pero con source, client y resourceRoot no funciona. (Antes me funcionaba con "client" pero ahora no, miren y veran: https://forum.multitheftauto.com/viewtopic.php?f=146&t=87998 ) ¿Que palabra debo usar para no utilizar getRootElement()? Sorry for my English. I speak Spanish.
Tomas Posted June 11, 2015 Posted June 11, 2015 ¿Qué es lo que quieres hacer? Currently developing for International Gaming Community - Join us!
TheMasterNico Posted June 11, 2015 Author Posted June 11, 2015 Que palabra debo usar para reemplazar getRootElement Sorry for my English. I speak Spanish.
Tomas Posted June 12, 2015 Posted June 12, 2015 Que palabra debo usar para reemplazar getRootElement 'root' ? Currently developing for International Gaming Community - Join us!
TheMasterNico Posted June 12, 2015 Author Posted June 12, 2015 Funciono, muchas gracias. Una ultima pregunta. ¿Por que 'client', 'source' o 'resourceRoot' no me funcionaban? ¿Y cuando debo usar cada uno de esos? Sorry for my English. I speak Spanish.
0xCiBeR Posted June 12, 2015 Posted June 12, 2015 source no siempre esta definido dentro de una función. client solo funciona cuando un evento server-side es triggeado desde el client-side. resourceRoot funciona como elemento de núcleo de resource. DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp
Recommended Posts