Need help with Y_ini
#1

Hi everybody,

save don't get load any help?
pawn Код:
public LoadData(playerid)
    {
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    INI_ParseFile(file, "load_user_data_%s", .bExtra = true, .extra = playerid);
    return 1;
    }
forward load_user_data_basic(playerid, name[], value[]);
forward load_user_data_gauja(playerid, name[], value[]);
public load_user_data_basic(playerid, name[], value[])
    {
    new suma,skin,taskai,interior, Float:x,Float:y,Float:z, gun[12],ammo[12];
    INI_Int( "Password",kodas);
    INI_Float("pos_X",z);
    INI_Float("pos_Y",y);
    INI_Float("pos_Z",z);
    SetPlayerPos(playerid,x,y,z);
    INI_Int("Interior",interior);
    SetPlayerInterior(playerid,interior);
    INI_Int("XP",taskai);
    SetPlayerScore(playerid,taskai);
    INI_Int("Level",PlayerInfo[playerid][pLevel]);
    INI_Int("Money", suma);
    GivePlayerMoneyA(playerid,suma);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Skin",skin);
    SetPlayerSkin(playerid,skin);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Accent",PlayerInfo[playerid][akcentas]);
    INI_Int("Leader",gplayerDB[playerid][glead]);
    INI_Int("GangId",gplayerDB[playerid][gangid]);
    INI_Bool("Tier1",PlayerInfo[playerid][pTier1]);
    INI_Bool("Tier2",PlayerInfo[playerid][pTier2]);
    INI_Bool("Tier3",PlayerInfo[playerid][pTier3]);
    INI_Bool("Moto",PlayerInfo[playerid][pMoto]);
    INI_Int("Ginklas0",gun[0]);INI_Int("Ammo0",ammo[0]);
    INI_Int("Ginklas1",gun[1]);INI_Int("Ammo1",ammo[1]);
    INI_Int("Ginklas2",gun[2]);INI_Int("Ammo2",ammo[2]);
    INI_Int("Ginklas3",gun[3]);INI_Int("Ammo3",ammo[3]);
    INI_Int("Ginklas4",gun[4]);INI_Int("Ammo4",ammo[4]);
    INI_Int("Ginklas5",gun[5]);INI_Int("Ammo5",ammo[5]);
    INI_Int("Ginklas6",gun[6]);INI_Int("Ammo6",ammo[6]);
    INI_Int("Ginklas7",gun[7]);INI_Int("Ammo7",ammo[7]);
    INI_Int("Ginklas8",gun[8]);INI_Int("Ammo8",ammo[8]);
    INI_Int("Ginklas9",gun[9]);INI_Int("Ammo9",ammo[9]);
    INI_Int("Ginklas10",gun[10]);INI_Int("Ammo10",ammo[10]);
    INI_Int("Ginklas11",gun[11]);INI_Int("Ammo11",ammo[11]);
    for(new i; i<12;i++)
        {
        GivePlayerWeapon(playerid,gun[i],ammo[i]);
        }

    return 1;
    }
P.S. but PW has been checked well...
pawn Код:
if (dialogid == 2)
        {
        new name[MAX_PLAYER_NAME], file[56];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);
        if(!response) return Kick(playerid);
        if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "enter your password", "login", "quit");
        LoadData(playerid);
        if(udb_hash(inputtext) != kodas)
            {
            SendClientMessage(playerid,RAUDONA, "Password is incorrect.");
            ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login", "enter your password", "login", "quit");
            }
        else
            {
            gPlayerLogged[playerid] = 1;
            PlayerInfo[playerid][pNew] = 2;
            SendClientMessage(playerid,ZALSVA, "[SYSTEM]: succesfully login!");
            }
        }
Reply
#2

Sorry Cant Help Becuse That Is A Diffrent Language Your Script Is!
Reply
#3

what about now?
Reply
#4

Sry for double post but i had notice that i dont get variables wicth are like this:
Код:
INI_Float("pos_X",z);
    INI_Float("pos_Y",y);
    INI_Float("pos_Z",z);
    SetPlayerPos(playerid,x,y,z);
I tried this:
pawn Код:
public load_user_data_basic(playerid, name[], value[])
    {
    new gun[12],ammo[12];
    if ( !strcmp( name, "pos_X" ) ) SetPVarString( playerid, "POSX", value );
    if ( !strcmp( name, "pos_Z" ) ) SetPVarString( playerid, "POSZ", value );
    if ( !strcmp( name, "pos_Y" ) ) SetPVarString( playerid, "POSY", value );
    if ( !strcmp( name, "Interior" ) ) SetPVarString( playerid, "Interid", value );
    if ( !strcmp( name, "XP" ) ) SetPVarString( playerid, "EXP", value );
    INI_Int("Level",PlayerInfo[playerid][pLevel]);
    if ( !strcmp( name, "Money" ) ) SetPVarString( playerid, "PINIGAI", value );
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    if ( !strcmp( name, "Skin" ) ) SetPVarString( playerid, "Apranga", value );
return 1;
}
public LoadData(playerid)
    {
    new name[MAX_PLAYER_NAME], file[256];
    GetPlayerName(playerid, name, sizeof(name));
    format(file, sizeof(file), SERVER_USER_FILE, name);
    INI_ParseFile(file, "load_user_data_%s", false, true, playerid );
    SetPlayerPos(playerid,GetPVarFloat(playerid,"POSX"),GetPVarFloat(playerid,"POSZ"),GetPVarFloat(playerid,"POSY"));
    SetPlayerInterior(playerid,GetPVarInt( playerid, "Interid"));
    SetPlayerScore(playerid,GetPVarInt(playerid, "EXP"));
    GivePlayerMoneyA(playerid,GetPVarInt( playerid, "PINIGAI"));
    SetPlayerSkin(playerid,GetPVarInt( playerid, "Apranga"));
    return 1;
    }
but still the same....
Maybe someone can post here or in my PM your Load and Save Script with Y_ini?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)