Change password Cmd
#1

Please I Need This Command.
RE if you need any info about my admin system.
Please Help me
i can +rep you if u Help me
Reply
#2

Which save system you use:y_ini,mysql,dini?
Reply
#3

y_ini
eX
Код:
public loadaccount_user(playerid, name[], value[])
{
	INI_String("Password", PlayerInfo[playerid][Password], 129);
//	INI_Int("RegID", PlayerInfo[playerid][RegID]);
	INI_String("LastActive", lastactive, 50);
	INI_String("Registered_On", PlayerInfo[playerid][RegOn], 20);
	INI_Int("Admin", PlayerInfo[playerid][Admin]);
	INI_Int("VIP", PlayerInfo[playerid][VIP]);
	INI_String("AltName", PlayerInfo[playerid][AltName], 30);
	INI_Int("Cash", PlayerInfo[playerid][Cash]);
	INI_Int("Score", PlayerInfo[playerid][Score]);
	INI_Int("Kills", PlayerInfo[playerid][Kills]);
	INI_Int("Deaths", PlayerInfo[playerid][Deaths]);
	INI_Int("Skin", PlayerInfo[playerid][Skin]);
	INI_Int("WeaponSet", PlayerInfo[playerid][WeaponSet]);
	INI_Hex("Color", PlayerInfo[playerid][Color]);
	INI_Int("Hours", PlayerInfo[playerid][Hours]);
	INI_Int("Minutes", PlayerInfo[playerid][Minutes]);
	INI_Int("Helmet", PlayerInfo[playerid][Helmet]);
	return 1;
}
Reply
#4

Quote:
Originally Posted by anassmaroc
Посмотреть сообщение
y_ini
eX
Код:
public loadaccount_user(playerid, name[], value[])
{
	INI_String("Password", PlayerInfo[playerid][Password], 129);
//	INI_Int("RegID", PlayerInfo[playerid][RegID]);
	INI_String("LastActive", lastactive, 50);
	INI_String("Registered_On", PlayerInfo[playerid][RegOn], 20);
	INI_Int("Admin", PlayerInfo[playerid][Admin]);
	INI_Int("VIP", PlayerInfo[playerid][VIP]);
	INI_String("AltName", PlayerInfo[playerid][AltName], 30);
	INI_Int("Cash", PlayerInfo[playerid][Cash]);
	INI_Int("Score", PlayerInfo[playerid][Score]);
	INI_Int("Kills", PlayerInfo[playerid][Kills]);
	INI_Int("Deaths", PlayerInfo[playerid][Deaths]);
	INI_Int("Skin", PlayerInfo[playerid][Skin]);
	INI_Int("WeaponSet", PlayerInfo[playerid][WeaponSet]);
	INI_Hex("Color", PlayerInfo[playerid][Color]);
	INI_Int("Hours", PlayerInfo[playerid][Hours]);
	INI_Int("Minutes", PlayerInfo[playerid][Minutes]);
	INI_Int("Helmet", PlayerInfo[playerid][Helmet]);
	return 1;
}
can i see your register command or what every save the password for register?
Reply
#5

Quote:
Originally Posted by jlalt
Посмотреть сообщение
can i see your register command or what every save the password for register?
PHP код:
    if (dialogid == REGISTER)
    {
        if (!
response) return Kick(playerid);
        if (
response)
        {
            if (!
strlen(inputtext))
            {
                
ShowPlayerDialog(playeridREGISTERDIALOG_STYLE_PASSWORD""RED">> "PREMIUM"Account Register"""WHITE"Welcome to "RED"X1treme Stunting Freeroam"WHITE"!\n"WHITE"This account is "RED"not "WHITE"registered.\n\n"YELLOW"» Please enter a password below to register.""Register""Quit");
                return 
1;
            }
            new 
hashpass[129], date[20], yearmonthdaystr[200];
            new    
random_color = ( 16777216 random256 ) ) + ( 65536 random256 ) ) + ( 256 random256 ) ) + 255;
            
WP_Hash(hashpasssizeof(hashpass), inputtext);
             
getdate(yearmonthday);
            
format(datesizeof(date), "%d/%d/%d"daymonthyear);
            new 
INI:File INI_Open(UserPath(playerid));
            
INI_SetTag(File"Player's Data");
            
INI_WriteString(File"Password"hashpass);
            
INI_WriteString(File"Registered_On"date);
             
INI_WriteInt(File,"Admin"0);
            
INI_WriteInt(File,"VIP"0);
            
INI_WriteInt(File,"Cash"0);
            
INI_WriteInt(File,"Score"0);
            
INI_WriteInt(File,"Kills"0);
            
INI_WriteInt(File,"Deaths"0);
            
INI_WriteInt(File"Hours"0);
            
INI_WriteInt(File"Minutes"0);
            
INI_Close(File);
            
gTotalRegisters++;
            
GivePlayerMoney(playerid5000);
            
PlayerInfo[playerid][Hours] = 0;
            
PlayerInfo[playerid][Minutes] = 0;
            
PlayerInfo[playerid][Helmet] = 1;
            
