Jump to content

Help RPG Police Script


orcun99

Recommended Posts

I do not understand you correct the line

addEventHandler ("tasePlayer", root, function(attacker) 
    local nCop = getPlayerName(attacker) 
    local nCrim = getPlayerName(source) 
    local copAmmo = getPedTotalAmmo(attacker, true) 
    if not getInJail(source) then 
            setElementData(source,"taser.taseranimation",true) 
            setElementFrozen(source, true) 
            setPedAnimation(source, "CRACK", "crckidle2", -1, true, true, false, false) 
            toggleControl(source, "Next Weapon", false) 
            toggleControl(source, "Previous Weapon", false) 
            toggleControl(source, "Fire", false) 
            setTimer(function(player) if isElement(player) then setElementFrozen(player, false) setPedAnimation(player) toggleControl(player, "Next Weapon", true) toggleControl(player, "Previous Weapon", true) toggleControl(player, "Fire", true) end end, 3000, 1, source) 
            exports.xxxcommands:sendMessage("You tased " .. nCrim .. " and will have to wait 5 seconds for the taser to re-charge.", 220, 220, 220, attacker) 
            exports.xxxcommands:sendMessage("You have been tased by " .. nCop .. "." , 255, 255, 0, source) 
            takeWeapon(attacker, 23) 
            giveWeapon(attacker, 3, 1, true) 
        if copAmmo ~= 0 then 
            setTimer (giveWeapon, 5000, 1, attacker, 23, copAmmo - 1, false) 
        end 
    end 
end ) 

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