17.02.2015, 18:25
(
Последний раз редактировалось Antoniohl; 17.02.2015 в 20:51.
)
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
Edit:
and here's where the player's buy the backpack
and tried this too..
is there something wrong with my codes?, if yes please explain
Код:
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; }
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++; } }
Код:
for(new idx=0; idx<MAX_BAGS2; idx++)
![Sad](images/smilies/sad.gif)