Skream Posted July 1, 2018 Share Posted July 1, 2018 (edited) onClientPlayerWeaponFire work for melee weapons? I need to replace the golf club sound for a pickaxe Edited July 1, 2018 by Skream Link to comment
Discord Moderators Pirulax Posted July 1, 2018 Discord Moderators Share Posted July 1, 2018 (edited) It clearly says on the wiki page: Quote This does not trigger for projectiles, melee weapons, or camera. So, no, it doesnt, I'll add the note on the wiki page, so everyone will notice it. Edited July 1, 2018 by Pirulax Link to comment
Skream Posted July 1, 2018 Author Share Posted July 1, 2018 3 hours ago, Pirulax said: It clearly says on the wiki page: So, no, it doesnt, I'll add the note on the wiki page, so everyone will notice it. Yes ok but I need a way to detect melee weapons Link to comment
Moderators IIYAMA Posted July 1, 2018 Moderators Share Posted July 1, 2018 https://wiki.multitheftauto.com/wiki/GetPedTask 1 Link to comment
Skream Posted July 1, 2018 Author Share Posted July 1, 2018 19 minutes ago, IIYAMA said: https://wiki.multitheftauto.com/wiki/GetPedTask Hey thanks IIYAMA but getPedTask seems a little bit confusing. Do you know if https://wiki.multitheftauto.com/wiki/GetPedSimplestTask this would work? getPedSimplestTask(localPlayer) == TASK_SECONDARY_ATTACK and weaponId == 2 then Link to comment
Moderators IIYAMA Posted July 1, 2018 Moderators Share Posted July 1, 2018 (edited) I am not sure, I hardly needed them. Just run the example of the wiki, to figure our what you need. https://wiki.multitheftauto.com/wiki/GetPedTask Quote Example This example draws the active primary and secondary tasks (including task hierarchy in 1.1) as your local player moves around the world. function displayMyTask () local x,y = 100,200 for k=0,4 do local a,b,c,d = getPedTask ( getLocalPlayer(), "primary", k ) dxDrawText ( "Primary task #"..k.." is "..tostring(a).." -> "..tostring(b).." -> "..tostring(c).." -> "..tostring(d).." -> ", x, y ) y = y + 15 end y = y + 15 for k=0,5 do local a,b,c,d = getPedTask ( getLocalPlayer(), "secondary", k ) dxDrawText ( "Secondary task #"..k.." is "..tostring(a).." -> "..tostring(b).." -> "..tostring(c).." -> "..tostring(d).." -> ", x, y ) y = y + 15 end end addEventHandler ( "onClientRender", root, displayMyTask ) (x and y are screen positions) (a, b, c, d are the task information) You can also use bindkey: https://wiki.multitheftauto.com/wiki/BindKey But that doesn't tell you if a ped is actually doing the animation/task. bindKey("fire", "down", function () end) Edited July 1, 2018 by IIYAMA 1 Link to comment
Skream Posted July 1, 2018 Author Share Posted July 1, 2018 3 minutes ago, IIYAMA said: I am not sure, I hardly needed them. Just run the example of the wiki, to figure our what you need. https://wiki.multitheftauto.com/wiki/GetPedTask function displayMyTask () local x,y = 100,200 for k=0,4 do local a,b,c,d = getPedTask ( getLocalPlayer(), "primary", k ) dxDrawText ( "Primary task #"..k.." is "..tostring(a).." -> "..tostring(b).." -> "..tostring(c).." -> "..tostring(d).." -> ", x, y ) y = y + 15 end y = y + 15 for k=0,5 do local a,b,c,d = getPedTask ( getLocalPlayer(), "secondary", k ) dxDrawText ( "Secondary task #"..k.." is "..tostring(a).." -> "..tostring(b).." -> "..tostring(c).." -> "..tostring(d).." -> ", x, y ) y = y + 15 end end addEventHandler ( "onClientRender", root, displayMyTask ) (x and y are screen positions) (a, b, c, d are the task information) You can also use bindkey: https://wiki.multitheftauto.com/wiki/BindKey But that doesn't tell you if a ped is actually doing the animation/task. bindKey("fire", "down", function () end) k my friend I'll do my job here. Thanks for your help. Yeah, bindkey seems a bad idea for this. 1 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