Unban problem (dini) +REP
#1

Код:
if (strcmp(cmd, "/unban", true)==0)
   {
      if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 1337)
      {
         tmp = strtok(cmdtext, idx);
         if(!strlen(tmp))
         {
            SendClientMessage(playerid, 0xA8A8FFFF, "USAGE: /unban [PlayerName]");
            return 1;
         }
         format(string,sizeof(string),"%s.ini",tmp);
         if(fexist(string))
         {
             new valoare = 0;
             dini_IntSet(string, "Ban", valoare);
             GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
             GetPlayerName(playerid, sendername, sizeof(sendername));
             format(string, 256, "AdmWarning: %s has unbanned %s", sendername,tmp);
             ABroadCast(COLOR_YELLOW,string,1);
             format(string, 256, "AdmWarning: %s has unbanned %s", sendername,tmp);
             printf(string);
         }
         else
         {
             SendClientMessage(playerid, 0xFFFFFFFF, "Numele nu exista");
         }
      }
      return 1;
   }
After unban , Dini_intset work perfectly (transform Ban=1 in Ban=0 ) , but when you try to login with correct password is not functionally.
In user.ini the password it's not modified , and it's not crypted .
Reply
#2

That's because of the difference between the way your files are saving and the way Dini edit them, I had this problem before. You gotta change something in your Dini.inc. Look in the end, for

pawn Код:
stock DINI_fcopytextfile(oldname[],newname[]) {
    new File:ohnd,File:nhnd;
    if (!fexist(oldname)) return false;
    ohnd=fopen(oldname,io_read);
    if (!ohnd) return false;
    nhnd=fopen(newname,io_write);
    if (!nhnd) {
        fclose(ohnd);
        return false;
    }
    new tmpres[DINI_MAX_STRING];
    while (fread(ohnd,tmpres)) {
        DINI_StripNewLine(tmpres);
        format(tmpres,sizeof(tmpres),"%s\r\n",tmpres);
        fwrite(nhnd,tmpres);
    }
    fclose(ohnd);
    fclose(nhnd);
    return true;
}
and change it to
pawn Код:
stock DINI_fcopytextfile(oldname[],newname[]) {
    new File:ohnd,File:nhnd;
    if (!fexist(oldname)) return false;
    ohnd=fopen(oldname,io_read);
    if (!ohnd) return false;
    nhnd=fopen(newname,io_write);
    if (!nhnd) {
        fclose(ohnd);
        return false;
    }
    new tmpres[DINI_MAX_STRING];
    while (fread(ohnd,tmpres)) {
        DINI_StripNewLine(tmpres);
        format(tmpres,sizeof(tmpres),"%s\n",tmpres);
        fwrite(nhnd,tmpres);
    }
    fclose(ohnd);
    fclose(nhnd);
    return true;
}
Reply
#3

Thanks !!!!!!!! +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)