problem. -
Antoniohl - 17.02.2015
Hello, i'm trying to create a "Backpack System",everything works fine except when someone buy a backpack it just replace in the same .ini for example it only create one .ini file it doesn't want to make 1.2.3.etc, what's the problem? here's my codes
Код:
enum pBagIn
{
pbWeapon1,
pbAmmo1
};
new BagInfo[MAX_BAGS2][pBagIn];
Код:
public Createbags(idx, name[], value[]){
new string[128];
format(string, 128, "WeaponID");
INI_Int(string, BagInfo[idx][pbWeapon1]);
format(string, 128, "Ammo");
INI_Int(string, BagInfo[idx][pbAmmo1]);
return 1;
}
Код:
public LoaddataBags(idx){
new housefile[64];
format(housefile, 64, DATA_BAG, idx);
new INI:File = INI_Open(housefile);
INI_SetTag(File,"Informacion");
format(housefile,64, "WeaponID");
INI_WriteInt(File,housefile, BagInfo[idx][pbWeapon1]);
format(housefile, 64, "Ammo");
INI_WriteInt(File,housefile, BagInfo[idx][pbAmmo1]);
INI_Close(File);
return 1;
}
Edit:
and here's where the player's buy the backpack
Код:
new idx = 0;
while(idx < MAX_BAGS2)
{
if(PlayerInfo[playerid][pBackPack] == 0)
{
Buy(playerid, -1000);
AttachObjectCorrectly(playerid, 3026);
PlayerInfo[playerid][pBackPack] = 1;
SendInfoMessage(playerid, 2,"0", "You have Bought a Bag For $1000!");
LoaddataBags(idx);
idx = MAX_BAGS2;
idx++;
}
}
and tried this too..
Код:
for(new idx=0; idx<MAX_BAGS2; idx++)
is there something wrong with my codes?, if yes please explain
Re: problem. -
Antoniohl - 18.02.2015
bump.
Re: problem. -
Antoniohl - 19.02.2015
do you guys don't know solution or you don't understand what i'm saying or what :/
Re: problem. -
Excel™ - 19.02.2015
You have fucked up the indentation, secondally, I can't figure out what you want!
Re: problem. -
Antoniohl - 19.02.2015
when someone purchase a bag, it should create a bag for example bag1.ini, if i've bought another one again, it will replace in the same ini file, it only creates one ini file.
i'm sorry i'm trying my best, sorry for my english.
Re: problem. -
Antoniohl - 20.02.2015
Bump.
Re: problem. -
Scrillex - 20.02.2015
Because you need to %d it.. To make a multiple backpack files...
%d = nummerded!
Re: problem. -
Excel™ - 20.02.2015
DATA_BAG
what's this^
Re: problem. -
Antoniohl - 20.02.2015
Quote:
Originally Posted by Scrillex
Because you need to %d it.. To make a multiple backpack files... %d = nummerded!
|
it's %d, and i've wrote the codes again and still saving in the same ini
Код:
#define DATA_BAGS "Bags/Bag%d.ini"
Re: problem. -
Antoniohl - 21.02.2015
Bump.