Changepass
#1

Hello,
How to make a command to change the password via the "DINI" please?
Reply
#2

PHP код:
CMD:changepass(playerid,params[])
{
if(!
strlen(params))
{
SendClientMessage(playerid,-1,"Usage: /changepass (new pass)");
return 
1;
}
if(
strval(params) < 6
{
SendClientMessage(playerid,-1,"ERROR: Password 
Must be at least 6 characters"
);
return  
1;
}
if(
GetPlayerState(playerid) == PLAYER_STATE_WASTED
{
 
SendClientMessage(playerid,-1,"You are must be spawned!");
return 
1;
}
dUserSetINT(playerid).("Password",params);
new 
string[128];
format(string,sizeof string,"
You change the password %s"
,params);
SendClientMessage(playerid,-1,string);
return 
1;

Change the password by Mode
in the string
Reply
#3

error 035: argument type mismatch (argument 1)

dUserSetINT(playerid).("Password",params);

Why?
Reply
#4

ohh sorry change this
PHP код:
new name[24]; 
GetPlayerName(playerid,name,24);
dUserSetINT(name(playerid)).("Password",params); 
Reply
#5

error 012: invalid function call, not a valid address
warning 215: expression has no effect
error 001: expected token: ";", but found ")"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line


line: dUserSetINT(name(playerid)).("Password",params);
Reply
#6

Sorry I do not understand DINI . I'm understand MySQL.
The logic of trying to solve this
Reply
#7

Try...
Код:
CMD:cpass(playerid, params[])
{
	new OldPass[129], NewPass[129], Name[24], FileName[40];
	if(sscanf(params, "s[129]s[129]", OldPass, NewPass)) return SendClientMessage(playerid, -1, "/cpass [old pass] [new pass]");
	
	GetPlayerName(playerid, Name, sizeof Name);
	format(FileName, sizeof FileName, "%s.inc", Name);
	
	if(strcmp(dini_Get(FileName, "password"), OldPass, false) == 0)
	{
		dini_Set(FileName, "password", NewPass);
		SendClientMessage(playerid, -1, "Password has been changed.");
	}
	else SendClientMessage(playerid, -1, "Old Password is wrong!");
	
	return 1;
}
Reply
#8

Does not work. When I write random password instead of the old password, it writes that successfully changed. If I change the password so new, not saved new password.
Reply
#9

Quote:
Originally Posted by andreyysk
Посмотреть сообщение
Does not work. When I write random password instead of the old password, it writes that successfully changed. If I change the password so new, not saved new password.
The line of password in file of the player is password? You are changed?
Reply
#10

Now I write the old password correctly, but writes that it is wrong.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)