Weapon saving - 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 (
/showthread.php?tid=418289)
Weapon saving -
Colossus874 - 24.02.2013
Hello, I'm working on a weapon saving system. Everything goes fine when you register, the weapon id is saved into the file as 0, and I even tried putting it to a 2 and it also saved. When it loads however it won't get the weapon ID, check this piece of code.
Код:
PlayerInfo[playerid][Weaponslot1] = (dUserINT(pName(playerid)).("Weaponslot1"));
And this is the GivePlayerWeapon function that is triggered when you spawn:
Код:
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weaponslot1], PlayerInfo[playerid][Ammoslot1]);
The Ammoslot 1 is also not working.
Re: Weapon saving -
ReVo_ - 24.02.2013
How you save weapons?
You save ammos too?
Re: Weapon saving -
Finn - 24.02.2013
Hard to help if you're not showing the bugged code.
Re: Weapon saving -
Colossus874 - 24.02.2013
Lol, I actually found the problem, and yes I do save ammo in a similar place as the weapon1, In the user file it said Weaponslot 1 and I wrote Weaponslot1 so that's why it didn't work. :P