Registration question
#1

When I register it doesn't save the things, only creates the playerfile, but it's empty inside, why?

pawn Код:
new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                PlayerInfo[playerid][pPassword] = udb_hash(inputtext);
                INI_WriteInt(File,"Password",PlayerInfo[playerid][pPassword]);
                PlayerInfo[playerid][pMoney] = 1000;
                INI_WriteInt(File,"Money",PlayerInfo[playerid][pMoney]);
                PlayerInfo[playerid][pAdminLevel] = 0;
                INI_WriteInt(File,"AdminLevel",PlayerInfo[playerid][pAdminLevel]);
                PlayerInfo[playerid][pSkin] = 0;
                INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
                PlayerInfo[playerid][pRegistered] = 0;
                INI_WriteInt(File,"Registered",PlayerInfo[playerid][pRegistered]);
                PlayerInfo[playerid][pAge] = 0;
                INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
                PlayerInfo[playerid][pOrigin] = 0;
                INI_WriteInt(File,"Origin",PlayerInfo[playerid][pOrigin]);
                PlayerInfo[playerid][pAccent] = 0;
                INI_WriteInt(File,"Accent",PlayerInfo[playerid][pAccent]);
                PlayerInfo[playerid][pHealth] = 100;
                INI_WriteFloat(File,"Health",PlayerInfo[playerid][pHealth]);
                PlayerInfo[playerid][pArmour] = 0;
                INI_WriteFloat(File,"Armour",PlayerInfo[playerid][pArmour]);
                PlayerInfo[playerid][pBank] = 500;
                INI_WriteInt(File,"Bank",PlayerInfo[playerid][pBank]);
                PlayerInfo[playerid][pJob] = 0;
                INI_WriteInt(File,"Job",PlayerInfo[playerid][pJob]);
                PlayerInfo[playerid][pFaction] = 0;
                INI_WriteInt(File,"Faction",PlayerInfo[playerid][pFaction]);
                PlayerInfo[playerid][pRank] = 0;
                INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
                PlayerInfo[playerid][pLicense] = 0;
                INI_WriteInt(File,"License",PlayerInfo[playerid][pLicense]);
                PlayerInfo[playerid][pCocaine] = 0;
                INI_WriteInt(File,"Cocaine",PlayerInfo[playerid][pCocaine]);
                PlayerInfo[playerid][pMarijuana] = 0;
                INI_WriteInt(File,"Marijuana",PlayerInfo[playerid][pMarijuana]);
                PlayerInfo[playerid][pDonater] = 0;
                INI_WriteInt(File,"Donater",PlayerInfo[playerid][pDonater]);
                PlayerInfo[playerid][pDonaterPoints] = 0;
                INI_WriteInt(File,"DonaterPoints",PlayerInfo[playerid][pDonaterPoints]);
                PlayerInfo[playerid][pWatch] = 0;
                INI_WriteInt(File,"Watch",PlayerInfo[playerid][pWatch]);
                PlayerInfo[playerid][pPhone] = 0;
                INI_WriteInt(File,"Phone",PlayerInfo[playerid][pPhone]);
                PlayerInfo[playerid][pPhoneNumber] = 0;
                INI_WriteInt(File,"PhoneNumber",PlayerInfo[playerid][pPhoneNumber]);
                PlayerInfo[playerid][pHouse] = 0;
                INI_WriteInt(File,"House",PlayerInfo[playerid][pHouse]);
                PlayerInfo[playerid][pCigars] = 0;
                INI_WriteInt(File,"Cigars",PlayerInfo[playerid][pCigars]);
                PlayerInfo[playerid][pLighter] = 0;
                INI_WriteInt(File,"Lighter",PlayerInfo[playerid][pLighter]);
                PlayerInfo[playerid][pMask] = 0;
                INI_WriteInt(File,"Mask",PlayerInfo[playerid][pMask]);
                PlayerInfo[playerid][pJailTime] = 0;
                INI_WriteInt(File,"JailTime",PlayerInfo[playerid][pJailTime]);
                PlayerInfo[playerid][pGun01] = 0;
                INI_WriteInt(File,"Gun01",PlayerInfo[playerid][pGun01]);
                PlayerInfo[playerid][pGun02] = 0;
                INI_WriteInt(File,"Gun02",PlayerInfo[playerid][pGun02]);
                PlayerInfo[playerid][pGun03] = 0;
                INI_WriteInt(File,"Gun03",PlayerInfo[playerid][pGun03]);
                PlayerInfo[playerid][pGun04] = 0;
                INI_WriteInt(File,"Gun04",PlayerInfo[playerid][pGun04]);
                PlayerInfo[playerid][pGun05] = 0;
                INI_WriteInt(File,"Gun05",PlayerInfo[playerid][pGun05]);
                PlayerInfo[playerid][pGun06] = 0;
                INI_WriteInt(File,"Gun06",PlayerInfo[playerid][pGun06]);
                PlayerInfo[playerid][pGun07] = 0;
                INI_WriteInt(File,"Gun07",PlayerInfo[playerid][pGun07]);
                PlayerInfo[playerid][pGun08] = 0;
                INI_WriteInt(File,"Gun08",PlayerInfo[playerid][pGun08]);
                PlayerInfo[playerid][pGun09] = 0;
                INI_WriteInt(File,"Gun09",PlayerInfo[playerid][pGun09]);
                PlayerInfo[playerid][pGun11] = 0;
                INI_WriteInt(File,"Gun11",PlayerInfo[playerid][pGun11]);
                PlayerInfo[playerid][pAmmo01] = 0;
                INI_WriteInt(File,"Ammo01",PlayerInfo[playerid][pAmmo01]);
                PlayerInfo[playerid][pAmmo02] = 0;
                INI_WriteInt(File,"Ammo02",PlayerInfo[playerid][pAmmo02]);
                PlayerInfo[playerid][pAmmo03] = 0;
                INI_WriteInt(File,"Ammo03",PlayerInfo[playerid][pAmmo03]);
                PlayerInfo[playerid][pAmmo04] = 0;
                INI_WriteInt(File,"Ammo04",PlayerInfo[playerid][pAmmo04]);
                PlayerInfo[playerid][pAmmo05] = 0;
                INI_WriteInt(File,"Ammo05",PlayerInfo[playerid][pAmmo05]);
                PlayerInfo[playerid][pAmmo06] = 0;
                INI_WriteInt(File,"Ammo06",PlayerInfo[playerid][pAmmo06]);
                PlayerInfo[playerid][pAmmo07] = 0;
                INI_WriteInt(File,"Ammo07",PlayerInfo[playerid][pAmmo07]);
                PlayerInfo[playerid][pAmmo08] = 0;
                INI_WriteInt(File,"Ammo08",PlayerInfo[playerid][pAmmo08]);
                PlayerInfo[playerid][pAmmo09] = 0;
                INI_WriteInt(File,"Ammo09",PlayerInfo[playerid][pAmmo09]);
                PlayerInfo[playerid][pAmmo11] = 0;
                INI_WriteInt(File,"Ammo11",PlayerInfo[playerid][pAmmo11]);
                INI_Close(File);
