Jump to content

Help me with my script freeze please


Recommended Posts

Posted

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

430x73_FFFFFF_FF9900_000000_000000.png
Posted

That doesn't really make much sense.

You got there: "player" and "source".

You also used addEvent and addEventHandler, but it doesn't make any sense, because you also used addCommandHandler ( in a wrong way by the way ).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Well, it would help if you told us what you are trying to do.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

I want the command "/men" freeze a player with a animation handsup and with a sentence

outputChatBox ("Player" .. getPlayerName (source) .. "Was handcuffed by" getPlayerName .. (source) .. "." Source, 255.241 , 0)

430x73_FFFFFF_FF9900_000000_000000.png
Posted
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 
) 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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

430x73_FFFFFF_FF9900_000000_000000.png
Posted

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 
) 

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

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