SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Thread Tools Display Modes
Old 24/12/2018, 08:09 PM   #1
Join Date: Jul 2017
Posts: 140
Reputation: 12
Default User confirmation

Hello, I have a problem with the user identification when it connects, the problem is that a user registers normal, example, with the name "Samp", then the player leaves and another user enters with the name "samp", then the server recognizes it as the previous user, by this I mean that it does not detect minuscule and capital letters in the name. And then the "samp" player inherits all the data of the "Samp" player

Another example: Name: Samp (admin), "Samp" leaves the server and another user enters with the name "Samp." (It has a point at the end), The server does not ask password to that user and automatically passes the login and gives all the data of the other player (the admin)

I use SQLite.

PHP Code:

new DBResult:ResultDB_Query[140];
format(DB_Querysizeof(DB_Query), "SELECT `p_pass`, `p_salt` FROM `players` WHERE `p_name` = '%q'"pInfo[playerid][NAME]);
Result db_query(b_dbDB_Query);
db_num_rows(Result)) //registered user
db_get_field_assoc(Result"PASS"pInfo[playerid][PASS], 64 1);
db_get_field_assoc(Result"SALT"pInfo[playerid][SALT], 16);

pInfo[playerid][p_Registered] = true//confirms that the player is registered
ShowPlayerDialog(playeriddialog_loginDIALOG_STYLE_INPUT,"LOGIN","enter your password.""login""exit");
//Unregistered user
SendClientMessage(playerid, -1"{FFFFFF}Welcome to server");
SapMan is offline   Reply With Quote
Old 25/12/2018, 04:14 PM   #2
Threshold's Avatar
Join Date: Nov 2012
Location: Australia
Posts: 3,125
Reputation: 529
Default Re: User confirmation

Are you sure 'pInfo[playerid][NAME]' holds the right value? Where do you get the player's name?

Perhaps it holds the name of the previous player.

Kar's Cops and Robbers 2020
Threshold is offline   Reply With Quote
Old 25/12/2018, 04:43 PM   #3
Join Date: Jul 2017
Posts: 140
Reputation: 12
Default Re: User confirmation

I already solved this problem, but now I have something similar with the command "/ admins", and in order not to create another topic, I am still here.

The error is that if an administrator is called "Samp", it appears in the list of administrators as "connected", but when the administrator "Samp" leaves the server and another player enters with the name "samp", in the list of " / administrators "connected and disconnected, will mark the administrator" Samp "as if it were connected. By this I mean that if the name of a player looks like an administrator, for example: "Samp" (it's admin) and "samp" (it's a player), and the administrator disconnects and the player connects to the server, the "/ admins" list will continue to mark it as connected because their names are similar.

Any solution? I hope I have explained well.


PHP Code:
pInfo[playerid][pADMIN_LIST_DIALOG] = 0;

str[90], string[1800];
format(stringsizeof string"");

DBResult:ResultDB_Query[128], lines;
format(DB_Querysizeof(DB_Query), "SELECT p_name, p_admin_level FROM players WHERE p_admin_level > '0' ORDER BY p_admin_level * 1 DESC LIMIT 19 OFFSET %d"pInfo[playerid][pADMIN_LIST_DIALOG] * 19);
Result db_query(basedbDB_Query);

player_name[24], connect;
idb_num_rows(Result); i++)
format(strsizeof str"%s\t%s\t%s\n"player_nameAdmin_Name_Rankdb_get_field_int(Result1) ), (connect != INVALID_PLAYER_ID ? ("{00FF00}connected"):("{FF0000}disconnected")));
lines ++;

pInfo[playerid][pADMIN_DIALOG_BACK] = lines;

SapMan is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Password Confirmation eikzdej Scripting Help 2 23/03/2016 09:40 AM
[Include] Confirmation Dialog Mmartin Includes 13 12/03/2015 08:35 PM
How to make a password confirmation? Xtreme Brotherz Scripting Help 7 09/05/2014 03:09 PM
Confirmation email. ZeQualX Scripting Help 1 07/02/2014 04:14 AM
Bug Confirmation - Spawn Info Proteus Help Archive 7 05/05/2010 01:57 PM

All times are GMT. The time now is 01:03 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.