Weapons problem
#8

As easy as it sounds:

Код:
SavePlayerWeaponData(playerid) // save the data on disconnect
{
	new 
		weaponid,
		ammo,
		string[10]
	;

	for (new i = 0; i != 13; i++)
	{
		GetPlayerWeaponData(playerid, i, weaponid, ammo);

		if(!weaponid)
			continue;

		format(string, sizeof (string), "Gun%02i", i);
		INI_WriteInt(File, string, weaponid);

		format(string, sizeof (string), "Ammo%02i", i)
	    INI_WriteInt(File, string, ammo);
	}
}

// Load the data on first spawn

	new 
		weaponid,
		ammo,
		string[10]
	;

	for (new i = 0; i != 13; i++)
	{
		format(string, sizeof (string), "Gun%02i", i);
		INI_Int(string, weaponid);
		format(string, sizeof (string), "Ammo%02i", i)
	    INI_Int(string, ammo);

	    GivePlayerWeapon(playerid, weaponid, ammo);
	}
}
Reply


Messages In This Thread
Weapons problem - by benjaminjones - 01.09.2015, 06:14
Re: Weapons problem - by Sanady - 01.09.2015, 06:19
Re: Weapons problem - by benjaminjones - 01.09.2015, 06:32
Re: Weapons problem - by Evocator - 01.09.2015, 07:11
Re: Weapons problem - by benjaminjones - 01.09.2015, 08:11
Re: Weapons problem - by MarvinPWN - 01.09.2015, 08:40
Re: Weapons problem - by benjaminjones - 01.09.2015, 09:28
Re: Weapons problem - by Evocator - 01.09.2015, 09:44
Re: Weapons problem - by MarvinPWN - 01.09.2015, 09:50
Re: Weapons problem - by benjaminjones - 02.09.2015, 05:29

Forum Jump:


Users browsing this thread: 1 Guest(s)