Y_INI problem :write the same value.
#1

pawn Код:
Function OnPlayerLogin(playerid,password[])
{
    new nickname[35];
    format(nickname,sizeof(nickname),PLAYER_INFO, GetName(playerid));
    new INI:handler = INI_Open(nickname);
    INI_ParseFile(nickname, "LoadPlayerInfo", .bExtra = true, .extra = playerid);
    if(!strcmp(pInfo[playerid][pPass],password))
    {
        pLogged[playerid] = 1;
        SetSpawnInfo(playerid,0,pInfo[playerid][pSkin],pInfo[playerid][pSpawnX],pInfo[playerid][pSpawnY],pInfo[playerid][pSpawnZ],0,0,0,0,0,0,0);
        SpawnPlayer(playerid);
    }
    else
    {
        pLogTries[playerid] ++;
        if(pLogTries[playerid] > 3)
        {Ban(playerid);}
        else
        {ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_INPUT,"Login","Please Login :","LOGIN","EXIT");}
    }
    INI_Close(handler);
}
pawn Код:
Function LoadPlayerInfo(playerid, name[], value[])
{
    INI_String("password",pInfo[playerid][pPass],64);
    INI_Int("skin",pInfo[playerid][pSkin]);
    INI_Int("honor",pInfo[playerid][pHonor]);
    INI_Int("money",pInfo[playerid][pMoneys]);
    INI_Int("team",pInfo[playerid][pTeam]);
    INI_Int("rank",pInfo[playerid][pRank]);
    INI_Int("job",pInfo[playerid][pJob]);
    INI_Int("mats",pInfo[playerid][pMats]);
    INI_Int("drugs",pInfo[playerid][pDrugs]);
    INI_Int("license",pInfo[playerid][pLic]);
    INI_Int("weaponlic",pInfo[playerid][pWeaponLic]);
    INI_Int("houseid",pInfo[playerid][pOwnhouse]);
    INI_Int("vehicleid",pInfo[playerid][pOwncar]);
    INI_Int("fightstyle",pInfo[playerid][pFightStyle]);
    INI_Float("health",pInfo[playerid][pHealth]);
    INI_Float("armour",pInfo[playerid][pArmour]);
    INI_Int("wanted",pInfo[playerid][pWanted]);
    INI_Int("jailed",pInfo[playerid][pWanted]);
    INI_Int("jailetime",pInfo[playerid][pWanted]);
    INI_Float("spawn_x",pInfo[playerid][pSpawnX]);
    INI_Float("spawn_y",pInfo[playerid][pSpawnY]);
    INI_Float("spawn_z",pInfo[playerid][pSpawnZ]);
    INI_Int("interior",pInfo[playerid][pSpawnI]);
    INI_Int("world",pInfo[playerid][pSpawnW]);
    INI_Int("weapon_1",pInfo[playerid][pWp1]);
    INI_Int("weapon_2",pInfo[playerid][pWp2]);
    INI_Int("weapon_3",pInfo[playerid][pWp3]);
    INI_Int("weapon_4",pInfo[playerid][pWp4]);
    return 1;
}
pawn Код:
SavePlayerInfo(playerid)
{
    if(pLogged[playerid] >0)
    {
        pInfo[playerid][pSkin] = GetPlayerSkin(playerid);
        GetPlayerHealth(playerid, pInfo[playerid][pHealth]);
        GetPlayerArmour(playerid, pInfo[playerid][pArmour]);
        GetPlayerPos(playerid, pInfo[playerid][pSpawnX], pInfo[playerid][pSpawnY], pInfo[playerid][pSpawnZ]);
        pInfo[playerid][pSpawnI] = GetPlayerInterior(playerid);
        pInfo[playerid][pSpawnW] = GetPlayerVirtualWorld(playerid);
        new ammo[4];
        GetPlayerWeaponData(playerid, 0, pInfo[playerid][pWp1], ammo[0]);
        GetPlayerWeaponData(playerid, 1, pInfo[playerid][pWp2], ammo[1]);
        GetPlayerWeaponData(playerid, 2, pInfo[playerid][pWp3], ammo[2]);
        GetPlayerWeaponData(playerid, 3, pInfo[playerid][pWp4], ammo[3]);
        new nickname[35];
        format(nickname,sizeof(nickname),PLAYER_INFO,GetName(playerid));
        new INI:PlayerFile = INI_Open(nickname);
        INI_WriteString(PlayerFile,"password",pInfo[playerid][pPass]);
        INI_WriteInt(PlayerFile,"skin",pInfo[playerid][pSkin]);
        INI_WriteInt(PlayerFile,"honor",pInfo[playerid][pHonor]);
        INI_WriteInt(PlayerFile,"money",pInfo[playerid][pMoneys]);
        INI_WriteInt(PlayerFile,"team",pInfo[playerid][pTeam]);
        INI_WriteInt(PlayerFile,"rank",pInfo[playerid][pRank]);
        INI_WriteInt(PlayerFile,"job",pInfo[playerid][pJob]);
        INI_WriteInt(PlayerFile,"mats",pInfo[playerid][pMats]);
        INI_WriteInt(PlayerFile,"drugs",pInfo[playerid][pDrugs]);
        INI_WriteInt(PlayerFile,"license",pInfo[playerid][pLic]);
        INI_WriteInt(PlayerFile,"weaponlic",pInfo[playerid][pWeaponLic]);
        INI_WriteInt(PlayerFile,"houseid",pInfo[playerid][pOwnhouse]);
        INI_WriteInt(PlayerFile,"vehicleid",pInfo[playerid][pOwncar]);
        INI_WriteInt(PlayerFile,"fightstyle",pInfo[playerid][pFightStyle]);
        INI_WriteFloat(PlayerFile,"health",pInfo[playerid][pHealth]);
        INI_WriteFloat(PlayerFile,"armour",pInfo[playerid][pArmour]);
        INI_WriteInt(PlayerFile,"wanted",pInfo[playerid][pWanted]);
        INI_WriteInt(PlayerFile,"jailed",pInfo[playerid][pJailed]);
        INI_WriteInt(PlayerFile,"jailetime",pInfo[playerid][pJailTime]);
        INI_WriteFloat(PlayerFile,"spawn_x",pInfo[playerid][pSpawnX]);
        INI_WriteFloat(PlayerFile,"spawn_y",pInfo[playerid][pSpawnY]);
        INI_WriteFloat(PlayerFile,"spawn_z",pInfo[playerid][pSpawnZ]);
        INI_WriteInt(PlayerFile,"interior",pInfo[playerid][pSpawnI]);
        INI_WriteInt(PlayerFile,"world",pInfo[playerid][pSpawnW]);
        INI_WriteInt(PlayerFile,"weapon_1",pInfo[playerid][pWp1]);
        INI_WriteInt(PlayerFile,"weapon_2",pInfo[playerid][pWp2]);
        INI_WriteInt(PlayerFile,"weapon_3",pInfo[playerid][pWp3]);
        INI_WriteInt(PlayerFile,"weapon_4",pInfo[playerid][pWp4]);
        INI_Close(PlayerFile);
    }
}

But When I was logged on and my ini will be this:
pawn Код:
password = lwziЉ……
skin = 60
honor = 997997
money = 9859799
team = 0
rank = 0
job = 0
mats = 0
drugs = 0
license = 0
weaponlic = 0
houseid = 999
vehicleid = 999
fightstyle = 6
health = 99.000000
armour = 99.000000
wanted = 0
jailed = 0
jailetime = 0
spawn_x = -1958.493530
spawn_y = 270.527008
spawn_z = 35.468750
interior = 0
world = 0
weapon_1 = 0
weapon_2 = 0
weapon_3 = 0
weapon_4 = 0
password = &
Have you seen that?
It makes another "password = "
please help me that problem everybody.
Reply


Messages In This Thread
Y_INI problem :write the same value. - by VivianKris - 25.07.2011, 05:52
Re: Y_INI problem :write the same value. - by VivianKris - 25.07.2011, 09:59
Re: Y_INI problem :write the same value. - by VivianKris - 25.07.2011, 15:52
Re: Y_INI problem :write the same value. - by VivianKris - 26.07.2011, 07:43

Forum Jump:


Users browsing this thread: 1 Guest(s)