Saving Gender DINI || Registration problem
#1

I got this

pawn Код:
public OnAgeGiven(playerid, Age[])
{

    new string2[128];
    format(string2, sizeof(string2), "users/%s.ini", GetPlayerNameEx(playerid));
    new File:example = fopen(string2, io_append);
    if(example)
    {
        strmid(PlayerInfo[playerid][pSex], Sex, 0, strlen(Sex), 255);
        new ap[32];
        format(ap, 32, "Sex=%s\n", PlayerInfo[playerid][pSex]);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);
        ShowPlayerDialog(playerid,4,DIALOG_STYLE_LIST,"What's your gender?","Male\nFemale","Continue","Cancel");

    }
    return 1;
}
And i dont know how to make it save, i know i didn't give enought codes , but tell me what should i put and i'll put it here
Reply
#2

DINI is slow and old, use Y_ini.

How?
1. Treat the gender as a variable, 1 = male, 2 = female.
2. Save it in the player's file once they did enter it..INI_WriteInt(File, "Gender", PlayerInfo[playerid][pGender]);
3. Don't forget to load it on login...INI_Int(File, "Gender", PlayerInfo[playerid][pGender]);
4. Hope this helps
Reply
#3

Im editing a really big GM, and i have a lot of COdes, is it possible to use Y_INI for registration and DINI for the rest in the GM ?
Reply
#4

BUMP
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)