Saving age Variable || A little help please.
#6

This will probably give you some errors, but I hope you can fix them yourself.

pawn Код:
public OnAgeGiven(playerid, Age) //Age as integer, not string
{
    new string2[64];
    format(string2, sizeof(string2), "users/%s.ini", GetPlayerNameEx(playerid));

    if(!fexist(string2))

    return SendCliendMessage(playerid, -1, "The impossible has happened, your account does not exist! Notify Administrator.");

    else
    {
        new File:example = fopen(string2, io_append);
        if(example)
        {
            new ap[32];
            format(ap, 32, "Age=%s\n", Age);
            fwrite(example, ap);
            fclose(example);
            SendClientMessage(playerid, COLOR_RED, "Step 2 Completed!");
            SetPlayerCameraPos(playerid, -2274.2588,110.6220,66.7716);
            SetPlayerCameraLookAt(playerid, -2309.3486,105.3977,35.5809);
            PlayerInfo[playerid][pAge] = Age;
            ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"Religon","Jewish\nMuslim\nChristian\nCatholic\nIslam\nHindu\nBuddist\nAtheist","Continue","Cancel");
        }
    }
    return 1;
}
However, it would be better to store all user data in variables until they disconnect, and then do all the saves.
Reply


Messages In This Thread
Saving age Variable || A little help please. - by Jaber_Brown - 15.08.2012, 16:47
Re: Saving age Variable || A little help please. - by Youarex - 15.08.2012, 17:26
Re : Saving age Variable || A little help please. - by Jaber_Brown - 15.08.2012, 17:59
Re : Saving age Variable || A little help please. - by Jaber_Brown - 15.08.2012, 18:50
Re : Saving age Variable || A little help please. - by Jaber_Brown - 15.08.2012, 19:15
Re: Saving age Variable || A little help please. - by Youarex - 15.08.2012, 20:43

Forum Jump:


Users browsing this thread: 1 Guest(s)