• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] How to tell user if they are registered or not?
#1
I've got a login and registration system which works using SQLlite.



Im trying to let the server tell the player whether they are registered or not?



So if they are already registered the server should say?"Welcome back 'player' You are already registered on the server please log in to continue." By returning the playername.



But if they are not registered it should prompt the user with "The 'username' is not registered on this server."



PHP Code:
public OnPlayerConnect(playerid)

{

SetPlayerCamera(playerid);

? ? 
SetPlayerScore(playerid0);

? ? 

? ? 
PlayerInfo[playerid][pKills] = 0;

PlayerInfo[playerid][pDeaths] = 0;



PlayerInfo[playerid][pLoggedIn] = false;



new 
query[128];

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

database_result db_query(server_databasequery);

? if(
db_num_rows(database_result))

{

// Registered accounts see this login

ShowPlayerDialog(playeridLOGIN_DIALOGDIALOG_STYLE_PASSWORD"{FFFFFF}TWDZS: Account Login""{FFFFFF}Please enter your password below to login to your account:""Enter""Leave"); 

}

else

{

ShowPlayerDialog(playeridREGISTER_DIALOGDIALOG_STYLE_PASSWORD"{FFFFFF}TWDZS: Register Account""Please enter a strong password to register your account""Register""Cancel");

}

return 
1;




  Reply


Messages In This Thread
How to tell user if they are registered or not? - by CrypticSin - 2021-06-26, 11:14 AM

Forum Jump: