Help with /osetpass
#1

i made this offline setpassword command but it wont work it keeps sending me the error messages.

PHP код:
CMD:osetpass(playeridparams[])
{
    if(
IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 7)
     {
        new 
player[MAX_PLAYER_NAME], file[100], pass [25];
        if(
sscanf(params"s[32]s[50]"playerparams))return SendClientMessage(playeriderror"/changepass [Username] [password]");
        if(
strlen(pass) < || strlen(pass) > 20) return SendClientMessage(playerid,error,"Error: Password length must be between 5 - 20 chracters!"); // keeps sending me this message
        
format(file256PATHplayer);
          new 
INI:ACCOUNT INI_Open(file);
        
INI_SetTag(ACCOUNT,"data");
        
INI_WriteInt(ACCOUNT"Password",udb_hash(pass));
        
INI_Close(ACCOUNT);
        
format(astring,sizeof(astring),"[OSP]: %s has changed account name %s password. [NEW PASSWORD: %s] ",GetName(playerid),player,pass);
        
WriteToLog(astring,"Setpass");
        
CommandToAdmins(playerid,"osetpass");
    }
    else return 
ShowMessage(playeriderror1);
    return 
1;

Reply
#2

You defined the
Код:
pass [25]
string, and you are calling for it, but you are not setting a value to it anywhere.

Also, you have a lot of incongruence with your strings' sizes,

Код:
new file[100]

format(file, 256..[
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)