SA-MP Forums Archive
Weapon Saving Problem: - 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: Weapon Saving Problem: (/showthread.php?tid=304774)



Weapon Saving Problem: - Sledge - 19.12.2011

Hi, I am having a problem with my weapon saving system.

I spawned myself a Desert Eagle with 30 ammo. I logged out of the game and then I logged back in. When I spawned, I noticed my Desert Eagle had 60 ammo.


The function:
pawn Код:
public GivePlayerWeaponEx(playerid, weapon, ammo)
The code that spawns Desert Eagles:
pawn Код:
case 22, 23, 24:
        {
            Player[playerid][WepSlot2] = weapon;
            Player[playerid][WepAmmo2] = ammo;
            GivePlayerWeapon(playerid, weapon, ammo);
        }
So, my problem is with my weapon saving system. My ammo system is bugged. My ammo for my guns duplicate. I am using dini, and Vortex Roleplay 1 script. Any suggestions?


Re: Weapon Saving Problem: - sleepysnowflake - 19.12.2011

Check the file, what does it write in there? Maybe you ahve 2 saving systems and you get 30 + 30 = 60 :O


Re: Weapon Saving Problem: - Sledge - 19.12.2011

Actually, I found out that the ammo isn't saved when someone disconnect. I shoot my M4 from 500 ammo to 487. When I returned back in-game (after logging off), the M4 had 1000 ammo. I need to make a saving system for ammo under OnPlayerDisconnect.