/changepass command
#1

Hi , i want to creat /changepass [OldPass] [NewPass] , but i don't have Any Idea , Betwen , i'm using Zcmd+sscanf2+dini , example for a /register command:

PHP код:
COMMAND:register(playerid,params[])
{
    new 
file[256],PlayerName[MAX_PLAYER_NAME],buf[129];
    
WP_Hash(bufsizeof(buf), params);
    
GetPlayerName(playerid,PlayerName,MAX_PLAYER_NAME);
     
format(file,sizeof(file),"users/%s.txt",PlayerName);
      if(
dini_Exists(file)) return SendClientMessage(playerid,Red,"You are already registered.");
      if(
Account[playerid][Registered] == 1) return SendClientMessage(playerid,Red,"You are already registered.");
    if (
sscanf(params"s[32]"params)) return SendClientMessage(playeridYellow"Usage: /register password");
      if(
Account[playerid][Logged] == 1) return SendClientMessage(playerid,Red,"You are already registered, and logged in.");
    if(
strlen(params))
    {
        if(!
dini_Exists(file))
        {
            
dini_Create(file);
            
dini_Set(file,"Password",buf);
            
dini_IntSet(file,"Registered",1);
            
dini_IntSet(file,"Logged",1);
            
dini_IntSet(file,"Kills",0);
            
dini_IntSet(file,"Deaths",0);
            
dini_IntSet(file,"Level",0);
            
dini_IntSet(file,"Score",Account[playerid][Score] = 0);
            
dini_IntSet(file,"Cash",Account[playerid][Cash] = 0);
               
Account[playerid][Registered] = 1;
            
Account[playerid][Logged] = 1;
            
Account[playerid][Muted] = 0;
            
SendClientMessage(playerid,Green,"You are now registered and automatically logged in!");
            return 
1;
        }
    }
    return 
1;

If you want any other command that it can help u to make /changepass , post here
Reply


Messages In This Thread
/changepass command - by ServerScripter - 17.09.2011, 15:33
Re: /changepass command - by Pasa - 17.09.2011, 15:52
Re: /changepass command - by BlackBank - 17.09.2011, 16:00
Re: /changepass command - by ServerScripter - 17.09.2011, 16:09

Forum Jump:


Users browsing this thread: 2 Guest(s)