I still thank you guys for the perfectly working script, but now I'm trying to figure out a working weapon save system.
I didn't code this, but a guy called Jason wrote the code :
weaponSlots = 11
ammoSlot = {}
gunSlot = {}
for slot = 1, weaponSlots do
if getPedWeapon ( player, slot ) then
ammoSlot[slot] = getPedTotalAmmo ( player, slot )
gunSlot[slot] = getPedWeapon ( player, slot )
end
end
-- If you want save your WEAPON CODE later than you can use ElementData -> global
for gun = 1, #gunSlot do
if gunSlot[gun] ~= nil then
setElementData(player, "weapon#"..gun, getWeaponNameFromID(gunSlot[gun])
setElementData(player, "ammo#"..gun, ammoSlot[gun])
end
end
Somehow I think it's missing a function, I tried lots of functions but none of them were working, I even used the search button.
Help would be appreciated.