12.07.2010, 12:47
Like this?
Because that didn't work either o.O
pawn Код:
dcmd_login(playerid, params[])
{
format(file,sizeof(file),PlayerFile,pName(playerid));
if(!dini_Exists(file))
return SendClientMessage(playerid, Red, "ERROR: Please register before you try to login.");
else if(pInfo[playerid][Logged] == 1)
return SendClientMessage(playerid, Red, "ERROR: You are already logged-in.");
else if(!params[0])
return SendClientMessage(playerid, Red, "USAGE: /login [password]");
else
{
new password = num_hash(params);
if(dini_Int(file, "Password") == password)
{
pInfo[playerid][Logged] = 1;
return SendClientMessage(playerid, lBlue, "You have successfully logged in to your account.");
}
else
return SendClientMessage(playerid, Red, "ERROR: Incorrect password.");
}
}