12.02.2012, 16:49
i need a cmd /changepass /setpass or /newpass with md5 encryption...if you need something from my gamemod, please tell...thanks
if(strcmp(cmd, "/changepass", true) == 0) |
// Example:
PlayerInfo[ playerid ][ pPass ];
if(IsPlayerConnected(playerid)) { new string3[32]; new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); format(string3, sizeof(string3), "akk/%s.ini", playername3); new File = ini_openFile(string3); if(!File)
if(!strcmp(cmd, "/changepass", true, 11))
{
new tmp[32];
tmp = strtok(cmd, idx);
if(strlen(tmp) < 5 || strlen(tmp) > 20)
return SendClientMessage(playerid, -1, "Your new password needs to be within 5 - 20 characters.");
format
(
PlayerInfo[playerid][pKey],
sizeof PlayerInfo[playerid][pKey],
"%s", MD5_hash(tmp) //<-- Just replace MD5_hash with the function you use.
);
new message[128];
format
(
message,
sizeof message,
"Your new password has been set to: \"%s\" Use it yo login next time!",
tmp
);
SendClientMessage(playerid, -1, message);
return 1;
}
D:\samp03\server\gamemodes\M3S.pwn(17323) : warning 219: local variable "tmp" shadows a variable at a preceding level D:\samp03\server\gamemodes\M3S.pwn(17329 -- 17332) : error 001: expected token: "]", but found "-identifier-" D:\samp03\server\gamemodes\M3S.pwn(17332) : warning 215: expression has no effect D:\samp03\server\gamemodes\M3S.pwn(17332) : error 001: expected token: ";", but found "]" D:\samp03\server\gamemodes\M3S.pwn(17332) : error 029: invalid expression, assumed zero D:\samp03\server\gamemodes\M3S.pwn(17332) : fatal error 107: too many error messages on one line
public OnPlayerRegister(playerid, password[]) { if(IsPlayerConnected(playerid)) { new string3[32]; new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); format(string3, sizeof(string3), "akk/%s.ini", playername3); new File = ini_openFile(string3); if(!File) { ini_setString(File,"Key",MD5_Hash(password)); PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);