[Y_INI] Variable loading troubles
#1

Hello guys, please how I can make line, which is saved by INI_WriteInt function to variable? Becouse I need to get variable for that, becouse I want to load from the .ini with function INI_Int. My current lines:

Here are my variables in enum for example:
pawn Код:
enum wWeaponInfo
{
    wCarSlot1Weapon, //VARIABLE FOR WEAPON
    wCarSlot1Ammo //VARIABLE fOR AMMO
}

new WeaponInfo[MAX_PLAYERS][wWeaponInfo];

{
new INI:File = INI_Open (Path (playerid));
INI_WriteInt (File, "Slot1Weapon", GetPlayerWeapon (playerid)); //I NEED TO MAKE VARIABLE LOAD THIS FUNCTION
INI_WriteInt (File, "Slot1Ammo", GetPlayerAmmo (playerid));  //I NEED TO MAKE VARIABLE LOAD THIS FUNCTION
INI_Close (File);
SendClientMessage (playerid, -1, "You have successfully saved your gun to slot 1!");
}
Reply
#2

https://sampwiki.blast.hk/wiki/YSI:INI#b...g_.3D_false.29

Basically you need to create a public function for loading from a file with y_ini. Then use INI_ParseFile for calling that function.

It's explained in that link above ^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)