problem.
#1

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
Reply


Messages In This Thread
problem. - by Antoniohl - 17.02.2015, 18:25
Re: problem. - by Antoniohl - 18.02.2015, 11:55
Re: problem. - by Antoniohl - 19.02.2015, 11:46
Re: problem. - by Excel™ - 19.02.2015, 11:50
Re: problem. - by Antoniohl - 19.02.2015, 12:00
Re: problem. - by Antoniohl - 20.02.2015, 11:17
Re: problem. - by Scrillex - 20.02.2015, 11:19
Re: problem. - by Excel™ - 20.02.2015, 11:28
Re: problem. - by Antoniohl - 20.02.2015, 11:52
Re: problem. - by Antoniohl - 21.02.2015, 09:08

Forum Jump:


Users browsing this thread: 1 Guest(s)