06.07.2009, 16:04
I am not sure but I think you have todo:
pawn Код:
dcmd_register(playerid, params[])
{
new pName[24], PlayerFile[50],hashedPassword = strval(params);
GetPlayerName(playerid, pName, sizeof(pName));
format(PlayerFile, sizeof(PlayerFile), "/users/%s.ini", pName);
if(dini_Exists(PlayerFile))
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "You have already registered! Please use /login to login or choose another nicknname.");
return 1;
}
if(!dini_Exists(PlayerFile))
{
if (!strlen(params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /register [password]");
dini_Create(PlayerFile);
dini_Set(PlayerFile, "Password", MD5_Hash(hashedPassword));
printf("Geregistreerd: %s, Pass: %s", pName, MD5_Hash(hashedPassword));
dini_IntSet(PlayerFile, "AdminLevel", 0);
dini_IntSet(PlayerFile, "Deaths", 0);
dini_IntSet(PlayerFile, "Kills", 0);
dini_IntSet(PlayerFile, "Banned", 0);
SendClientMessage(playerid, COLOR_GREEN, "You have succesfully registered, you have been automatically logged in.");
PlayerInfo[playerid][Registered] = 1;
PlayerInfo[playerid][LoggedIn] = 1;
}
return 1;
}