29.01.2012, 14:58
Hello,
When I register an account on my server and try to quit and log back on it first tells me I have to register, but when I try to register again it does tell me the account is already taken. Any ideas?
The piece you get onplayerconnect
The part that tells me the account is already taken:
Edit: I fixed it by changing
to
under onplayerconnect
When I register an account on my server and try to quit and log back on it first tells me I have to register, but when I try to register again it does tell me the account is already taken. Any ideas?
The piece you get onplayerconnect
pawn Код:
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "users/%s.ini", plname);
if(fexist(string))
{
gPlayerAccount[playerid] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: That name is registered, please wait to login.");
SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now login by typing your password below");
DisplayDialogForPlayer(playerid, 1); //login
return 1;
}
else
{
gPlayerAccount[playerid] = 0;
SendClientMessage(playerid,COLOR_YELLOW,"You dont have an account. Please register your account to proceed");
DisplayDialogForPlayer(playerid, 2); //register
return 1;
}
}
pawn Код:
new string[128];
format(string, sizeof(string), "users/%s.ini", sendername);
// if(dini_Exists(string))
if(fexist(string))
{
SendClientMessage(playerid, COLOR_YELLOW, "That name is already taken, please choose a different one.");
return 1;
pawn Код:
new plname[MAX_PLAYER_NAME];
new string[MAX_PLAYER_NAME];
pawn Код:
new plname[128];
new string[128];