pawn Код:
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
Reply
#2

Firstly are you actually saving these player values and creating them when they join and OnPlayerDisconnect. Are you saving the user values
Reply
#3

It has nothing to do with that right now, I am telling you it creates the players file and then puts nothing in it, which it should be...
Reply
#4

Quote:
Originally Posted by Mento
Посмотреть сообщение
It has nothing to do with that right now, I am telling you it creates the players file and then puts nothing in it, which it should be...
Fine prove me wrong, show me your OnPlayerConnect, OnPlayerSpawn, and OnPlayerDisconnect.
Reply
#5

pawn Код:
public OnPlayerConnect(playerid)
{
    gPlayerLogged[playerid] = 0;
    SetPlayerColor(playerid, COLOR_WHITE);
    TogglePlayerSpectating(playerid, true);
    SendClientMessage(playerid, COLOR_WHITE, "Welcome To Inter City Roleplay");
    SendClientMessage(playerid, COLOR_BLUE, "Our Anti-Cheat will catch you, so do not try hacking");
    SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 1);
    SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 1);
    if(fexist(UserPath(playerid)))
    {
        AdminDuty[playerid] = 0;
        SetTimerEx("TrashTimer", 1500000, 1, "i", playerid);
        JackingCar[playerid] = 0;
        Logging[playerid] = 0;
        GettingJob[playerid] = 0;
        Farming[playerid] = 0;
        PlantingSeeds[playerid] = 0;
        GrowingCrops[playerid] = 0;
        FarmingCrops[playerid] = -1;
        CollectingTrash[playerid] = 0;
        CollectingTrash1[playerid] = 0;
        CollectingTrash2[playerid] = 0;
        CollectingTrash3[playerid] = 0;
        CollectingTrash4[playerid] = 0;
        CollectingTrash5[playerid] = 0;
        CollectingTrash6[playerid] = 0;
        CollectingTrash7[playerid] = 0;
        CollectingTrash8[playerid] = 0;
        CollectingTrash9[playerid] = 0;
        CollectingTrash10[playerid] = 0;
        CollectingTrash11[playerid] = 0;
        CollectingTrash12[playerid] = 0;
        CollectingTrash13[playerid] = 0;
        oldcar[playerid] = 0;
        HandsupPlayer[playerid] = 0;
        EatingFood[playerid] = 0;
        DeliveryTruck[playerid] = 0;
        PlayerTied[playerid] = 0;
        ShotPlayer[playerid] = 0;
        SmuggleDropOff[playerid] = 0;
        PlayerCuffed[playerid] = 0;
        CellTime[playerid] = 0;
        PlayerRestrained[playerid] = 0;
        RentedCar[playerid] = 0;
        HoldingObject[playerid] = 0;
        PhoneOnline[playerid] = 0;
        Mobile[playerid] = INVALID_PLAYER_ID;
        Spectating[playerid] = 0;
        RingTone[playerid] = 0;
        CopDuty[playerid] = 0;
        TazerCharged[playerid] = 0;
        Tazer[playerid] = 0;
        SmugglingMats[playerid] = 0;
        SetPlayerColor(playerid, COLOR_WHITE);
        GettingPacks[playerid] = 0;
        ResetPlayerMoney(playerid);
        INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
        ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Welcome Back", " Welcome Back, This Account Is Registered \n Please Type Your Password Below To Continue: \n", "Login", "Quit");
    }
    else
    {
        SendClientMessage(playerid, COLOR_BLUE, "       [-Fort Carson Immigration-]    ");
        SendClientMessage(playerid, COLOR_WHITE, "      We Cannot Seem To Find A File    ");
        SendClientMessage(playerid, COLOR_WHITE, " On You, Please Fill In This Information ");
        AdminDuty[playerid] = 0;
        ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT,"Registration","Type your password below to register a new account:","Register","Leave");
    }
    return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    gPlayerLogged[playerid] = 0;
    new INI:File = INI_Open(UserPath(playerid));
    INI_SetTag(File,"[PlayerStats]");
    INI_WriteInt(File,"Money",PlayerInfo[playerid][pMoney]);
    INI_WriteInt(File,"AdminLevel",PlayerInfo[playerid][pAdminLevel]);
    INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
    INI_WriteInt(File,"Registered",PlayerInfo[playerid][pRegistered]);
    INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
    INI_WriteInt(File,"Origin",PlayerInfo[playerid][pOrigin]);
    INI_WriteInt(File,"Accent",PlayerInfo[playerid][pAccent]);
    INI_WriteFloat(File,"Health",PlayerInfo[playerid][pHealth]);
    INI_WriteFloat(File,"Armour",PlayerInfo[playerid][pArmour]);
    INI_WriteInt(File,"Bank",PlayerInfo[playerid][pBank]);
    INI_WriteInt(File,"Job",PlayerInfo[playerid][pJob]);
    INI_WriteInt(File,"Faction",PlayerInfo[playerid][pFaction]);
    INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
    INI_WriteInt(File,"License",PlayerInfo[playerid][pLicense]);
    INI_WriteInt(File,"Cocaine",PlayerInfo[playerid][pCocaine]);
    INI_WriteInt(File,"Marijuana",PlayerInfo[playerid][pMarijuana]);
    INI_WriteInt(File,"Donater",PlayerInfo[playerid][pDonater]);
    INI_WriteInt(File,"DonaterPoints",PlayerInfo[playerid][pDonaterPoints]);
    INI_WriteInt(File,"Watch",PlayerInfo[playerid][pWatch]);
    INI_WriteInt(File,"Phone",PlayerInfo[playerid][pPhone]);
    INI_WriteInt(File,"PhoneNumber",PlayerInfo[playerid][pPhoneNumber]);
    INI_WriteInt(File,"House",PlayerInfo[playerid][pHouse]);
    INI_WriteInt(File,"Cigars",PlayerInfo[playerid][pCigars]);
    INI_WriteInt(File,"Lighter",PlayerInfo[playerid][pLighter]);
    INI_WriteInt(File,"Mask",PlayerInfo[playerid][pMask]);
    INI_WriteInt(File,"JailTime",PlayerInfo[playerid][pJailTime]);
    INI_WriteInt(File,"Gun01",PlayerInfo[playerid][pGun01]);
    INI_WriteInt(File,"Gun02",PlayerInfo[playerid][pGun02]);
    INI_WriteInt(File,"Gun03",PlayerInfo[playerid][pGun03]);
    INI_WriteInt(File,"Gun04",PlayerInfo[playerid][pGun04]);
    INI_WriteInt(File,"Gun05",PlayerInfo[playerid][pGun05]);
    INI_WriteInt(File,"Gun06",PlayerInfo[playerid][pGun06]);
    INI_WriteInt(File,"Gun07",PlayerInfo[playerid][pGun07]);
    INI_WriteInt(File,"Gun08",PlayerInfo[playerid][pGun08]);
    INI_WriteInt(File,"Gun09",PlayerInfo[playerid][pGun09]);
    INI_WriteInt(File,"Gun11",PlayerInfo[playerid][pGun11]);
    INI_WriteInt(File,"Ammo01",PlayerInfo[playerid][pAmmo01]);
    INI_WriteInt(File,"Ammo02",PlayerInfo[playerid][pAmmo02]);
    INI_WriteInt(File,"Ammo03",PlayerInfo[playerid][pAmmo03]);
    INI_WriteInt(File,"Ammo04",PlayerInfo[playerid][pAmmo04]);
    INI_WriteInt(File,"Ammo05",PlayerInfo[playerid][pAmmo05]);
    INI_WriteInt(File,"Ammo06",PlayerInfo[playerid][pAmmo06]);
    INI_WriteInt(File,"Ammo07",PlayerInfo[playerid][pAmmo07]);
    INI_WriteInt(File,"Ammo08",PlayerInfo[playerid][pAmmo08]);
    INI_WriteInt(File,"Ammo09",PlayerInfo[playerid][pAmmo09]);
    INI_WriteInt(File,"Ammo11",PlayerInfo[playerid][pAmmo11]);
    INI_Close(File);
    return 1;
}
pawn Код:
public OnPlayerSpawn(playerid)
{
    SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, PlayerInfo[playerid][pMoney]);
    return 1;
}
Registration Dialog:

