Jump to content

Taser script help


johhnhd

Recommended Posts

Posted

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 

Posted
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

529ff4b7775603666757e1a1f34738c0.png

Posted

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) 

Posted

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

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