Jump to content

[HELP] Weapon reload


Galactix

Recommended Posts

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 by Galactix
Link to comment

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!

 

 

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