dewu Posted March 2, 2015 Share Posted March 2, 2015 Hi guys. Is any way to make full sniper reload (i mean anim of reloading) after 1 shot? I've tried this code, but that is no working in Sniper Rifle: function reloadtazerclient ( ) if (weapon == 34) then triggerServerEvent ( "ontazershoot", localPlayer ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, reloadtazerclient ) Server: function tazershootserverside ( ) reloadPedWeapon ( source ) end addEvent ( "ontazershoot", true ) addEventHandler ( "ontazershoot", root, tazershootserverside ) Also i tried with SetWeaponProperty with 1 clip, but's still no working. Link to comment
John Smith Posted March 2, 2015 Share Posted March 2, 2015 Youre missing an argument of weapon in function associated with onclientplayerweaponfire To triggerserverevent add 3rd argument ,weapon And then add an argument in serverside function and then reloadpedweapon with that argument If you do this, code will execute just fine Link to comment
Enargy, Posted March 2, 2015 Share Posted March 2, 2015 Youre missing an argument of weapon in function associated with onclientplayerweaponfireTo triggerserverevent add 3rd argument ,weapon And then add an argument in serverside function and then reloadpedweapon with that argument If you do this, code will execute just fine function reloadtazerclient (weapon, ammo, ammoInClip) if (weapon == 34) then triggerServerEvent ( "ontazershoot", localPlayer ) end end addEventHandler ( "onClientPlayerWeaponFire", localPlayer, reloadtazerclient ) what it does reloadPedWeapon is reload all weapons owned by the player, not one. Link to comment
dewu Posted March 3, 2015 Author Share Posted March 3, 2015 Problem resolved. I just use setPedAnimation(source, "TEC", "TEC_reload", -1, false, false, false, false) instead of reloadPedWeapon ( source ) 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