..:D&G:.. Posted June 17, 2015 Share 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 Link to comment
Markeloff Posted June 17, 2015 Share Posted June 17, 2015 local weapSlot = getSlotFromWeapon(i) I guess there isn't a weapon with ID 47, 19, 20, 21. Link to comment
jingzhi Posted June 19, 2015 Share 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? Link to comment
ALw7sH Posted June 19, 2015 Share Posted June 19, 2015 There's no weapon with this ID(47) https://wiki.multitheftauto.com/wiki/Weapons 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