pawn Код:
if(dialogid == 1)
    {
        if (!response)
        {
            Kick(playerid);
            return 1;
        }
        else
        {
            if(!strlen(inputtext))
            {
                ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Registration","You have entered an invalid password\nType a new password below:","Register","Leave");
                return 1;
            }
            else
            {
                new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                PlayerInfo[playerid][pPassword] = udb_hash(inputtext);
                INI_WriteInt(File,"Password",PlayerInfo[playerid][pPassword]);
                PlayerInfo[playerid][pMoney] = 1000;
                INI_WriteInt(File,"Money",PlayerInfo[playerid][pMoney]);
                PlayerInfo[playerid][pAdminLevel] = 0;
                INI_WriteInt(File,"AdminLevel",PlayerInfo[playerid][pAdminLevel]);
                PlayerInfo[playerid][pSkin] = 0;
                INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin]);
                PlayerInfo[playerid][pRegistered] = 0;
                INI_WriteInt(File,"Registered",PlayerInfo[playerid][pRegistered]);
                PlayerInfo[playerid][pAge] = 0;
                INI_WriteInt(File,"Age",PlayerInfo[playerid][pAge]);
                PlayerInfo[playerid][pOrigin] = 0;
                INI_WriteInt(File,"Origin",PlayerInfo[playerid][pOrigin]);
                PlayerInfo[playerid][pAccent] = 0;
                INI_WriteInt(File,"Accent",PlayerInfo[playerid][pAccent]);
                PlayerInfo[playerid][pHealth] = 100;
                INI_WriteFloat(File,"Health",PlayerInfo[playerid][pHealth]);
                PlayerInfo[playerid][pArmour] = 0;
                INI_WriteFloat(File,"Armour",PlayerInfo[playerid][pArmour]);
                PlayerInfo[playerid][pBank] = 500;
                INI_WriteInt(File,"Bank",PlayerInfo[playerid][pBank]);
                PlayerInfo[playerid][pJob] = 0;
                INI_WriteInt(File,"Job",PlayerInfo[playerid][pJob]);
                PlayerInfo[playerid][pFaction] = 0;
                INI_WriteInt(File,"Faction",PlayerInfo[playerid][pFaction]);
                PlayerInfo[playerid][pRank] = 0;
                INI_WriteInt(File,"Rank",PlayerInfo[playerid][pRank]);
                PlayerInfo[playerid][pLicense] = 0;
                INI_WriteInt(File,"License",PlayerInfo[playerid][pLicense]);
                PlayerInfo[playerid][pCocaine] = 0;
                INI_WriteInt(File,"Cocaine",PlayerInfo[playerid][pCocaine]);
                PlayerInfo[playerid][pMarijuana] = 0;
                INI_WriteInt(File,"Marijuana",PlayerInfo[playerid][pMarijuana]);
                PlayerInfo[playerid][pDonater] = 0;
                INI_WriteInt(File,"Donater",PlayerInfo[playerid][pDonater]);
                PlayerInfo[playerid][pDonaterPoints] = 0;
                INI_WriteInt(File,"DonaterPoints",PlayerInfo[playerid][pDonaterPoints]);
                PlayerInfo[playerid][pWatch] = 0;
                INI_WriteInt(File,"Watch",PlayerInfo[playerid][pWatch]);
                PlayerInfo[playerid][pPhone] = 0;
                INI_WriteInt(File,"Phone",PlayerInfo[playerid][pPhone]);
                PlayerInfo[playerid][pPhoneNumber] = 0;
                INI_WriteInt(File,"PhoneNumber",PlayerInfo[playerid][pPhoneNumber]);
                PlayerInfo[playerid][pHouse] = 0;
                INI_WriteInt(File,"House",PlayerInfo[playerid][pHouse]);
                PlayerInfo[playerid][pCigars] = 0;
                INI_WriteInt(File,"Cigars",PlayerInfo[playerid][pCigars]);
                PlayerInfo[playerid][pLighter] = 0;
                INI_WriteInt(File,"Lighter",PlayerInfo[playerid][pLighter]);
                PlayerInfo[playerid][pMask] = 0;
                INI_WriteInt(File,"Mask",PlayerInfo[playerid][pMask]);
                PlayerInfo[playerid][pJailTime] = 0;
                INI_WriteInt(File,"JailTime",PlayerInfo[playerid][pJailTime]);
                PlayerInfo[playerid][pGun01] = 0;
                INI_WriteInt(File,"Gun01",PlayerInfo[playerid][pGun01]);
                PlayerInfo[playerid][pGun02] = 0;
                INI_WriteInt(File,"Gun02",PlayerInfo[playerid][pGun02]);
                PlayerInfo[playerid][pGun03] = 0;
                INI_WriteInt(File,"Gun03",PlayerInfo[playerid][pGun03]);
                PlayerInfo[playerid][pGun04] = 0;
                INI_WriteInt(File,"Gun04",PlayerInfo[playerid][pGun04]);
                PlayerInfo[playerid][pGun05] = 0;
                INI_WriteInt(File,"Gun05",PlayerInfo[playerid][pGun05]);
                PlayerInfo[playerid][pGun06] = 0;
                INI_WriteInt(File,"Gun06",PlayerInfo[playerid][pGun06]);
                PlayerInfo[playerid][pGun07] = 0;
                INI_WriteInt(File,"Gun07",PlayerInfo[playerid][pGun07]);
                PlayerInfo[playerid][pGun08] = 0;
                INI_WriteInt(File,"Gun08",PlayerInfo[playerid][pGun08]);
                PlayerInfo[playerid][pGun09] = 0;
                INI_WriteInt(File,"Gun09",PlayerInfo[playerid][pGun09]);
                PlayerInfo[playerid][pGun11] = 0;
                INI_WriteInt(File,"Gun11",PlayerInfo[playerid][pGun11]);
                PlayerInfo[playerid][pAmmo01] = 0;
                INI_WriteInt(File,"Ammo01",PlayerInfo[playerid][pAmmo01]);
                PlayerInfo[playerid][pAmmo02] = 0;
                INI_WriteInt(File,"Ammo02",PlayerInfo[playerid][pAmmo02]);
                PlayerInfo[playerid][pAmmo03] = 0;
                INI_WriteInt(File,"Ammo03",PlayerInfo[playerid][pAmmo03]);
                PlayerInfo[playerid][pAmmo04] = 0;
                INI_WriteInt(File,"Ammo04",PlayerInfo[playerid][pAmmo04]);
                PlayerInfo[playerid][pAmmo05] = 0;
                INI_WriteInt(File,"Ammo05",PlayerInfo[playerid][pAmmo05]);
                PlayerInfo[playerid][pAmmo06] = 0;
                INI_WriteInt(File,"Ammo06",PlayerInfo[playerid][pAmmo06]);
                PlayerInfo[playerid][pAmmo07] = 0;
                INI_WriteInt(File,"Ammo07",PlayerInfo[playerid][pAmmo07]);
                PlayerInfo[playerid][pAmmo08] = 0;
                INI_WriteInt(File,"Ammo08",PlayerInfo[playerid][pAmmo08]);
                PlayerInfo[playerid][pAmmo09] = 0;
                INI_WriteInt(File,"Ammo09",PlayerInfo[playerid][pAmmo09]);
                PlayerInfo[playerid][pAmmo11] = 0;
                INI_WriteInt(File,"Ammo11",PlayerInfo[playerid][pAmmo11]);
                INI_Close(File);
                SendClientMessage(playerid, COLOR_YELLOW, "Thank You For Registering, Please Log In To Your Account");
                gPlayerLogged[playerid] = 1;
                ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Welcome Back", " Welcome Back, This Account Is Registered \n Please Type Your Password Below To Continue: \n", "Login", "Quit");
            }
        }
    }
