Kenix Posted June 11, 2014 Posted June 11, 2014 Hi guys. I need help, i want to know if player got stuck in the wall or other building and player can't fire weapon. How can i check this more quality? P.S 1) Check player's "Task" doesn't help. 2) processLineOfSight/isLineOfSightClear is solution, but we need to know where we need to start this line if we need more quality. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Den. Posted June 12, 2014 Posted June 12, 2014 I have no idea if this will work, and it's not related to processLineOfSight but maybe you can extend it to make it work: addEventHandler("onClientRender", root, function() if getPedWeapon(localPlayer) then --He has a weapon local sx, sy, sz = getPedTargetStart(localPlayer) -- local tx, ty, tz = getPedTargetCollision(localPlayer) --Can be replaced by getPedWeaponMuzzlePosition if it doesn't work. if sx and tx then local dist = getDistanceBetweenPoints3D(sx, sy, sz, tx, ty, tz) if dist < 1.5 then --Blocked by a close object. You need to figure out the distance here. --BLOCKED. end end end end)
Kenix Posted June 12, 2014 Author Posted June 12, 2014 Thanks for help! Good idea. I'll test it soon. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
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