SendClientMessage(playeridCOLOR_PINK""PREMIUM"*** "LIGHTBLUE"Thank you for registering your account!");
            
PlayerInfo[playerid][RegOn] = date;
            
SpawnPlayer(playerid);
              
format(strsizeof(str), ""RED"[XS] {%06x}%s(%d) {2BD9F8}has registered, making the server have total {008FFB}%d {2BD9F8}players registered."random_color >>> 8GetName(playerid), playeridgTotalRegisters);
              
SetPlayerColor(playeridrandom_color);
            
SendClientMessageToAll(0x2BD9F8FFstr);
               new 
INI:FILE_SERVER_STATS INI_Open(ServerStats);
               
INI_SetTag(FILE_SERVER_STATS"Server_Statistics");
            
INI_WriteInt(FILE_SERVER_STATS"Total_Registered_Users"gTotalRegisters);
             
INI_Close(FILE_SERVER_STATS);
            
PlayerInfo[playerid][Spawned] = 1;
            
PlayerInfo[playerid][LoggedIn] = 1;
            return 
1;
        }
    } 
Reply
#6

If you save the data OnPlayerDisconnect:
PHP код:
CMD:changepassword(playeridparams[])
{
    new 
pass[128], hashpass[129];
    if(
sscanf(params,"s[128]",pass)) return SendClientMessage(playerid, -1"Usage: /changepassword [Password]");
        
WP_Hash(hashpasssizeof(hashpass), pass);
    
PlayerInfo[playerid][Password] = hashpass;
    return 
1;

Edited.
Reply
#7

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
If you save the data OnPlayerDisconnect:
PHP код:
CMD:changepassword(playeridparams[])
{
    new 
pass[128], hashpass[129];
    if(
sscanf(params,"s[128]",pass)) return SendClientMessage(playerid, -1"Usage: /changepassword [Password]");
        
WP_Hash(hashpasssizeof(hashpass), pass);
    
PlayerInfo[playerid][Password] = hashpass;
    return 
1;

Edited.
dON't Work
Код:
stock SaveStats (playerid)
{
		new INI:File = INI_Open(UserPath(playerid));
	    INI_SetTag(File, "Player's Data");
	    INI_WriteInt(File, "Admin", PlayerInfo[playerid][Admin]);
	    INI_WriteInt(File, "VIP", PlayerInfo[playerid][VIP]);
	    INI_WriteString(File, "LastActive", TimeAndDate());
	    INI_WriteString(File, "AltName", PlayerInfo[playerid][AltName]);
	    INI_WriteString(File, "Registered_On", PlayerInfo[playerid][RegOn]);
	    INI_WriteInt(File, "Cash", GetPlayerMoney(playerid));
	    INI_WriteInt(File, "Score", GetPlayerScore(playerid));
	    INI_WriteInt(File, "Kills", PlayerInfo[playerid][Kills]);
	    INI_WriteInt(File, "Deaths", PlayerInfo[playerid][Deaths]);
	    INI_WriteInt(File, "Skin", PlayerInfo[playerid][Skin]);
	    INI_WriteInt(File, "WeaponSet", PlayerInfo[playerid][WeaponSet]);
	    INI_WriteHex(File, "Color", GetPlayerColor(playerid));
	    INI_WriteInt(File, "Hours", PlayerInfo[playerid][Hours]);
		INI_WriteInt(File, "Minutes", PlayerInfo[playerid][Minutes]);
 		INI_WriteInt(File, "Helmet", PlayerInfo[playerid][Helmet]);
		INI_Close(File);
		return 1;
}
Reply
#8

PHP код:
CMD:changepassword(playeridparams[])
{
    new 
pass[128], hashpass[129];
    if(
sscanf(params,"s[128]",pass)) return SendClientMessage(playerid, -1"Usage: /changepassword [Password]");
        
WP_Hash(hashpasssizeof(hashpass), pass);
    
INI_WriteString(File"Password"hashpass); 
    
PlayerInfo[playerid][Password] = hashpass;
    
SendClientMessage(playerid,0x00FFFFAA,"Password Changed successfully");
    return 
1;

try this: [ made by nezo2001 ]

but he miss to save the password i hope this will work full
Reply
#9

Код:
:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(2073) : warning 217: loose indentation
C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(2074) : warning 217: loose indentation
C:\Users\Ayoub\Desktop\xD\gamemodes\xD.pwn(2074) : error 017: undefined symbol "File"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#10

oh alright i miss that
PHP код:
new INI:File INI_Open(UserPath(playerid)); 
would be like:
PHP код:
CMD:changepassword(playeridparams[])
{
    new 
pass[128], hashpass[129];

    if(
sscanf(params,"s[128]",pass)) return SendClientMessage(playerid, -1"Usage: /changepassword [Password]");
    new 
INI:File INI_Open(UserPath(playerid));
        
WP_Hash(hashpasssizeof(hashpass), pass);
    
INI_WriteString(File"Password"hashpass); 
    
PlayerInfo[playerid][Password] = hashpass;
    
SendClientMessage(playerid,0x00FFFFAA,"Password Changed successfully");
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)