DarkByte Posted October 20, 2015 Share Posted October 20, 2015 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
DarkByte Posted October 20, 2015 Author Share Posted October 20, 2015 Please help me. Link to comment
swedishboy Posted October 20, 2015 Share Posted October 20, 2015 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
DarkByte Posted October 20, 2015 Author Share Posted October 20, 2015 Man i know how to use this script. And to get weapon names from tables Link to comment
Fist Posted October 22, 2015 Share Posted October 22, 2015 why u made other topic for it if u have already made for it? https://forum.multitheftauto.com/viewtopic.php?f=91&t=93849 Link to comment
jingzhi Posted November 19, 2015 Share Posted November 19, 2015 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now