17.05.2014, 10:37
This Command Is From LuxAdmin,When I Use /setpass [accountname] [newpassword] When I Set Someone's Pass,The Pass Doesn't Change.
Codes:
Codes:
pawn Код:
dcmd_setpass(playerid,params[])
{
if(AccInfo[playerid][Level] >= 10)
{
new string[128], tmp[256], tmp2[256], Index;
tmp = strtok(params,Index);
tmp2 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /setpass [playername] [new password]") &&
SendClientMessage(playerid, orange, "Function: Will modify account password of specified player");
if(strlen(tmp2) < 4 || strlen(tmp2) > MAX_PLAYER_NAME)
return SendClientMessage(playerid,red,"ERROR: Incorrect password length");
if(udb_Exists(tmp))
{
new file[128], Pass[256];
format(file,sizeof(file),"/LuxAdmin/Accounts/%s.sav",udb_encode(PlayerName2(playerid)));
new buf[145];
WP_Hash(buf, sizeof(buf), tmp2);
Pass = dini_Get(file, "Password");
dini_Set(file, "Password", buf);
PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
format(string, sizeof(string),"|- You have successfully set \"%s's\" account password to \"%s\" -|", tmp, tmp2);
return SendClientMessage(playerid,yellow,string);
} else return SendClientMessage(playerid,red, "ERROR: This player doesnt have an account");
}
else return SendClientMessage(playerid,red,"ERROR: You Are Not One Of The Owners!");
}