Furious^ONE! Posted July 25, 2014 Posted July 25, 2014 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) )
Castillo Posted July 25, 2014 Posted July 25, 2014 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 ).
Castillo Posted July 25, 2014 Posted July 25, 2014 Well, it would help if you told us what you are trying to do.
Furious^ONE! Posted July 25, 2014 Author Posted July 25, 2014 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)
Castillo Posted July 26, 2014 Posted July 26, 2014 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 )
Furious^ONE! Posted July 26, 2014 Author Posted July 26, 2014 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'
Max+ Posted July 27, 2014 Posted July 27, 2014 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 )
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now