Toys saving
#1

I have question, how to re-write dini saving system to yini


Code
PHP код:
stock SaveToys(playeridfile[])
{
    
// Toys Model
    
dini_IntSet(file"tModel0"PlayerInfo[playerid][pToyModel][0]);
    
dini_IntSet(file"tModel1"PlayerInfo[playerid][pToyModel][1]);
    
dini_IntSet(file"tModel2"PlayerInfo[playerid][pToyModel][2]);
    
dini_IntSet(file"tModel3"PlayerInfo[playerid][pToyModel][3]);
    
dini_IntSet(file"tModel4"PlayerInfo[playerid][pToyModel][4]);
    
dini_IntSet(file"tModel5"PlayerInfo[playerid][pToyModel][5]);
    
dini_IntSet(file"tModel6"PlayerInfo[playerid][pToyModel][6]);
    
dini_IntSet(file"tModel7"PlayerInfo[playerid][pToyModel][7]);
    
dini_IntSet(file"tModel8"PlayerInfo[playerid][pToyModel][8]);
    
dini_IntSet(file"tModel9"PlayerInfo[playerid][pToyModel][9]);
    
// Toys X
    
dini_FloatSet(file"tX0"PlayerInfo[playerid][pToyX][0]);    dini_FloatSet(file"tX1"PlayerInfo[playerid][pToyX][1]);    dini_FloatSet(file"tX2"PlayerInfo[playerid][pToyX][2]);    dini_FloatSet(file"tX3"PlayerInfo[playerid][pToyX][3]);
    
dini_FloatSet(file"tX4"PlayerInfo[playerid][pToyX][4]);    dini_FloatSet(file"tX5"PlayerInfo[playerid][pToyX][5]);    dini_FloatSet(file"tX6"PlayerInfo[playerid][pToyX][6]);    dini_FloatSet(file"tX7"PlayerInfo[playerid][pToyX][7]);
    
dini_FloatSet(file"tX8"PlayerInfo[playerid][pToyX][8]);    dini_FloatSet(file"tX9"PlayerInfo[playerid][pToyX][9]);
    
// Toys Y
    
dini_FloatSet(file"tY0"PlayerInfo[playerid][pToyY][0]);    dini_FloatSet(file"tY1"PlayerInfo[playerid][pToyY][1]);    dini_FloatSet(file"tY2"PlayerInfo[playerid][pToyY][2]);    dini_FloatSet(file"tY3"PlayerInfo[playerid][pToyY][3]);
    
dini_FloatSet(file"tY4"PlayerInfo[playerid][pToyY][4]);    dini_FloatSet(file"tY5"PlayerInfo[playerid][pToyY][5]);    dini_FloatSet(file"tY6"PlayerInfo[playerid][pToyY][6]);    dini_FloatSet(file"tY7"PlayerInfo[playerid][pToyY][7]);
    
dini_FloatSet(file"tY8"PlayerInfo[playerid][pToyY][8]); dini_FloatSet(file"tY9"PlayerInfo[playerid][pToyY][9]);
    
// Toy Z
    
dini_FloatSet(file"tZ0"PlayerInfo[playerid][pToyZ][0]);    dini_FloatSet(file"tZ1"PlayerInfo[playerid][pToyZ][1]);    dini_FloatSet(file"tZ2"PlayerInfo[playerid][pToyZ][2]);    dini_FloatSet(file"tZ3"PlayerInfo[playerid][pToyZ][3]);
    
dini_FloatSet(file"tZ4"PlayerInfo[playerid][pToyZ][4]);    dini_FloatSet(file"tZ5"PlayerInfo[playerid][pToyZ][5]);    dini_FloatSet(file"tZ6"PlayerInfo[playerid][pToyZ][6]);    dini_FloatSet(file"tZ7"PlayerInfo[playerid][pToyZ][7]);
    
dini_FloatSet(file"tZ8"PlayerInfo[playerid][pToyZ][8]);    dini_FloatSet(file"tZ9"PlayerInfo[playerid][pToyZ][9]);
    
// Toy RX
    
dini_FloatSet(file"tRX0"PlayerInfo[playerid][pToyRX][0]); dini_FloatSet(file"tRX1"PlayerInfo[playerid][pToyRX][1]);    dini_FloatSet(file"tRX2"PlayerInfo[playerid][pToyRX][2]); dini_FloatSet(file"tRX3"PlayerInfo[playerid][pToyRX][3]);
    
dini_FloatSet(file"tRX4"PlayerInfo[playerid][pToyRX][4]); dini_FloatSet(file"tRX5"PlayerInfo[playerid][pToyRX][5]);    dini_FloatSet(file"tRX6"PlayerInfo[playerid][pToyRX][6]); dini_FloatSet(file"tRX7"PlayerInfo[playerid][pToyRX][7]);
    
dini_FloatSet(file"tRX8"PlayerInfo[playerid][pToyRX][8]); dini_FloatSet(file"tRX9"PlayerInfo[playerid][pToyRX][9]);
    
// Toy RY
    
dini_FloatSet(file"tRY0"PlayerInfo[playerid][pToyRY][0]); dini_FloatSet(file"tRY1"PlayerInfo[playerid][pToyRY][1]);    dini_FloatSet(file"tRY2"PlayerInfo[playerid][pToyRY][2]); dini_FloatSet(file"tRY3"PlayerInfo[playerid][pToyRY][3]);
    
dini_FloatSet(file"tRY4"PlayerInfo[playerid][pToyRY][4]); dini_FloatSet(file"tRY5"PlayerInfo[playerid][pToyRY][5]);    dini_FloatSet(file"tRY6"PlayerInfo[playerid][pToyRY][6]); dini_FloatSet(file"tRY7"PlayerInfo[playerid][pToyRY][7]);
    
dini_FloatSet(file"tRY8"PlayerInfo[playerid][pToyRY][8]); dini_FloatSet(file"tRY9"PlayerInfo[playerid][pToyRY][9]);
    
// Toy RZ
    
dini_FloatSet(file"tRZ0"PlayerInfo[playerid][pToyRZ][0]); dini_FloatSet(file"tRZ1"PlayerInfo[playerid][pToyRZ][1]);    dini_FloatSet(file"tRZ2"PlayerInfo[playerid][pToyRZ][2]); dini_FloatSet(file"tRZ3"PlayerInfo[playerid][pToyRZ][3]);
    
dini_FloatSet(file"tRZ4"PlayerInfo[playerid][pToyRZ][4]); dini_FloatSet(file"tRZ5"PlayerInfo[playerid][pToyRZ][5]);    dini_FloatSet(file"tRZ6"PlayerInfo[playerid][pToyRZ][6]); dini_FloatSet(file"tRZ7"PlayerInfo[playerid][pToyRZ][7]);
    
dini_FloatSet(file"tRZ8"PlayerInfo[playerid][pToyRZ][8]); dini_FloatSet(file"tRZ9"PlayerInfo[playerid][pToyRZ][9]);
    
// Toy SX
    
dini_FloatSet(file"tSX0"PlayerInfo[playerid][pToySX][0]); dini_FloatSet(file"tSX1"PlayerInfo[playerid][pToySX][1]);    dini_FloatSet(file"tSX2"PlayerInfo[playerid][pToySX][2]); dini_FloatSet(file"tSX3"PlayerInfo[playerid][pToySX][3]);
    
dini_FloatSet(file"tSX4"PlayerInfo[playerid][pToySX][4]); dini_FloatSet(file"tSX5"PlayerInfo[playerid][pToySX][5]);    dini_FloatSet(file"tSX6"PlayerInfo[playerid][pToySX][6]); dini_FloatSet(file"tSX7"PlayerInfo[playerid][pToySX][7]);
    
dini_FloatSet(file"tSX8"PlayerInfo[playerid][pToySX][8]); dini_FloatSet(file"tSX9"PlayerInfo[playerid][pToySX][9]);
    
// Toy SY
    
dini_FloatSet(file"tSY0"PlayerInfo[playerid][pToySY][0]); dini_FloatSet(file"tSY1"PlayerInfo[playerid][pToySY][1]);    dini_FloatSet(file"tSY2"PlayerInfo[playerid][pToySY][2]); dini_FloatSet(file"tSY3"PlayerInfo[playerid][pToySY][3]);
    
dini_FloatSet(file"tSY4"PlayerInfo[playerid][pToySY][4]); dini_FloatSet(file"tSY5"PlayerInfo[playerid][pToySY][5]);    dini_FloatSet(file"tSY6"PlayerInfo[playerid][pToySY][6]); dini_FloatSet(file"tSY7"PlayerInfo[playerid][pToySY][7]);
    
dini_FloatSet(file"tSY8"PlayerInfo[playerid][pToySY][8]); dini_FloatSet(file"tSY9"PlayerInfo[playerid][pToySY][9]);
    
// Toy SZ
    
dini_FloatSet(file"tSZ0"PlayerInfo[playerid][pToySZ][0]); dini_FloatSet(file"tSZ1"PlayerInfo[playerid][pToySZ][1]);    dini_FloatSet(file"tSZ2"PlayerInfo[playerid][pToySZ][2]); dini_FloatSet(file"tSZ3"PlayerInfo[playerid][pToySZ][3]);
    
dini_FloatSet(file"tSZ4"PlayerInfo[playerid][pToySZ][4]); dini_FloatSet(file"tSZ5"PlayerInfo[playerid][pToySZ][5]);    dini_FloatSet(file"tSZ6"PlayerInfo[playerid][pToySZ][6]); dini_FloatSet(file"tSZ7"PlayerInfo[playerid][pToySZ][7]);
    
dini_FloatSet(file"tSZ8"PlayerInfo[playerid][pToySZ][8]); dini_FloatSet(file"tSZ9"PlayerInfo[playerid][pToySZ][9]);
    return 
1;
}
stock LoadToys(playeridfile[])
{
    
// Toys
    
PlayerInfo[playerid][pToyModel][0] = dini_Int(file"tModel0");
    
PlayerInfo[playerid][pToyModel][1] = dini_Int(file"tModel1");
    
PlayerInfo[playerid][pToyModel][2] = dini_Int(file"tModel2");
    
PlayerInfo[playerid][pToyModel][3] = dini_Int(file"tModel3");
    
PlayerInfo[playerid][pToyModel][4] = dini_Int(file"tModel4");
    
PlayerInfo[playerid][pToyModel][5] = dini_Int(file"tModel5");
    
PlayerInfo[playerid][pToyModel][6] = dini_Int(file"tModel6");
    
PlayerInfo[playerid][pToyModel][7] = dini_Int(file"tModel7");
    
PlayerInfo[playerid][pToyModel][8] = dini_Int(file"tModel8");
    
PlayerInfo[playerid][pToyModel][9] = dini_Int(file"tModel9");
    
// Toys X
    
PlayerInfo[playerid][pToyX][0] = dini_Float(file"tX0"); PlayerInfo[playerid][pToyX][1] = dini_Float(file"tX1");    PlayerInfo[playerid][pToyX][2] = dini_Float(file"tX2"); PlayerInfo[playerid][pToyX][3] = dini_Float(file"tX3");
    
PlayerInfo[playerid][pToyX][4] = dini_Float(file"tX4"); PlayerInfo[playerid][pToyX][5] = dini_Float(file"tX5");    PlayerInfo[playerid][pToyX][6] = dini_Float(file"tX6"); PlayerInfo[playerid][pToyX][7] = dini_Float(file"tX7");
    
PlayerInfo[playerid][pToyX][8] = dini_Float(file"tX8"); PlayerInfo[playerid][pToyX][9] = dini_Float(file"tX9");
    
// Toys Y
    
PlayerInfo[playerid][pToyY][0] = dini_Float(file"tY0"); PlayerInfo[playerid][pToyY][1] = dini_Float(file"tY1");    PlayerInfo[playerid][pToyY][2] = dini_Float(file"tY2"); PlayerInfo[playerid][pToyY][3] = dini_Float(file"tY3");
    
PlayerInfo[playerid][pToyY][4] = dini_Float(file"tY4"); PlayerInfo[playerid][pToyY][5] = dini_Float(file"tY5");    PlayerInfo[playerid][pToyY][6] = dini_Float(file"tY6"); PlayerInfo[playerid][pToyY][7] = dini_Float(file"tY7");
    
PlayerInfo[playerid][pToyY][8] = dini_Float(file"tY8"); PlayerInfo[playerid][pToyY][9] = dini_Float(file"tY9");
    
// Toy Z
    
PlayerInfo[playerid][pToyZ][0] = dini_Float(file"tZ0"); PlayerInfo[playerid][pToyZ][1] = dini_Float(file"tZ1");    PlayerInfo[playerid][pToyZ][2] = dini_Float(file"tZ2"); PlayerInfo[playerid][pToyZ][3] = dini_Float(file"tZ3");
    
PlayerInfo[playerid][pToyZ][4] = dini_Float(file"tZ4"); PlayerInfo[playerid][pToyZ][5] = dini_Float(file"tZ5");    PlayerInfo[playerid][pToyZ][6] = dini_Float(file"tZ6"); PlayerInfo[playerid][pToyZ][7] = dini_Float(file"tZ7");
    
PlayerInfo[playerid][pToyZ][8] = dini_Float(file"tZ8"); PlayerInfo[playerid][pToyZ][9] = dini_Float(file"tZ9");
    
// Toy RX
    
PlayerInfo[playerid][pToyRX][0] = dini_Float(file"tRX0"); PlayerInfo[playerid][pToyRX][1] = dini_Float(file"tRX1");    PlayerInfo[playerid][pToyRX][2] = dini_Float(file"tRX2"); PlayerInfo[playerid][pToyRX][3] = dini_Float(file"tRX3");
    
PlayerInfo[playerid][pToyRX][4] = dini_Float(file"tRX4"); PlayerInfo[playerid][pToyRX][5] = dini_Float(file"tRX5");    PlayerInfo[playerid][pToyRX][6] = dini_Float(file"tRX6"); PlayerInfo[playerid][pToyRX][7] = dini_Float(file"tRX7");
    
PlayerInfo[playerid][pToyRX][8] = dini_Float(file"tRX8"); PlayerInfo[playerid][pToyRX][9] = dini_Float(file"tRX9");
    
// Toy RY
    
PlayerInfo[playerid][pToyRY][0] = dini_Float(file"tRY0");    PlayerInfo[playerid][pToyRY][1] = dini_Float(file"tRY1");    PlayerInfo[playerid][pToyRY][2] = dini_Float(file"tRY2");    PlayerInfo[playerid][pToyRY][3] = dini_Float(file"tRY3");
    
PlayerInfo[playerid][pToyRY][4] = dini_Float(file"tRY4");    PlayerInfo[playerid][pToyRY][5] = dini_Float(file"tRY5");    PlayerInfo[playerid][pToyRY][6] = dini_Float(file"tRY6");    PlayerInfo[playerid][pToyRY][7] = dini_Float(file"tRY7");
    
PlayerInfo[playerid][pToyRY][8] = dini_Float(file"tRY8");    PlayerInfo[playerid][pToyRY][9] = dini_Float(file"tRY9");
    
// Toy RZ
    
PlayerInfo[playerid][pToyRZ][0] = dini_Float(file"tRZ0");    PlayerInfo[playerid][pToyRZ][1] = dini_Float(file"tRZ1");    PlayerInfo[playerid][pToyRZ][2] = dini_Float(file"tRZ2");    PlayerInfo[playerid][pToyRZ][3] = dini_Float(file"tRZ3");
    
PlayerInfo[playerid][pToyRZ][4] = dini_Float(file"tRZ4");    PlayerInfo[playerid][pToyRZ][5] = dini_Float(file"tRZ5");    PlayerInfo[playerid][pToyRZ][6] = dini_Float(file"tRZ6");    PlayerInfo[playerid][pToyRZ][7] = dini_Float(file"tRZ7");
    
PlayerInfo[playerid][pToyRZ][8] = dini_Float(file"tRZ8");    PlayerInfo[playerid][pToyRZ][9] = dini_Float(file"tRZ9");
    
// Toy SX
    
PlayerInfo[playerid][pToySX][0] = dini_Float(file"tSX0");    PlayerInfo[playerid][pToySX][1] = dini_Float(file"tSX1");    PlayerInfo[playerid][pToySX][2] = dini_Float(file"tSX2");    PlayerInfo[playerid][pToySX][3] = dini_Float(file"tSX3");
    
PlayerInfo[playerid][pToySX][4] = dini_Float(file"tSX4");    PlayerInfo[playerid][pToySX][5] = dini_Float(file"tSX5");    PlayerInfo[playerid][pToySX][6] = dini_Float(file"tSX6");    PlayerInfo[playerid][pToySX][7] = dini_Float(file"tSX7");
    
PlayerInfo[playerid][pToySX][8] = dini_Float(file"tSX8");    PlayerInfo[playerid][pToySX][9] = dini_Float(file"tSX9");
    
// Toy SY
    
PlayerInfo[playerid][pToySY][0] = dini_Float(file"tSY0");    PlayerInfo[playerid][pToySY][1] = dini_Float(file"tSY1");    PlayerInfo[playerid][pToySY][2] = dini_Float(file"tSY2");    PlayerInfo[playerid][pToySY][3] = dini_Float(file"tSY3");
    
PlayerInfo[playerid][pToySY][4] = dini_Float(file"tSY4");    PlayerInfo[playerid][pToySY][5] = dini_Float(file"tSY5");    PlayerInfo[playerid][pToySY][6] = dini_Float(file"tSY6");    PlayerInfo[playerid][pToySY][7] = dini_Float(file"tSY7");
    
PlayerInfo[playerid][pToySY][8] = dini_Float(file"tSY8");    PlayerInfo[playerid][pToySY][9] = dini_Float(file"tSY9");
    
// Toy SZ
    
PlayerInfo[playerid][pToySZ][0] = dini_Float(file"tSZ0");    PlayerInfo[playerid][pToySZ][1] = dini_Float(file"tSZ1");    PlayerInfo[playerid][pToySZ][2] = dini_Float(file"tSZ2");    PlayerInfo[playerid][pToySZ][3] = dini_Float(file"tSZ3");
    
PlayerInfo[playerid][pToySZ][4] = dini_Float(file"tSZ4");    PlayerInfo[playerid][pToySZ][5] = dini_Float(file"tSZ5");    PlayerInfo[playerid][pToySZ][6] = dini_Float(file"tSZ6");    PlayerInfo[playerid][pToySZ][7] = dini_Float(file"tSZ7");
    
PlayerInfo[playerid][pToySZ][8] = dini_Float(file"tSZ8");    PlayerInfo[playerid][pToySZ][9] = dini_Float(file"tSZ9");
    for(new 
i=0i<10i++) // Toys
    
{
         if(
PlayerInfo[playerid][pToySX][i] == 0PlayerInfo[playerid][pToySX][i] = 1;
        if(
PlayerInfo[playerid][pToySY][i] == 0PlayerInfo[playerid][pToySY][i] = 1;
        if(
PlayerInfo[playerid][pToySZ][i] == 0PlayerInfo[playerid][pToySZ][i] = 1;
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)