Jump to content

[Solved]Need a bit help over here..


Maurize

Recommended Posts

Hey,

I have created a SQL Password asking function succesfully..

But i got 1 Problem:

If i take a word like: appel

as password, it´s get saved in registry and if i reconnect and insert my password( "appel" ) into the edit, i get loggined. this should be always...

BUT

if i insert a number like : 0123

and enter the number gets saved in database.

if i reconnect and insert the password( "0123" ) nothing happends and he tell me that it is incorrect ?!

So i have 3 Questions:

How can i set how much characters the player MUST take when he choose the password

How can i set that he MUST use alphabet

and What the fuck is happened with the database that this bug appears ? :D

AND

whats wrong here:

  
executeSQLInsert( "DB", "'"..User.."', '"..tostring( Pass ).."', '255', '1', 'Red'" ) 
  

Thanks.

Edited by Guest
Link to comment

i bet it's all "top-secret-ultra-original-closed-source-code" there, but still:

single line of code is pretty much useless for people to try and figure what is going wrong in your case.

also do you have any idea of how database works? right now you're inserting a row every time. if your "name" column is not unique, you'll end up with several records with the same name.

Link to comment

Lol just tell me you want the whole code.. -.-

addEvent( "beiLogin", true ) 
addEventHandler( "beiLogin", getRootElement(), 
function( Pass ) 
    local User = getPlayerName( source ) 
    local Table = executeSQLSelect ( "DB", "*", "User = '"..User.."'") 
if ( Table ) and ( #Table == 1 ) then 
if ( Pass == Table[1]["Serial"] ) then 
    spawnPlayer( source, -480.4, 2178.9, 41.9, 0, 303 ) 
    toggleControl( source, "sprint", false ) 
    setCameraTarget( source, source ) 
    fadeCamera( source, false, 1.5, 0, 0, 0 ) 
    triggerClientEvent( "beiEingeloggt", source ) 
else 
    outputChatBox( "Wache sagt: Falsches Passwort, "..User.."!", source, 200, 200, 200 ) 
    end 
else 
    outputChatBox( "Wache sagt: Willkommen, Neuer! Dein Name ist"..User.." und das Passwort"..Pass..", hm?", source, 200, 200, 200 ) 
    executeSQLInsert( "DB", "'"..User.."', '"..tostring( Pass ).."'" ) 
    spawnPlayer( source, -790.6, 2424.1, 157.1, 180, 1 ) 
    toggleControl( source, "sprint", false ) 
    setCameraTarget( source, source ) 
    fadeCamera( source, false, 1.5, 0, 0, 0 ) 
    triggerClientEvent( "beiEingeloggt", source ) 
    end 
end ) 

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...