/register server crash problem
#1

I finaly "succed" , after a few hours to create the /register command , but when i type /register the server crashes

pawn Код:
if (strcmp("/register", cmdtext, true, 10) == 0)
    {
        if(IsPlayerConnected(playerid))
      {
        GetPlayerName(playerid, sendername, sizeof(sendername));
            format(string, sizeof(string), "%s.ini", sendername);
            new File: hFile = fopen(string, io_read);
            fclose(hFile);
            if (hFile)
            {
                SendClientMessage(playerid, COLOR_YELLOW, "That Username is already taken, please choose a different one.");
                fclose(hFile);
                return 1;
            }
            else
            {
                new string3[32];
                new playername3[MAX_PLAYER_NAME];
                GetPlayerName(playerid, playername3, sizeof(playername3));
                format(string3, sizeof(string3), "%s.ini", playername3);
                new File: bFile = fopen(string3, io_write);
                if (bFile)
                {
                    fwrite(bFile,"AdminLevel=0");
                    fclose(bFile);
                }
            }

        }
It doesn't give me any warnings or erros , only when i type /register the server crashes.
I will apreciate some help .
Reply
#2

pawn Код:
if (strcmp("/register", cmdtext, true, 10) == 0)
if (strcmp("/register", cmdtext, true, 10) == 0)
Did you seriously do it like this? If you really did, and it wasn't a misspelling, then delete one of them.
Reply
#3

No sorry i typed wrong here , but in the script it's only one time.

LE : I solved the problem . i guess that one precedent file haven't been closed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)