one name player can be register twice time and its add double time in db
its problem due to lower alphabets and bigger if a player registered with bangash he can register again with BANGASH
constructor( playerName, dbGlobal ){
local query = ::QuerySQL( dbGlobal, "SELECT Cash, Bank, Kills, Deaths, Level, LastUsedIP, nogoto FROM Accounts WHERE Name='" + playerName + "' AND NameLower='" + playerName.tolower() + "'" );
if( ::GetSQLColumnData( query, 5 ) ){
Cash = ::GetSQLColumnData( query, 0 );
Bank = ::GetSQLColumnData( query, 1 );
Kills = ::GetSQLColumnData( query, 2 );
Deaths = ::GetSQLColumnData( query, 3 );
Level = ::GetSQLColumnData( query, 4 );
LastUsedIP = ::GetSQLColumnData( query, 5 );
}
::FreeSQLQuery( query );
}
function Join( player ){
if( Level == 0 ){
::MessagePlayer("[#FF0000][TIP][#FFFFFF] Please Register To Play.", player );
::MessagePlayer( "[#FF0000][INFO][#FFFFFF]Register with /register <password>", player );
}
else if( LastUsedIP == player.IP ){
Logged = true;
::MessagePlayer( "[#FF0000] [SERVER] [#FFFFFF]Welcome back !", player );
::MessagePlayer( "[#FF0000] [SERVER] [#FFFFFF]You have been auto logged in server !", player );
}
else{
::MessagePlayer( "[#FF0000] [Tip] [#FFFFFF]Please login to play.", player );
::MessagePlayer( "[#FF0000] [INFO] [#FFFFFF]Login with /login <password>", player );
}
}
function Update( player, dbGlobal ){
::QuerySQL( dbGlobal, "UPDATE Accounts SET Cash=" + Cash + ", Bank=" + Bank + ", Kills=" + Kills + ", Deaths=" + Deaths + ", Level=" + Level + ", LastUsedIP='" + LastUsedIP + ", nogoto='" + nogoto + "' WHERE Name='" + player.Name + "' AND NameLower='" + player.Name.tolower() + "'" );
}
function Register( player, password, dbGlobal ){
::QuerySQL( dbGlobal, "INSERT INTO Accounts VALUES('" + player.Name + "', '" + player.Name.tolower() + "', '" + ::SHA256( password ) + "', 0, 0, 0, 0, 1, '" + player.IP + "', '" + 0 + "')" );
Level = 1;
LastUsedIP = player.IP;
Logged = true;
::MessagePlayer( "[#FF0000] [Info] [#FFFFFF]Successfully registered.", player );
::MessagePlayer( "[#FF0000] [Tip] [#FFFFFF]Don't forget your password. [" + password + "]", player );
}
function Login( player, password, dbGlobal ){
local query = ::QuerySQL( dbGlobal, "SELECT Password FROM Accounts WHERE Name='" + player.Name + "' AND NameLower='" + player.Name.tolower() + "'" );
if( ::GetSQLColumnData( query, 0 ) == null ){
::MessagePlayer( "[#FF0000][TIP] [#FFFFFF] You are not registered Register With /register pass.", player );
}
else if( ::SHA256( password ) != ::GetSQLColumnData( query, 0 ) ){
::MessagePlayer( "[#FF0000] [Info] [#FFFFFF]Wrong password.", player );
}
else{
LastUsedIP = player.IP;
Logged = true;
::MessagePlayer( "[#FF0000] [Info] [#FFFFFF]Successfully logged in.", player );
}
}
}
I'm sorry but what does 'prob' mean? Does it stand for 'problem'? If so, then spell the whole f*ing name because no one will be able to search for similar issues if you f*tards can't spell correctly.
thanks for telling me my mistake
Quote from: . on Apr 23, 2016, 10:22 AMI'm sorry but what does 'prob' mean? Does it stand for 'problem'? If so, then spell the whole f*ing name because no one will be able to search for similar issues if you f*tards can't spell correctly.
Quote from: Hercules on Apr 23, 2016, 10:29 AMthanks for telling me my mistake
You're welcome lol
For 'you', the 'fix' to your 'problem' is:
Remove the NAME from the queries and only use/keep the NameLower :D
[EDIT]I try but bugging my script as you know w i am exprience less local query = ::QuerySQL( dbGlobal, "SELECT Cash, Bank, Kills, Deaths, Level, LastUsedIP, nogoto FROM Accounts WHERE Name='"+NameLower='" + playerName.tolower() + "'" );
Use this:
local query = ::QuerySQL( dbGlobal, "SELECT Cash, Bank, Kills, Deaths, Level, LastUsedIP, nogoto FROM Accounts WHERE NameLower='" + playerName.tolower() + "'" );
@KAKAN love you
problem solved
At that time problem is solved but now occurring again please help
its problem due to lower alphabets and bigger if a player registered with bangash he can register again with BANGASH
Quote from: Hercules on Apr 23, 2016, 11:56 AM@KAKAN love you
gay
[/quote]
NOT gay lol
Can you show you function onPlayer Join
local query = ::QuerySQL( dbGlobal, "SELECT Password FROM Accounts WHERE Name LIKE '" + player.Name + "' '" )
Try this note I am on mobile so thee might be mistake
LIKE works as same way as player.Name.tolower
function onPlayerJoin( player ){
NewTimer("Banned", 3000, 1, player.ID );
NewTimer("Jailed", 3000, 1, player.ID );
local country = geoip_country_name_by_addr(player.IP);
if (country != null) // the plugin returned a meaningful result
Message("* " + player.Name + " is connecting from " + country + ". [" + geoip_country_code_by_addr(player.IP) + "]");
pstats[ player.ID ] = PlayerClass( player.Name, sqliteDB );
pstats[ player.ID ].Join( player );
AddUser( player );
menuJoin( player );
tuneJoin( player );
if(timer_status == false)
{
timer_status = true;
meter.Paused = false;
print("Timer Resumed");
NewTimer("sendmsgs", 100000, 0 );
}
}
Did you tried local query = ::QuerySQL( dbGlobal, "SELECT Password FROM Accounts WHERE Name LIKE '" + player.Name + "' '" )
Try this also local query = ::QuerySQL( dbGlobal, "SELECT Cash, Bank, Kills, Deaths, Level, LastUsedIP, nogoto FROM Accounts WHERE Name LIKE '" + playerName+ "'" );
now not showing that i am not registered but when i try to login its shows you are not registered with us and i can register again
@KAKAN HELP
Quote from: Hercules on Apr 25, 2016, 02:16 PMnow not showing that i am not registered but when i try to login its shows you are not registered with us and i can register again @KAKAN HELP
Try this instead:
local query = ::QuerySQL( dbGlobal, "SELECT Cash, Bank, Kills, Deaths, Level, LastUsedIP, nogoto FROM Accounts WHERE NameLower='" + playerName+ "'" );
ITS NOT WORKING showing you are not register did you ever face this problem
try this
i change this line: ::QuerySQL( dbGlobal, "INSERT INTO Accounts VALUES('" + player.Name + "', '" + player.Name.tolower() + "', '" + ::SHA256( password ) + "', 0, 0, 0, 0, 1, '" + player.IP + "', '" + 0 + "')" );
function Register( player, password, dbGlobal ) {
::QuerySQL( dbGlobal, "INSERT INTO Accounts VALUES('" + player.Name + "', '" + player.Name.tolower() + "', '" + ::SHA256( password ) + "', 0, 0, 0, 0, 1, '" + player.IP + "', 0 )" );
Level = 1;
LastUsedIP = player.IP;
Logged = true;
::MessagePlayer( "[#FF0000] [Info] [#FFFFFF]Successfully registered.", player );
::MessagePlayer( "[#FF0000] [Tip] [#FFFFFF]Don't forget your password. [" + password + "]", player );
}
not works
The thing I have you what was error with that
Is your register details being saved in database
yes saved
what's ur problem then?
its problem due to lower alphabets and bigger if a player registered with bangash he can register again with BANGASH
Is your browser in the correct order as what is required?
Screen shots are liked!!
hopefully with a registered player
hi i am with a interest news i tested cf official clan same problem to his but i think his owner doesent know test your servers
EDIT: checked army vs terrorists server same problem in this server which owner is
@Mashreq @KAKAN another checked grand theif auto european city has same same problem which owner Human
Check boss killers kingdom
no its fine but at this i auto logged may be next time when i not aautologged its say you are not registered when i try to login
@sseebbyy please can you help me in this problem please get me out of there
Quote from: Hercules on Apr 26, 2016, 11:14 AM@sseebbyy please can you help me in this problem please get me out of there
You need no tagging/forcing for getting help. Persons who are interested in your problem will simply reply.
What
@KAKAN said makes sense: use name-to-lower instead of Name.
already dided and sorry
but not working
Quote from: Hercules on Apr 26, 2016, 10:51 AMhi i am with a interest news i tested cf official clan same problem to his but i think his owner doesent know test your servers
EDIT: checked army vs terrorists server same problem in this server which owner is @Mashreq
@KAKAN
another checked grand theif auto european city has same same problem which owner Human
Well, they made it because they liked it. Not everyone likes to use NameLower.
its have no solution should i lock this topic
There is a solution to everything, you just can't do shit.
I don't want to be harsh here but I have to
We can't baby sit anymore hwre now this is the easiest prb to be. Solved as you said like 1 week before you server is ready and no one is giving you host this is reason why drake is not giving host you don't know scripting
@Coolkid minimum you dont say you cant solve it its not easy how much you understand
Doom please tell me what i do if you know
And Drake says he cant support my server name
@Hercules I have also added player name to lower and normal letters it is pretty easy job if you don't do anything wrong this is very simple
erase your old system and put it again!!!
Clicky (http://forum.vc-mp.org/?topic=224.msg1162#msg1162)
Show me your login command.
if( cmd == "register" ){
if( !text ){
MessagePlayer(WHITE+"Syntax Error!", player );
MessagePlayer(RED+"[SYNTAX]"+WHITE+" /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true ){
MessagePlayer( "You are already logged in.", player );
}
else{
pstats[ player.ID ].Register( player, text, sqliteDB );
}
Damn, my bad, you can edit your previous post, and remove login command, I meant to say your register command.
Quote from: Doom_Kill3R on Apr 26, 2016, 05:01 PMDamn, my bad, you can edit your previous post, and remove login command, I meant to say your register command.
As far as i thought! we can surely disable it through the command by using, so called
COLLATE NOCASE
, I hope you got me.
i.e :
if ( cmd == "register" )
{
local q = QuerySQL( Your_DATABASE, "SELECT * FROM TABLE_NAME WHERE HINT = '" + player.Name + "' COLLATE NOCASE" );
if ( !GetSQLColumnData( q, 0 ) )
{
//Rest of your Functions.
}
else ClientMessage("Error:You Are Already Registered"player,255,255,0);
}
This is a register problem, not a login problem.
if( cmd == "register" ){
if( !text ){
MessagePlayer( "Syntax Error!", player );
MessagePlayer( "Correct syntax: /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true ){
MessagePlayer( "You are already logged in.", player );
}
else{
pstats[ player.ID ].Register( player, text, sqliteDB );
}
}
If this is not your issue then once again Upload an image of a registered player in your browser.
Quote from: Mr_Motley on Apr 26, 2016, 05:12 PMThis is a register problem, not a login problem.
if( cmd == "register" ){
if( !text ){
MessagePlayer( "Syntax Error!", player );
MessagePlayer( "Correct syntax: /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true ){
MessagePlayer( "You are already logged in.", player );
}
else{
pstats[ player.ID ].Register( player, text, sqliteDB );
}
}
If this is not your issue then once again Upload an image of a registered player in your browser.
if ( cmd =="register")
{
local q = QuerySQL( DATABASE_NAME, "SELECT * FROM TABLE_NAME WHERE HINT = '" + player.Name + "' COLLATE NOCASE" );
if ( !GetSQLColumnData( q, 0 ) )
{
if ( text )
{
if ( pstats[ player.ID ].Logged == false )
{
pstats[ player.ID ].Register( player, text, sqliteDB );
}
else ClientMessage("You are already logged in",player,255,255,0);
}
else ClientMessage("/" + Cmd + " <_Password>",player,255,255,0);
}
else ClientMessage("Error:You Are Already Registered"player,255,255,0);
}
Well, it was that simple i guess now he just have to compile his script according to this.
No, according to FAS, the fixed register command should be:
if( cmd == "register" ){
if( !text ){
MessagePlayer( "Syntax Error!", player );
MessagePlayer( "Correct syntax: /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true ) MessagePlayer( "You are already logged in.", player );
else if( pstats[ player.ID ].Level > 0 ) MessagePlayer( "You're already registered.", player );
else pstats[ player.ID ].Register( player, text, sqliteDB );
}
Quote from: KAKAN on Apr 26, 2016, 05:34 PMNo, according to FAS, the fixed register command should be:
if( cmd == "register" ){
if( !text ){
MessagePlayer( "Syntax Error!", player );
MessagePlayer( "Correct syntax: /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true ) MessagePlayer( "You are already logged in.", player );
else if( pstats[ player.ID ].Level > 0 ) MessagePlayer( "You're already registered.", player );
else pstats[ player.ID ].Register( player, text, sqliteDB );
}
Hercules can you show your register function
constructor( playerName, dbGlobal ){
local query = ::QuerySQL( dbGlobal, "SELECT Cash, Bank, Kills, Deaths, Level, LastUsedIP, nogoto FROM Accounts WHERE Name='" + playerName + "' COLLATE NOCASE" );
if( ::GetSQLColumnData( query, 5 ) ){
Cash = ::GetSQLColumnData( query, 0 );
Bank = ::GetSQLColumnData( query, 1 );
Kills = ::GetSQLColumnData( query, 2 );
Deaths = ::GetSQLColumnData( query, 3 );
Level = ::GetSQLColumnData( query, 4 );
LastUsedIP = ::GetSQLColumnData( query, 5 );
}
::FreeSQLQuery( query );
}
::QuerySQL( dbGlobal, "SELECT Cash, Bank, Kills, Deaths, Level, LastUsedIP, nogoto FROM Accounts WHERE Name='" + playerName + "' AND NameLower='" + playerName.tolower() + "'" );
to
::QuerySQL( dbGlobal, "SELECT Cash, Bank, Kills, Deaths, Level, LastUsedIP, nogoto FROM Accounts WHERE Name='" + playerName + "' COLLATE NOCASE" );
If any of this does not work Once again we need pictures of your Browser( with a registered player) also include your create table.
Quote from: Mr_Motley on Apr 26, 2016, 08:02 PMIf any of this does not work Once again we need pictures of your Browser( with a registered player) also include your create table.
I believe that now work. I had the same problem, and that was my solution.
Now the server checks
Necrose and
necrose and loads the stats for any of these nicks :).
I have made a small mistake and had my create table values off a little as well (added to much at once) in the browser causing issues upon registering and logging in, That is the only reason why I said that
What are all these messy replies? The problem is in his register command and KAKAN's conmand which he posted will work pretty well.
doom its now shows you registered please login
but while logging its says me you are not registered i think problem is in login cmd and function and take a look on function update and register maybe a mistake here
else if( cmd == "login" ){
if( !text ){
MessagePlayer( "Syntax Error!", player );
MessagePlayer( "Correct syntax: /login <password>", player );
}
else if( pstats[ player.ID ].Logged == true ){
MessagePlayer( "You are already logged in.", player );
}
else{
pstats[ player.ID ].Login( player, text, sqliteDB );
}
function Login( player, password, dbGlobal ){
local query = ::QuerySQL( dbGlobal, "SELECT Password FROM Accounts WHERE Name='" + player.Name + "' AND NameLower='" + player.Name.tolower() + "'" );
if( ::GetSQLColumnData( query, 0 ) == null ){
::MessagePlayer( "[#FF0000][TIP] [#FFFFFF] You are not registered Register With /register pass.", player );
}
else if( ::SHA256( password ) != ::GetSQLColumnData( query, 0 ) ){
::MessagePlayer( "[#FF0000] [Info] [#FFFFFF]Wrong password.", player );
}
else{
LastUsedIP = player.IP;
Logged = true;
::MessagePlayer( "[#FF0000] [Info] [#FFFFFF]Successfully logged in.", player );
}
function Update( player, dbGlobal ){
::QuerySQL( dbGlobal, "UPDATE Accounts SET Cash=" + Cash + ", Bank=" + Bank + ", Kills=" + Kills + ", Deaths=" + Deaths + ", Level=" + Level + ", LastUsedIP='" + LastUsedIP + ", nogoto='" + nogoto + "' WHERE Name='" + player.Name + "' AND NameLower='" + player.Name.tolower() + "'" );
}
function Register( player, password, dbGlobal ){
::QuerySQL( dbGlobal, "INSERT INTO Accounts VALUES('" + player.Name + "', '" + player.Name.tolower() + "', '" + ::SHA256( password ) + "', 0, 0, 0, 0, 1, '" + player.IP + "', '" + 0 + "')" );
Level = 1;
LastUsedIP = player.IP;
Logged = true;
::MessagePlayer( "[#FF0000] [Info] [#FFFFFF]Successfully registered.", player );
::MessagePlayer( "[#FF0000] [Tip] [#FFFFFF]Don't forget your password. [" + password + "]", player );
}
For fuck sake dude, if you want help, then atleast follow the instructions given to you, I've told you to give me your register command, if you're so sure about the error, where and why is it occurring then fix it yourself.
you say me modify your post in which i post login cmd when you say me by mistake give me login cmds i updated my that post with register
Quote from: Hercules on Apr 26, 2016, 04:51 PMif( cmd == "register" ){
if( !text ){
MessagePlayer(WHITE+"Syntax Error!", player );
MessagePlayer(RED+"[SYNTAX]"+WHITE+" /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true ){
MessagePlayer( "You are already logged in.", player );
}
else{
pstats[ player.ID ].Register( player, text, sqliteDB );
}
if( cmd == "register" )
{
if( !text )
{
MessagePlayer(WHITE+"Syntax Error!", player );
MessagePlayer(RED+"[SYNTAX]"+WHITE+" /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true )
{
MessagePlayer( "You are already logged in.", player );
}
else
{
local szName = player.Name, szNameLower = player.Name.tolower(), sqlQuery = mysql_query( sqLiteDB, "SELECT Level FROM Accounts WHERE Name='" + szName + "' AND NameLower='" + szNameLower + "'" );
if( mysql_num_rows( sqlQuery ) == 1 ) MessagePlayer( "You are already registered.", player );
else
{
pstats[ player.ID ].Register( player, params[0], params[1], sqLiteDB );
}
mysql_free_result( sqlQuery );
}
}
Quote from: Doom_Kill3R on Apr 27, 2016, 12:56 PMif( cmd == "register" )
{
if( !text )
{
MessagePlayer(WHITE+"Syntax Error!", player );
MessagePlayer(RED+"[SYNTAX]"+WHITE+" /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true )
{
MessagePlayer( "You are already logged in.", player );
}
else
{
local szName = player.Name, szNameLower = player.Name.tolower(), sqlQuery = mysql_query( sqLiteDB, "SELECT Level FROM Accounts WHERE Name='" + szName + "' AND NameLower='" + szNameLower + "'" );
if( mysql_num_rows( sqlQuery ) == 1 ) MessagePlayer( "You are already registered.", player );
else
{
pstats[ player.ID ].Register( player, params[0], params[1], sqLiteDB );
}
mysql_free_result( sqlQuery );
}
}
Test it now
This now sounds like a hashing issue(I could be wrong).
what hashing are you using are they both the same ?
example: your login is MD5 then the register is whirlpool
It needs to be one or the other not two different ones, double check this, also Doom_Kill3R only posting similar issues and other stuff in case he happened to have the same issues. I still feel like this is also possibly a database table issue
(https://forum.vc-mp.org/proxy.php?request=http%3A%2F%2Fi63.tinypic.com%2F23sc40i.png&hash=11b7e2dd9c8306f1c646ae4aaace75f4322176cc)
As you can see from the LOCALS, sqlQuery is false. Which means your query fails. It's syntax is invalid or your mysql isn't actually connected.
Quote from: Thijn on Apr 27, 2016, 02:30 PMyour mysql isn't actually connected.
He's asking with SQLite, so it's shit to think about MySQL :D
Well,
@Hercules, scroll up and try the register command which I posted.
Quote from: KAKAN on Apr 26, 2016, 05:34 PMNo, according to FAS, the fixed register command should be:
if( cmd == "register" ){
if( !text ){
MessagePlayer( "Syntax Error!", player );
MessagePlayer( "Correct syntax: /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true ) MessagePlayer( "You are already logged in.", player );
else if( pstats[ player.ID ].Level > 0 ) MessagePlayer( "You're already registered.", player );
else pstats[ player.ID ].Register( player, text, sqliteDB );
}
is that i try it but not works
Quote from: Hercules on Apr 27, 2016, 03:13 PMQuote from: KAKAN on Apr 26, 2016, 05:34 PMNo, according to FAS, the fixed register command should be:
if( cmd == "register" ){
if( !text ){
MessagePlayer( "Syntax Error!", player );
MessagePlayer( "Correct syntax: /register <password>", player );
}
else if( pstats[ player.ID ].Logged == true ) MessagePlayer( "You are already logged in.", player );
else if( pstats[ player.ID ].Level > 0 ) MessagePlayer( "You're already registered.", player );
else pstats[ player.ID ].Register( player, text, sqliteDB );
}
is that i try it but not works
if( cmd == "register" ){
if( text )
{
if( pstats[ player.ID ].Logged == false )
{
local q = QuerySQL( dbGlobal, "SELECT Name FROM Accounts WHERE Name = '" + player.Name + "' COLLATE NOCASE" );
if ( GetSQLColumnData( q, 0 ) )
{
pstats[ player.ID ].Register( player, text, sqliteDB );
}
else ClientMessage("Error:You Are Already Registered"player,255,255,0);
}
else ClientMessage("You are already logged in",player,255,255,0);
}
else ClientMessage("/" + Cmd + " <_Password>",player,255,255,0);
}
not working if i try register a unregister player its says you are already registered
ADM Script Version: 1.0Clicky (http://forum.vc-mp.org/?topic=332.0)
You are Wasting your time and its not needed for something so simple. Please consider moving on to a Pre built accounting serverKind Regards
~Motley
its not the solution to leave my own hand make server and use another
on other hand ADM have same problem which i have
thanks to all but problem is still not solved and going lock the topic if anyone find any solution tell me in pm i will unlock it
@MaTaDeToR Thanks you solved my problem solution is which he give me in pm
Quote from: MaTaDeToR on Apr 28, 2016, 09:46 AMif( cmd == "register" ){
if( text )
{
if( pstats[ player.ID ].Logged == false )
{
local q = QuerySQL( dbGlobal, "SELECT Name FROM Accounts WHERE Name = '" + player.Name + "' COLLATE NOCASE" );
if ( !GetSQLColumnData( q, 0 ) )
{
pstats[ player.ID ].Register( player, text, sqliteDB );
}
else ClientMessage("Error:You Are Already Registered"player,255,255,0);
}
else ClientMessage("You are already logged in",player,255,255,0);
}
else ClientMessage("/" + Cmd + " <_Password>",player,255,255,0);
}
I just did a mistake over, and try this one! i can bet this one is going to Work, reply back if it work's.
[mergedate]1461839416[/mergedate]
@Coolkid you are posting an useless things thats why not working and saying me baby sit lol