johhnhd Posted December 31, 2013 Share 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 Link to comment
Castillo Posted December 31, 2013 Share 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. Link to comment
johhnhd Posted December 31, 2013 Author Share Posted December 31, 2013 so i could throw this into my police script setWeaponClipAmmo ( 23, 1 ) or setWeaponClipAmmo ( Silenced Pistol, 1 ) Link to comment
Castillo Posted December 31, 2013 Share Posted December 31, 2013 https://wiki.multitheftauto.com/wiki/SetWeaponProperty Use that function. Link to comment
TAPL Posted December 31, 2013 Share 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" Link to comment
johhnhd Posted December 31, 2013 Author Share 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 Link to comment
TAPL Posted December 31, 2013 Share Posted December 31, 2013 That's because you used it client side, change it to server side. Link to comment
johhnhd Posted December 31, 2013 Author Share Posted December 31, 2013 cheers and is there a way to force a reload after every shot? Link to comment
TAPL Posted December 31, 2013 Share 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) Link to comment
johhnhd Posted December 31, 2013 Author Share 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 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