Two Small Problems
#7

Now it will onl create the file but not write the values.
Here is thw whole command:
pawn Код:
if(strcmp(cmd, "/register", true) == 0)
  {
    if(ReqClass[playerid] != 0)
    {
        SendClientMessage(playerid, COLOUR_RED, "You Can Only Register After The Class Selection!");
        return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
      SendClientMessage(playerid, COLOUR_YELLOW, "USAGE: /register (password)");
            }else{
            if (!dini_Exists(udb_encode(PlayerName)))
      {
                new FilePath[31];
                format(FilePath, 31, "\\Truckers\\%s.txt", PlayerName);
                dini_Create(FilePath);
               
        dini_IntSet(udb_encode(FilePath), "Password", udb_hash(tmp));
        dini_IntSet(udb_encode(FilePath), "AdminLevel", 0);
        dini_IntSet(udb_encode(FilePath), "Money", 2500);
        dini_IntSet(udb_encode(FilePath), "TruckType", 413);
        dini_IntSet(udb_encode(FilePath), "JobsDone", 0);
        dini_IntSet(udb_encode(FilePath), "JobLevel", 1);
        dini_IntSet(udb_encode(FilePath), "Mission", 1);

        TruckerSkin[playerid] = GetPlayerSkin(playerid);
        dini_IntSet(udb_encode(FilePath), "Skin", TruckerSkin[playerid]);

        format(string, sizeof(string), "Account %s Created! You Can Now Login With /login %s", PlayerName, tmp);
        SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
          }else{
        format(string, sizeof(string), "%s Is Already Registered.", PlayerName,tmp);
        SendClientMessage(playerid, COLOUR_RED, string);
      }
    }
    return 1;
  }
Reply


Messages In This Thread
Two Small Problems - by Alec24 - 05.04.2009, 09:59
Re: Two Small Problems - by Torekk - 05.04.2009, 10:14
Re: Two Small Problems - by Alec24 - 05.04.2009, 10:19
Re: Two Small Problems - by LarzI - 05.04.2009, 12:01
Re: Two Small Problems - by Alec24 - 05.04.2009, 14:35
Re: Two Small Problems - by LarzI - 08.04.2009, 00:53
Re: Two Small Problems - by Alec24 - 09.04.2009, 11:42
Re: Two Small Problems - by Nero_3D - 09.04.2009, 12:05
Re: Two Small Problems - by Alec24 - 09.04.2009, 12:30
Re: Two Small Problems - by Nero_3D - 09.04.2009, 13:26

Forum Jump:


Users browsing this thread: 5 Guest(s)