Raised This Month: $ Target: $400
 0% 

Solved [ H3LP ] Flip angle horizontally


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-30-2018 , 09:14   Re: [ H3LP ] Flip angle horizontally
Reply With Quote #3

So, basically what I'm doing is a lasermine. Based in lasermine angle, I will create a velocity vector by the mine aim (velocity_by_aim) and get the end origin in a distance of 9999. After some tests, I see that when I do this while the mine is placed in wall, it work, but if it is in the ground or in "roof" get the inverse direction than I want. Then if it is on the ground, laser will be generated in ground direction, if in roof, laser will be generated in roof direction. I hope you understand, but this was solved.

Code:
new Float:flVecStart[3], Float:flVecEnd[3], Float:flVecPlane[3], Float:flFraction; entity_get_vector(pPlayer, EV_VEC_origin, flVecStart); getAimOrigin(pPlayer, 65, flVecEnd); engfunc(EngFunc_TraceLine, flVecStart, flVecEnd, DONT_IGNORE_MONSTERS, pPlayer, 0); get_tr2(0, TR_flFraction, flFraction); new pHit = max(get_tr2(0, TR_pHit), 0); if (flFraction == 1.0 || pHit) {     zp_colored_print(pPlayer, "You can't set a lasermine at this location.");     return; } get_tr2(0, TR_vecEndPos, flVecEnd); get_tr2(0, TR_vecPlaneNormal, flVecPlane); vectorMulScalar(flVecPlane, 8.0, flVecPlane); // The mine origin vectorAdd(flVecEnd, flVecPlane, g_flVecAim[pPlayer]); // The mine angles vector_to_angle(flVecPlane, g_flVecAngles[pPlayer]); // The mine laser end point vectorMulScalar(flVecPlane, 9999.0, flVecPlane); vectorAdd(g_flVecAim[pPlayer], flVecPlane, g_flVecEnd[pPlayer]);
__________________









Last edited by CrazY.; 05-30-2018 at 09:16.
CrazY. is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode