SA-MP Forums Archive
[Help] Saving weapons for next spawns - 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: [Help] Saving weapons for next spawns (/showthread.php?tid=453500)



[Help] Saving weapons for next spawns - Champ - 25.07.2013

Hello, I have created a shop menu but when player buys a gun and i gets death. He lost his all bought weapons. Is there any way to save bought weapons for next spawn.
Thank You.


Re: [Help] Saving weapons for next spawns - JimmyCh - 25.07.2013

Of course there is a way to do that, check the following topic:
https://sampforum.blast.hk/showthread.php?tid=315262

Here is the pastebin link:
http://pastebin.com/TaD5miwQ


EDIT: The trick is you need to save weapons onto a file and then load from that file, so edit it to your OnPlayerDeath etc..


Re: [Help] Saving weapons for next spawns - Champ - 25.07.2013

Is there any way without saving weapons in a file. Because i want to reset weapons after 5 mins. Just for 5 mins the weapons should be same.


Re: [Help] Saving weapons for next spawns - JimmyCh - 25.07.2013

Maybe you can do OnPlayerDeath to save the weapons data with GetPlayerWeaponData(playerid, slot, &weapons, &ammo) then OnPlayerSpawn like GivePlayerWeapon, but you need to save them as slots then give them as slots, I hope you understand what I mean..


Re: [Help] Saving weapons for next spawns - Champ - 25.07.2013

Thanks for giving idea. System created.

pawn Код:
Rep ++;