YCMD:register(playerid, params[], help)
{
if(help)
{
SendClientMessage(playerid, 0xFF0000AA, "Creates a account.");
}
if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
return SendClientMessage(playerid, COLOR_ORANGE, "ERROR: You have already registered!");
else if(!params[0])
return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /register [password]");
else if(strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
{
new string[63];
format(string, sizeof(string), "ERROR: Password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
return SendClientMessage(playerid, COLOR_ORANGE, string);
}
else
{
new buf[129];
WP_Hash(buf, 129, params);
format(gPlayerInfo[playerid][PLAYER_PASS], 129, "%s", buf);
print(gPlayerInfo[playerid][PLAYER_PASS]);
new pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,sizeof pName);
new file[37];
format(file,sizeof file,PlayerFile,pName);
new INI:handler = INI_Open(file);
INI_WriteString(handler, "Pass", buf);
INI_Close(handler);
print(buf);
gPlayerInfo[playerid][PLAYER_REGGED] = 1;
gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
SaveUser(playerid);
new string[128]; format(string, sizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in.", params);
return SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}
CE4E7BFAC27A4BD5F015ADF67F0FA3072B9AF27774E1E14028E69B85858BC6116A02E67B985A97C07EC844B94DCD4F1C48F354AE19D588C512A3FA195082528A
CE4E7BFAC27A4BD5F015ADF67F0FA3072B9AF27774E1E14028E69B85858BC6116A02E67B985A97C07EC844B94DCD4F1C48F354AE19D588C512A3FA195082528
Make the buff strings bigger then 129, also is it giving any errors or warnings?
|
Use the "buf" variable instead of formating a string. Buf holds the hash, without the need of formatting.
EDIT, Scratch that i never realised you was using "buf" sorry. |
CE4E7BFAC27A4BD5F015ADF67F0FA3072B9AF27774E1E14028E69B85858BC6116A02E67B985A97C07EC844B94DCD4F1C48F354AE19D588C512A3FA195082528A
CE4E7BFAC27A4BD5F015ADF67F0FA3072B9AF27774E1E14028E69B85858BC6116A02E67B985A97C07EC844B94DCD4F1C48F354AE19D588C512A3FA195082528