..:D&G:.. Posted June 17, 2015 Posted June 17, 2015 Hello guys, I got some problems with getSlotFromWeapon, it says that weapon-type was expected at argument 1, but got 47 (which is the weapon id) even in the wiki it says that the argument 1 should be the weapon id, not weapon type... function checkPlayerWeapons() for i = 1, 47 do if i ~= 40 then local weapSlot = i == 15 and 10 or getSlotFromWeapon(i) if getPedWeapon(localPlayer, weapSlot) == i then local ammo = getElementData(localPlayer, "safeWeapon" .. i) or 0 if ammo < 0 then ammo = 0 setElementData(localPlayer, "safeWeapon" .. i, 0, false) end MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Markeloff Posted June 17, 2015 Posted June 17, 2015 local weapSlot = getSlotFromWeapon(i) I guess there isn't a weapon with ID 47, 19, 20, 21. Some people want it to happen, some wish it would happen, others make it happen.
jingzhi Posted June 19, 2015 Posted June 19, 2015 [quote name=..&G:..]Hello guys, I got some problems with getSlotFromWeapon, it says that weapon-type was expected at argument 1, but got 47 (which is the weapon id) even in the wiki it says that the argument 1 should be the weapon id, not weapon type... function checkPlayerWeapons() for i = 1, 47 do if i ~= 40 then local weapSlot = i == 15 and 10 or getSlotFromWeapon(i) if getPedWeapon(localPlayer, weapSlot) == i then local ammo = getElementData(localPlayer, "safeWeapon" .. i) or 0 if ammo < 0 then ammo = 0 setElementData(localPlayer, "safeWeapon" .. i, 0, false) end What are you trying to do here?
ALw7sH Posted June 19, 2015 Posted June 19, 2015 There's no weapon with this ID(47) https://wiki.multitheftauto.com/wiki/Weapons
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