[HELP] File Functions Help
#5

Quote:
Originally Posted by Calgon
I was trying to make an unban command for myself, but I failed:

pawn Код:
dcmd_unban(playerid, params[])
{
    new name[MAX_PLAYER_NAME], string[128], string2[128];
    if (sscanf(params, "s", name))
    {
        SendClientMessage(playerid, COLOR_WHITE, "SYNTAX - /unban [name]");
        SendClientMessage(playerid, COLOR_GREY, "Full name, this includes underscores.");
    }
    else
    {
      format(string, sizeof(string), "CRP_Scriptfiles/Accounts/%s.ini", name);
      if(fexist(string))
      {
        dini_IntSet(string, "Banned", -1);
      string2 = dini_Get(string, "IP");
      fdeleteline("Bans.txt", string2);
      }
      else
      {
        SendClientMessage(playerid, COLOR_WHITE, "Invalid name, the name was not recognized.");
      }
   
    }
}
Errors:
C:\Documents and Settings\Calon\Desktop\SAMP\0.3\gamemodes\crpnew.p wn(20457) : error 047: array sizes do not match, or destination array is too small

Line 20457:

pawn Код:
string2 = dini_Get(string, "IP");
Can someone help me fix this, please?
Change string2[128] to string2[MAX_STRING]
Reply


Messages In This Thread
[HELP] File Functions Help - by Marclang - 12.09.2009, 22:33
Re: [HELP] File Functions Help - by Correlli - 12.09.2009, 22:39
Re: [HELP] File Functions Help - by Calgon - 12.09.2009, 23:34
Re: [HELP] File Functions Help - by [eLg]Timmy - 12.09.2009, 23:40
Re: [HELP] File Functions Help - by Gappy - 12.09.2009, 23:44
Re: [HELP] File Functions Help - by Calgon - 12.09.2009, 23:44
Re: [HELP] File Functions Help - by Gappy - 12.09.2009, 23:48

Forum Jump:


Users browsing this thread: 1 Guest(s)