09.09.2018, 16:18
First you must check from the database if the player is registered or not.
It's just an example for you to understand better. You must change everything for your variables.
PHP код:
new DBResult:Result, Query[1200];
format(Query, sizeof(Query),"SELECT PASS FROM USERS WHERE NAME = '%s'", Player[playerid][Name]); //Change by the variables of your database and game mode.
Result = db_query(database, Query);
if(db_num_rows(Result))
{
Player[playerid][Pass] = db_get_field_int(Result, 0);
Player[playerid][Registered] = true;
//show dialog to login
}
else //If the player is not registered.
{
}
db_free_result(Result);