adamb Posted May 12, 2013 Share Posted May 12, 2013 Alright, so i made an 'arrest' script, which basically stops an NPC and applys the animation 'handsup' on it. Tho it doesn't work / work on slothbots neither NPC-HLC bots. heres the code: for i,v in ipairs(getElementsByType("player")) do bindKey(v, "e", "down", "arrest") end function onPlayerTarget ( playerSource, keyPresser, key, keyStatetargetElem, targetElem ) setPedAnimation( targetElem, "ped", "handsup") end addCommandHandler("arrest", onPlayerTarget) Can anyone help me out? Link to comment
فاّرس Posted May 12, 2013 Share Posted May 12, 2013 The animation("handsup") not in wiki. Link to comment
adamb Posted May 12, 2013 Author Share Posted May 12, 2013 It is, under 'ped' there is 'handsup' Link to comment
DiSaMe Posted May 12, 2013 Share Posted May 12, 2013 It doesn't work on slothbots and NPC HLC peds because it doesn't work at all. targetElem is either undefined or a string. Link to comment
adamb Posted May 12, 2013 Author Share Posted May 12, 2013 Hmm... How would it work then? Link to comment
فاّرس Posted May 12, 2013 Share Posted May 12, 2013 for i,v in ipairs(getElementsByType("player")) do bindKey(v, "e", "down", "arrest") end function onPlayerTarget (ped) if getElementType(ped) == 'ped' then setPedAnimation( ped, "ped", "handsup") end end addCommandHandler("arrest", onPlayerTarget) Try it. If it wrong use for k,v in ipiras... Link to comment
فاّرس Posted May 12, 2013 Share Posted May 12, 2013 for i,v in ipairs(getElementsByType("player")) do bindKey(v, "e", "down", "arrest") end function onPlayerTarget (ped) for k,v in ipairs(getElementType("ped")) do setPedAnimation( v, "ped", "handsup") end end addCommandHandler("arrest", onPlayerTarget) Try it. Link to comment
iPrestege Posted May 12, 2013 Share Posted May 12, 2013 for i,v in ipairs(getElementsByType("player")) do bindKey(v, "e", "down", "arrest") end function onPlayerTarget (ped) for k,v in ipairs(getElementType("ped")) do setPedAnimation( v, "ped", "handsup") end end addCommandHandler("arrest", onPlayerTarget) Try it. No this will find any ped in the server and set the anim . Link to comment
فاّرس Posted May 12, 2013 Share Posted May 12, 2013 for i,v in ipairs(getElementsByType("player")) do bindKey(v, "e", "down", "arrest") end function onPlayerTarget (ped) for k,v in ipairs(getElementType("ped")) do setPedAnimation( v, "ped", "handsup") end end addCommandHandler("arrest", onPlayerTarget) Try it. No this will find any ped in the server and set the anim . so how to do it? if you try this : for i,v in ipairs(getElementsByType("player")) do bindKey(v, "e", "down", "arrest") end function onPlayerTarget (player) setPedAnimation( player, "ped", "handsup") end end addCommandHandler("arrest", onPlayerTarget) this for player only. Link to comment
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