Saving Weapon and Ammo - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Saving Weapon and Ammo (
/showthread.php?tid=620961)
Saving Weapon and Ammo -
NealPeteros - 05.11.2016
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.
Re: Saving Weapon and Ammo -
oMa37 - 05.11.2016
Integer, lol.
Re: Saving Weapon and Ammo -
NealPeteros - 05.11.2016
Peaze!
Re: Saving Weapon and Ammo -
NealPeteros - 05.11.2016
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.
Re: Saving Weapon and Ammo -
NealPeteros - 05.11.2016
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]);