Jump to content

Look my error plz


xRGamingx

Recommended Posts

Hello friends, why does this error throw me the login panel? if everything is fine 

What is the error..

 

 

 

local server ="127.0.0.1"
local base ="Proyectotg"
local user ="root"
local contra=""

function registrar(user,clave,correo)
cnn = dbConnect( "mysql", "dbname="..base..";host="..server,user,contra,"share=2")
res = dbQuery( cnn,"select count(codCuentas)as nombre from cuentas where usuario='"..user.."';")
result =  dbPoll( res, -1 )
    if(result[1]["nombre"]==0)then
		serial = getPlayerSerial(source)
		res = dbQuery( cnn,"select count(codCuentas)as nombre from cuentas where serialPlayer='"..serial.."';")
		result =  dbPoll( res, -1 )
		if(result[1]["nombre"]<100)then
		a,b,c = tostring(math.random(100,800)),tostring(math.random(100,800)),tostring(math.random(100,800))
		codigo = a..b..c
			fail= dbExec( cnn, "INSERT INTO cuentas(usuario,clave,correo,serialPlayer,codigo,cambio,can,activa) VALUES (?,?,?,?,?,?,?,?)",user,clave,correo,serial,codigo,0,0,0 )
			if(addAccount(user,clave))then
				outputChatBox("Se creo l cuenta con exito Usuario="..user.." contraseña="..clave,source)
				setElementData(source,"usuario",user)
				setElementData(source,"clave",clave)
				enviar(codigo,correo,"Codigo+De+activacion",source)
				triggerClientEvent(source,"fActivar",source)
			else
				outputChatBox("Algo a salido mal contacta a un admin",source)
			end
			
		else
			outputChatBox("Solo puedes tener 2 cuentas",source)
		end
	else
		outputChatBox("La cuenta ya esta en uso",source)
	end	 
end
addEvent("registrar",true)
addEventHandler("registrar",getRootElement(),registrar)

859b39da626e5701400ca9a8a3c46261o.png67948a2c85ae48df1b3629c52c008d9eo.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...