Master_MTA Posted July 5, 2020 Posted July 5, 2020 hello guys i have small question is there any way to make a player can aim 360 degree by weapon or i have to do my custom aim script i was mean is there any function do it for me like setWeaponProperty and which property it's or i have to use onClientRender and so on thx in advance Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Moderators IIYAMA Posted July 6, 2020 Moderators Posted July 6, 2020 (edited) 10 hours ago, Master_MTA said: or i have to use onClientRender and so on yes that one + https://wiki.multitheftauto.com/wiki/SetPedAimTarget + rotate the ped see also: https://web.archive.org/web/20130728213352/http://crystalmv.net84.net/pages/scripts/npc_hlc.php Edited July 6, 2020 by IIYAMA 1 Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
Master_MTA Posted July 6, 2020 Author Posted July 6, 2020 5 hours ago, IIYAMA said: yes that one + https://wiki.multitheftauto.com/wiki/SetPedAimTarget + rotate the ped see also: https://web.archive.org/web/20130728213352/http://crystalmv.net84.net/pages/scripts/npc_hlc.php Thx 1 Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
Master_MTA Posted July 6, 2020 Author Posted July 6, 2020 11 hours ago, IIYAMA said: also i did it by another way and i would like to share it function getPositionBackOfElement(element, meters) if (not element or not isElement(element)) then return false end local meters = (type(meters) == "number" and meters) or 3 local posX, posY, posZ = getElementPosition(element) local _, _, rotation = getElementRotation(element) posX = posX + math.sin(math.rad(rotation)) * meters posY = posY - math.cos(math.rad(rotation)) * meters rot = rotation - math.cos(math.rad(rotation)) return posX, posY, posZ , rot end function isPlayerBehindPlayer( source,player ) local x,y,z = getElementPosition( source ) local x1,y1,z1 = getElementPosition( player ) local cx,cy,cz=getPositionBackOfElement(source, 500) local dist = getDistanceBetweenPoints3D( x,y,z,cx,cy,cz ) local dist1 = getDistanceBetweenPoints3D( x1,y1,z1,cx,cy,cz ) if dist1<dist then return true end return false end ++ https://wiki.multitheftauto.com/wiki/GetPedTarget ++ https://wiki.multitheftauto.com/wiki/OnPlayerWeaponFire ++ https://wiki.multitheftauto.com/wiki/KillPed and health functions and so on 1 Skype : 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001 every thing is gonna be alright every thing is gonna be okay it's gonna be a good good life that's what my therapist say
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