cmd /changepass
#1

i need a cmd /changepass /setpass or /newpass with md5 encryption...if you need something from my gamemod, please tell...thanks
Reply
#2

a) What do you use for MD5 encryption? (Do you have any plugin/function? or you want us to get one for you?)
b) What is the variable name where you store player's pass key?
c) What saving system do you use? (SQL, y_ini, dini...)
Reply
#3

a) i have a function with md5..if a player register in user.ini passwords is encrypted
b) in user.ini is Key , if you said this
c) i dont know...i want the command
Quote:

if(strcmp(cmd, "/changepass", true) == 0)

Reply
#4

You NEED a saving system first! Go look at Kush's y_ini tutorial.
Reply
#5

He asked you on
a) if you are using whirlpool, udb_hash or something else..
b) for the variable you store the password, not the file Location.
pawn Код:
// Example:
PlayerInfo[ playerid ][ pPass ];
c) not the command processor, but if you use Dini, y_ini, or SQL (SQLite or MySQL)
Reply
#6

a) no
b)
Код:
	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 is this
c) y_ini
Reply
#7

I have no idea how your functions/codes look like, the code below is just a typical example. Change it according to your own settings.

pawn Код:
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;
    }
Reply
#8

Код:
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
i got this...
Reply
#9

You need to fix those yourself, as I said I don't know how exactly your code looks like!

Make some changes, don't just copy-paste.

For example, rename "tmp" to "tmpkey" or "password"
set correct variable names, etc..
Reply
#10

Код:
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);
this is ok?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)