Save Weapon
#1

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?
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerWeaponData
Reply
#3

If you're using MYSQL, refer to this thread for some tips and a full tutorial on how to load / save.
Reply
#4

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];
Reply
#5

UPPP
Reply
#6

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;
}
}
Reply


Forum Jump:


Users browsing this thread: