05.02.2010, 05:37
Add this at the end of your code: http://pawn.pastebin.com/f263f249e
And:
Remember to load/save the password into the variable gPlayerInfo[playerid][PLAYER_PASS] when registering and connecting to the server.
And:
pawn Код:
dcmd_login(playerid, params[])
{
if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
{
if(gPlayerInfo[playerid][PLAYER_LOGGED] == 0)
{
new
Password[81];
if(sscanf(params, "s", Password)) return SendClientMessage(playerid, COLOR, "USAGE: /login [password]");
else if(strmp(Password, gPlayerInfo[playerid][PLAYER_PASS], false) != 0) return SendClientMessage(playerid, COLOR, "ERROR: Incorrent password!");
else
{
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
SendClientMessage(playerid, COLOUR, "You have successfully logged into your account!");
OnPlayerLogin(playerid);
}
}
else SendClientMessage(playerid, COLOR, "ERROR: You are already logged in!");
}
else SendClientMessage(playerid, COLOR, "ERROR: You must register first to do that! Use /register [password] to register and login.");
return 1;
}