Saving Weapon and Ammo
#1

I'm using Y_INI in saving and loading data. I decided to save/load the Weapon and Ammo of a player but I got confused in the part if it's a Float or an Integer. So I went here to ask for help.
Reply
#2

Integer, lol.
Reply
#3

Peaze!
Reply
#4

One question

Код:
INI_WriteInt(File,"Weap1",pInfo[playerid][pWeap1]);
	INI_WriteInt(File,"Ammo1",pInfo[playerid][pAmmo1]);
	INI_WriteInt(File,"Weap2",pInfo[playerid][pWeap2]);
	INI_WriteInt(File,"Ammo2",pInfo[playerid][pAmmo2]);
	INI_WriteInt(File,"Weap3",pInfo[playerid][pWeap3]);
	INI_WriteInt(File,"Ammo3",pInfo[playerid][pAmmo3]);
	INI_WriteInt(File,"Weap4",pInfo[playerid][pWeap4]);
	INI_WriteInt(File,"Ammo4",pInfo[playerid][pAmmo4]);
	INI_WriteInt(File,"Weap5",pInfo[playerid][pWeap5]);
	INI_WriteInt(File,"Ammo5",pInfo[playerid][pAmmo5]);
	INI_WriteInt(File,"Weap6",pInfo[playerid][pWeap6]);
	INI_WriteInt(File,"Ammo6",pInfo[playerid][pAmmo6]);
	INI_WriteInt(File,"Weap7",pInfo[playerid][pWeap7]);
	INI_WriteInt(File,"Ammo7",pInfo[playerid][pAmmo7]);
	INI_WriteInt(File,"Weap8",pInfo[playerid][pWeap8]);
	INI_WriteInt(File,"Ammo8",pInfo[playerid][pAmmo8]);
	INI_WriteInt(File,"Weap9",pInfo[playerid][pWeap9]);
	INI_WriteInt(File,"Ammo9",pInfo[playerid][pAmmo9]);
How to change the value of the weapons and ammo so that you can get the weaponid and amount of ammo in that weapon slot.
Reply
#5

Found it

Код:
GetPlayerWeaponData(playerid, 1, pInfo[playerid][pWeap1], pInfo[playerid][pAmmo1]);
	GetPlayerWeaponData(playerid, 2, pInfo[playerid][pWeap2], pInfo[playerid][pAmmo2]);
	GetPlayerWeaponData(playerid, 3, pInfo[playerid][pWeap3], pInfo[playerid][pAmmo3]);
	GetPlayerWeaponData(playerid, 4, pInfo[playerid][pWeap4], pInfo[playerid][pAmmo4]);
	GetPlayerWeaponData(playerid, 5, pInfo[playerid][pWeap5], pInfo[playerid][pAmmo5]);
	GetPlayerWeaponData(playerid, 6, pInfo[playerid][pWeap6], pInfo[playerid][pAmmo6]);
	GetPlayerWeaponData(playerid, 7, pInfo[playerid][pWeap7], pInfo[playerid][pAmmo7]);
	GetPlayerWeaponData(playerid, 8, pInfo[playerid][pWeap8], pInfo[playerid][pAmmo8]);
	GetPlayerWeaponData(playerid, 9, pInfo[playerid][pWeap9], pInfo[playerid][pAmmo9]);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)