Jump to content

Weapon table


DarkByte

Recommended Posts

Hey can someone help me make to get weapons from a table and from lower name please.

function giveWeaponCommand(cmd, weapon, amount) 
    weapon = tonumber(weapon) or getWeaponIDFromName(weapon) 
    if not weapon then 
        return 
    end 
    amount = amount and tonumber(amount) or 500 
    server.giveMeWeapon(math.floor(weapon), amount) 
end 
addCommandHandler('give', giveWeaponCommand) 
addCommandHandler('wp', giveWeaponCommand) 

Link to comment

Write /give

function giveWeaponCommand(cmd, weapon, amount) 
    weapon = tonumber(weapon) or getWeaponIDFromName(weapon) 
    if not weapon then 
        return 
    end 
    amount = amount and tonumber(amount) or 500 
    server.giveMeWeapon(math.floor(weapon), amount) 
end 
addCommandHandler('give', giveWeaponCommand) 
  

What you mean with ( lower name ) ?

Link to comment
  • 4 weeks later...
Hey can someone help me make to get weapons from a table and from lower name please.
function giveWeaponCommand(cmd, weapon, amount) 
    weapon = tonumber(weapon) or getWeaponIDFromName(weapon) 
    if not weapon then 
        return 
    end 
    amount = amount and tonumber(amount) or 500 
    server.giveMeWeapon(math.floor(weapon), amount) 
end 
addCommandHandler('give', giveWeaponCommand) 
addCommandHandler('wp', giveWeaponCommand) 

Show the giveMeWeapon function cause I dont see any operation related to tables here

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