Jump to content

I NEED SAVE WEAPON CODE


Asi.Eren

Recommended Posts

Jason_Gregory, do you even read? Maybe his English isn't the best but you can easily understand he needs code for saving weapons (even without reading whole question, just read topic title).

Asi.Eren, do you want to learn Lua at all or just want us to write the code for you?

Link to comment

@50p Yes ive read it, but i cant understand this shity english he talks :?

Here´s your Code dude

Clientside

weaponSlots = 11
ammoSlot = {}
gunSlot = {}
 
for slot = 1, weaponSlots do
if getPlayerWeapon ( player, slot ) then
         ammoSlot[slot] = getPlayerTotalAmmo ( player, slot )
         gunSlot[slot] = getPlayerWeapon ( 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

If you find Errors post it

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...