Search

open.mp forum

RegisterLogin

Discussion

General
Chat
Tech
Life
Art
Programming
open.mp
Development Updates
Questions and Suggestions
SA-MP
General Discussions
Videos and Screenshots
Support
Pawn Scripting
Tutorials
Releases
Plugins
Libraries
Filterscripts
Gamemodes
Maps
Advertisements
Other languages
Spanish/Espa?ol
Programaci?n
Discusi?n GTA SA Multijugador
Mods
Offtopic
Juegos
Portuguese/Portugu?s
Russian/???????
Italian/Italiano
Dutch/Nederlands
German/Deutsch
Romanian/Rom?na
Ex-Yu
Polish/Polski
Og?lne
Serwery
Skryptowanie
Filmiki i zdjecia
Lithuanian/Lietuvi?kas
French/Fran?ais
Hungarian/Magyar
Hindi/Urdu
Turkish
Other
Internal
Team
Hidden
Archived

Library

 Collections Links Members Roles

How to make pasword validation?

Hello i need help with?password validation, so if registered user types wrong password more than 3 times to login, it should...

ID
d6ouivnilegovhg7btg0
author
crypticsin's avatar

CrypticSin

@crypticsin


View profile
Copy link
  Report member
started
Jun 27, 2021
replies
0
participating
No

scroll to top

powered by storyden

Login
Discussion
Pawn Scripting
How to make pasword validation?
crypticsin's avatar

CrypticSin

@crypticsin


View profile
Copy link
  Report member
• 4y
Pawn Scripting

How to make pasword validation?

pawn

Hello i need help with?password validation, so if registered user types wrong password more than 3 times to login, it should kick the user?



public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])

{

? ? if(dialogid == REGISTER_DIALOG)

? ? {

? ? ? ? if(response)

? ? ? ? {

? ? ? ? ? ? if(strlen(inputtext) < 3 || strlen(inputtext) > 24)

? ? ? ? ? ? {

? ? ? ? ? ? ? ? SendClientMessage(playerid, -1, "SERVER: Your password must be from 3-24 characters.");

? ? ? ? ? ? ? ? return ShowPlayerDialog(playerid, REGISTER_DIALOG, DIALOG_STYLE_PASSWORD, "{FFFFFF}Register Account", "{FFFFFF}Please enter a password below to register an account:", "Enter", "Leave");

? ? ? ? ? ? }

? ? ? ? 

? ? ? ? ? ? bcrypt_hash(playerid, "OnPlayerRegister", inputtext, 12);

? ? ? ? ? ? return 1;

? ? ? ? }

? ? ? ? else

? ? ? ? {

? ? ? ? ? ? Kick(playerid);

? ? ? ? }

? ? }

? ? else if(dialogid == LOGIN_DIALOG)

? ? {

? ? ? ? if(response)

? ? ? ? {

? ? ? ? ? ? new query, field;

? ? ? ? ? ? format(query, sizeof(query), "SELECT `PASS` FROM `USERS` WHERE `NAME` = '%s' COLLATE NOCASE", DB_Escape(ReturnName(playerid)));

? ? ? ? ? ? database_result = db_query(server_database, query);

? ? ? ? ? ? ? if(db_num_rows(database_result))

? ? ? ? ? ? {

? ? ? ? ? ? ? ? db_get_field_assoc(database_result, "PASS", field, sizeof(field));

? ? ? ? ? ? ? ? ? bcrypt_verify(playerid, "OnPlayerLogin", inputtext, field);

? ? ? ? ? ? }

? ? ? ? ? ? return 1;

? ? ? ? }

? ? ? ? else

? ? ? ? {

? ? ? ? ? ? Kick(playerid);

? ? ? ? }

? ? }

? ? return 1;

}
0 likes0 replies

    Please sign up or log in to reply