johhnhd Posted December 31, 2013 Posted December 31, 2013 I am trying to make a taser script so when you shoot with the silenced pistol you reload after every shot i made this but it didn't work im really stuck function onClientPlayerWeaponFireFunc(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement ) if weapon == 23 then reloadPedWeapon ( thePed ) end end
Castillo Posted December 31, 2013 Posted December 31, 2013 You can set the weapon clip to have just 1 bullet, like a shotgun. You can't do this for a single player though, the change is global.
johhnhd Posted December 31, 2013 Author Posted December 31, 2013 so i could throw this into my police script setWeaponClipAmmo ( 23, 1 ) or setWeaponClipAmmo ( Silenced Pistol, 1 )
Castillo Posted December 31, 2013 Posted December 31, 2013 https://wiki.multitheftauto.com/wiki/SetWeaponProperty Use that function.
TAPL Posted December 31, 2013 Posted December 31, 2013 so i could throw this into my police script setWeaponClipAmmo ( 23, 1 ) or setWeaponClipAmmo ( Silenced Pistol, 1 ) No this only for custom weapons, setWeaponAmmo triggerServerEvent Event: "onClientPlayerWeaponFire"
johhnhd Posted December 31, 2013 Author Posted December 31, 2013 setWeaponProperty(23, "pro", "maximum_clip_ammo", 1) setWeaponProperty(23, "std", "maximum_clip_ammo", 1) setWeaponProperty(23, "poor", "maximum_clip_ammo", 1) added that get this problem
TAPL Posted December 31, 2013 Posted December 31, 2013 That's because you used it client side, change it to server side.
johhnhd Posted December 31, 2013 Author Posted December 31, 2013 cheers and is there a way to force a reload after every shot?
TAPL Posted December 31, 2013 Posted December 31, 2013 Try this: Client Side: addEventHandler("onClientPlayerWeaponFire", localPlayer, function(wp) if (wp == 23) then triggerServerEvent("onPlayerShot", localPlayer) end end) Server Side: addEvent("onPlayerShot",true) addEventHandler("onPlayerShot", root, function() reloadPedWeapon(source) end)
johhnhd Posted December 31, 2013 Author Posted December 31, 2013 Can't test it cause before I add a line before that when they shot it made them do a anim now i deleted the line they still do it how can i make them shoot normally
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