Galactix Posted June 11, 2018 Posted June 11, 2018 (edited) Hello, I'm trying to make a script to reload weapons but I can't get it working function weaponReload() local wep = getPlayerWeapon ( localPlayer ) setWeaponClipAmmo(wep, 7) end addCommandHandler("reload", weaponReload) I tried this to reload my desert eagle but it outputs the following error : Quote Bad argument @ 'setWeaponClipAmmo' [Expected weapon at argument 1, got number '24'] I don't really see what else than the weapon ID I could use that expected weapon error Anyone knows how to fix it? EDIT: After further research it turns out there was a built-in resource in the MTA files, problem solved Edited June 11, 2018 by Galactix If I helped you, make sure you click the reaction button on the right to support me! It will grant me more visibility and will help me to help others!If you have any kind of request or subject you would like to discuss about with me, don't hesitate to send me a private message about it!
Moderators Patrick Posted June 12, 2018 Moderators Posted June 12, 2018 https://wiki.multitheftauto.com/wiki/ReloadPedWeapon community profile | map converters | map images | pDownloader | pAttach | model encrypter
_Evo_ Posted June 13, 2018 Posted June 13, 2018 reloading with R key is more fast than "reload" command no?
Galactix Posted June 14, 2018 Author Posted June 14, 2018 Yeah I agree, but I was going to bind the command to a key at resource start, so results would’ve been the same. On 13/06/2018 at 15:57, _Evo_ said: reloading with R key is more fast than "reload" command no? Thanks, that’s pretty useful! On 12/06/2018 at 09:16, Patrick2562 said: https://wiki.multitheftauto.com/wiki/ReloadPedWeapon If I helped you, make sure you click the reaction button on the right to support me! It will grant me more visibility and will help me to help others!If you have any kind of request or subject you would like to discuss about with me, don't hesitate to send me a private message about it!
_Evo_ Posted June 20, 2018 Posted June 20, 2018 i have no idea what you going to do but, the default reload resource will save your time On 6/15/2018 at 02:40, Galactix said: Yeah I agree, but I was going to bind the command to a key at resource start, so results would’ve been the same. Thanks, that’s pretty useful!
Galactix Posted June 22, 2018 Author Posted June 22, 2018 On 12/06/2018 at 00:34, Galactix said: EDIT: After further research it turns out there was a built-in resource in the MTA files, problem solved Which is what I did If I helped you, make sure you click the reaction button on the right to support me! It will grant me more visibility and will help me to help others!If you have any kind of request or subject you would like to discuss about with me, don't hesitate to send me a private message about it!
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