Jump to content

use all weapons


Dolinho

Recommended Posts

Posted

How can I use the 45 colt, desert and silenced all at once?

All weapons not only that I quoted.

sorry for the bad english.

If someone answer me will stay here very grateful.

Posted

That's the thing then, they used an inventory, probably id based which can store all weapons, even those in the same slot. However you can't do this by yourself using the standard features, unless you make your own inventory system from scratch.

Posted

This is quite laborious.

Saw this in the MTA wiki. I thought it was What do I want to but I am mistaken.

function giveWeapons(player, weaponsString) 
    local weaponsTable = split(weaponsString, ';') --split the string by the semi colon 
    for k,v in ipairs(weaponsTable) do --for all the split values do 
        weaponId = gettok(v, 1, string.byte(',')) --get the weapon ID using gettok, retrieve the first token 
        weaponAmmo = gettok(v, 2, string.byte(',')) --get the ammo using gettok, retrieve the second token 
        if (weaponId ~= nil and weaponAmmo ~= nil) then --if neither of them is invalid 
            giveWeapon(player, weaponId, weaponAmmo) --give the player the weapons 
        end 
    end 
end 

  • 5 months later...
Posted
This is quite laborious.

Saw this in the MTA wiki. I thought it was What do I want to but I am mistaken.

This is for saving weapons and loading them again.

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