Save Weapon - 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: Save Weapon (
/showthread.php?tid=613759)
Save Weapon -
AlexPalermitano97 - 31.07.2016
Hi, I have a little problem..
I will save the user's files 2 weapons
how do I savem, when the player logs off, the ammunition?
I have
pWeapon1 = 24
pAmmo1 = 100
pWeapon2 = 30
pAmmo2 =50
if I shoot with my second weapon, how do I save the ammunition?
Re: Save Weapon -
Logic_ - 31.07.2016
https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Re: Save Weapon -
FreAkeD - 31.07.2016
If you're using MYSQL, refer to this thread for some tips and a full tutorial on how to load / save.
Re: Save Weapon -
AlexPalermitano97 - 31.07.2016
I use y_ini.
I can not use well getplayerweapondata
how to use? how can I save in the weapon with which to shoot, the ammo?
the variable of enum is:
•PlayerInfo[playerid][pWeapon1];
•PlayerInfo[playerid][pAmmo1];
•PlayerInfo[playerid][pWeapon2];
•PlayerInfo[playerid][pAmmo1];
Re: Save Weapon -
AlexPalermitano97 - 31.07.2016
UPPP
Re: Save Weapon -
AlexPalermitano97 - 31.07.2016
This is not correct, true?
Quote:
new sweapon, sammo;
for (new i=0; i<12; i++)
{
GetPlayerWeaponData(playerid, i, sweapon, sammo);
if(sweapon != 0)
{
PlayerInfo[playerid][pWeapon1] = sweapon;
PlayerInfo[playerid][pAmmo1] = sammo;
PlayerInfo[playerid][pWeapon2] = sweapon;
PlayerInfo[playerid][pAmmo2] = sammo;
}
}
|