Jump to content

Help me with my script freeze please


Recommended Posts

I have problem with my script , help me please

when I started not working

addEvent("freeze", true) 
addEventHandler("freeze", root, 
function (player) 
    setPedAnimation ( source, "SHOP", "SHP_Rob_Handsup", -1, true, false, false ) 
    setElementFrozen(player, true) 
    outputChatBox("Player "..getPlayerName(source).."was handcuffed by "..getPlayerName(source)..".",source, 255,241,0) 
end) 
addCommandHandler ( "handcuff", (player) ) 

Link to comment
addCommandHandler ( "handcuff", 
    function ( thePlayer, _, who ) 
        local target = getPlayerFromName ( who ) -- Get the player from it's name 
        if ( target ) then -- If the player exists 
            setPedAnimation ( target, "SHOP", "SHP_Rob_Handsup", -1, true, false, false ) -- Set his/her animation 
            setElementFrozen ( target, true ) -- Free him/her 
            outputChatBox ( "Player ".. getPlayerName ( target ) .." was handcuffed by ".. getPlayerName ( thePlayer ) ..".", root, 255, 241, 0 ) -- Output a global message 
        end 
    end 
) 

Link to comment
addCommandHandler ( "handcuff", 
    function ( thePlayer, _, who ) 
      if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Police" ) ) then 
        local target = getPlayerFromName ( who ) -- Get the player from it's name 
        if ( target ) then -- If the player exists 
            setPedAnimation ( target, "SHOP", "SHP_Rob_Handsup", -1, true, false, false ) -- Set his/her animation 
            setElementFrozen ( target, true ) -- Free him/her 
            outputChatBox ( "Player ".. getPlayerName ( target ) .." was handcuffed by ".. getPlayerName ( thePlayer ) ..".", root, 255, 241, 0 ) -- Output a global message 
        end 
    end 
) 

i'm add the code :

      if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Police" ) ) then 

but not working..

ERROR CODE :

[2014-07-26 14:47:06] SCRIPT ERROR: @Handcuff/cuff.lua:2: unexpected symbol near 'if'

[2014-07-26 14:47:06] ERROR: Loading script failed: @Handcuff/cuff.lua:2: unexpected symbol near 'if'

[2014-07-26 14:47:06] SCRIPT ERROR: @Handcuff/release.lua:2: unexpected symbol near 'if'

[2014-07-26 14:47:06] ERROR: Loading script failed: @Handcuff/release.lua:2: unexpected symbol near 'if'

Link to comment

addCommandHandler ( "handcuff", 
    function ( thePlayer, _, who ) 
      if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( "Police" ) ) then 
        local target = getPlayerFromName ( who ) -- Get the player from it's name 
        if ( target ) then -- If the player exists 
            setPedAnimation ( target, "SHOP", "SHP_Rob_Handsup", -1, true, false, false ) -- Set his/her animation 
            setElementFrozen ( target, true ) -- Free him/her 
            outputChatBox ( "Player ".. getPlayerName ( target ) .." was handcuffed by ".. getPlayerName ( thePlayer ) ..".", root, 255, 241, 0 ) -- Output a global message 
        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...