Reply
#6

Where's your enum for player info and where have you defined PlayerInfo?
Reply
#7

pawn Код:
enum pInfo
{
    pPassword,
    pRegistered,
    pAge,
    pGender,
    pSkin,
    pOrigin,
    pAccent,
    pAdminLevel,
    Float:pHealth,
    Float:pArmour,
    pMoney,
    pBank,
    pJob,
    pFaction,
    pRank,
    pLicense,
    pCocaine,
    pMarijuana,
    pDonater,
    pDonaterPoints,
    pWatch,
    pPhone,
    pPhoneNumber,
    pHouse,
    pCigars,
    pLighter,
    pMask,
    pJailTime,
    pGun01,
    pAmmo01,
    pGun02,
    pAmmo02,
    pGun03,
    pAmmo03,
    pGun04,
    pAmmo04,
    pGun05,
    pAmmo05,
    pGun06,
    pAmmo06,
    pGun07,
    pAmmo07,
    pGun08,
    pAmmo08,
    pGun09,
    pAmmo09,
    pGun11,
    pAmmo11,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
There are no errors when compiling so I doubt it's because I forgot a variable.
Reply
#8

Quote:
Originally Posted by Mento
Посмотреть сообщение
When I register it doesn't save the things, only creates the playerfile, but it's empty inside, why?

pawn Код:
new INI:File = INI_Open(UserPath(playerid));
                INI_SetTag(File,"data");
                INI_WriteInt(File,"Money",PlayerInfo[playerid][pMoney] = 50);
                INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdminLevel] = 0);
                INI_WriteInt(File,"Skin",PlayerInfo[playerid][pSkin] = 0);
                INI_Close(File);
pawn Код:
stock UserPath(playerid)
{
    new string[128],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}
Pretty sure your doing it wrong cause the player will have no variables if he is registering, i have something like this in the making for my stunt server
pawn Код:
INI_WriteInt(File,"Cash",0);
                INI_WriteInt(File,"Admin",0);
                INI_WriteInt(File,"Kills",0);
                INI_WriteInt(File,"Deaths",0);
                INI_WriteInt(File,"Score",0);
cause then it just writes blank stats in the file then when the player disconnects it saves what stats he gained after he registered
this is then how i save on disconnect
[pawn]
stock SavePinfo(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",PlayerInfo[playerid][pCash]);
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Score",PlayerInfo[playerid][pScore]);
INI_Close(File);
}
Reply
#9

But I save them when they register and when they disconnect, but it isn't working.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)