adamb Posted May 12, 2013 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?
DiSaMe Posted May 12, 2013 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.
فاّرس Posted May 12, 2013 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...
فاّرس Posted May 12, 2013 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.
iPrestege Posted May 12, 2013 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 .
فاّرس Posted May 12, 2013 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.
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