Jump to content

Sniper Rifle reload


dewu

Recommended Posts

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

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

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

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