djSon & changename command..
#7

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
Well that's quite simply because you're not setting them in the new file at all, all you are doing is getting the information from the new file using djInt, which contains no information yet!

You should be using djSetInt to set the information in the new file!
Right..

i'm still completely confused as to how this is not working - I've used djSetInt, and it's still not working at all...


pawn Код:
CMD:rename(playerid, params[])
{
    if(PVar[playerid][pLevel] >= 4)
    {
        new Player, newname[32], string[128], File[85];

        if(!sscanf(params, "us[32]", Player, newname))
        {

            format(File, sizeof(File), PFiles, newname);
            if(!fexist(File))
            {

                format(File, sizeof(File), PFiles, pName(playerid));

                PVar[playerid][pKills]      = djInt     (File, "Kills");
                PVar[playerid][pDeaths]     = djInt     (File, "Deaths");
                PVar[playerid][pLevel]      = djInt     (File, "Level");
                PVar[playerid][pMuted]      = djInt     (File, "Muted");
                PVar[playerid][pCash]       = djInt     (File, "Cash");
                PVar[playerid][pSkin]       = djInt     (File, "Skin");
                PVar[playerid][pUseSkin]    = djInt     (File, "UseSkin");
                format(PVar[playerid][pMutedReason], 52, "%s", dj(File, "MutedReason"));
               
                format(string, sizeof(string), "%s.json", newname);
                djCreateFile(string);
               
                format(File, sizeof(File), PFiles, newname);
               
                djSetInt        (File, "Kills",     PVar[playerid][pKills]);
                djSetInt        (File, "Deaths",    PVar[playerid][pDeaths]);
                djSetInt        (File, "Level",     PVar[playerid][pLevel]);
                djSetInt        (File, "Cash",      PVar[playerid][pCash]);
                djSetInt        (File, "Muted",     PVar[playerid][pMuted]);
                djSetInt        (File, "Skin",      PVar[playerid][pSkin]);
                djSetInt        (File, "UseSkin",   PVar[playerid][pUseSkin]);
                djSet           (File, "MutedReason", PVar[playerid][pMutedReason]);

                format(string, sizeof(string), "%s.json", pName(playerid));
                djRemoveFile(string);

                SetPlayerName(playerid, newname);
               
            }
            else return SendClientMessage(playerid, COLOR_RED, "File already exists!");

        }
        else return SendClientMessage(playerid, COLOR_LIGHTBLUE, "Usage: /rename < Player ID > < New Name >");
    }
    else return AdminCMD(playerid, 4);
    return 1;
}
Reply


Messages In This Thread
djSon & changename command.. - by Skylar Paul - 01.07.2011, 16:11
Re: djSon & changename command.. - by JaTochNietDan - 01.07.2011, 16:15
Re: djSon & changename command.. - by Skylar Paul - 01.07.2011, 16:28
Re: djSon & changename command.. - by JaTochNietDan - 01.07.2011, 16:37
Re: djSon & changename command.. - by Skylar Paul - 01.07.2011, 16:43
Re: djSon & changename command.. - by JaTochNietDan - 01.07.2011, 17:02
Re: djSon & changename command.. - by Skylar Paul - 01.07.2011, 17:11
Re: djSon & changename command.. - by JaTochNietDan - 01.07.2011, 17:15
Re: djSon & changename command.. - by Skylar Paul - 01.07.2011, 17:31
Re: djSon & changename command.. - by Calgon - 01.07.2011, 17:43

Forum Jump:


Users browsing this thread: 3 Guest(s)