Jump to content

I NEED SAVE WEAPON CODE


Asi.Eren

Recommended Posts

Posted

I AM INTERESTED IN YOUR IDEAS AND WOULD LIKE TO SUBSCRIBE TO YOUR NEWSLETTER

Please provide some more details. What exactly are you trying to save? A player's current weapons and ammo?

Posted
https://wiki.multitheftauto.com/wiki/SetAccountData
x, y, z = getElementPosition(player)
setAccountData ( getPlayerAccount(player), "position", x..","..y..","..z)
setAccountData ( getPlayerAccount(player), "skin", getElementModel(player))
setAccountData ( getPlayerAccount(player), "money", getPlayerMoney(player))

use onPlayerLogin or not isGuestAccount() for checking isnt that a guest account

Posted

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?

Posted

@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

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...