Raised This Month: $ Target: $400
 0% 

[FIX] Fix negative Angle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 05-29-2012 , 05:14   [FIX] Fix negative Angle
Reply With Quote #1

This make negative yaw angle (-/minus) sometimes.
I want it to get and write the angle from 0 to 360 (maximum) instead of writing minus to angle/.
Code:
public MakeMonsterConfigFile(id) {     static Data[64]     static FilePath[64]     static iOrigin[3]     static Float:fAngles[3]     static szMapName[32]         get_mapname(szMapName, charsmax(szMapName))     format(FilePath, charsmax(FilePath), "/maps/%s_monster.cfg", szMapName)     get_user_origin(id, iOrigin)     pev(id, pev_v_angle, fAngles)     format(Data, charsmax(Data), "{^norigin/%d %d %d^ndelay/10000^nangle/%f", iOrigin[0], iOrigin[1], iOrigin[2], fAngles[1])     write_file(FilePath, Data, -1)         format(Data, charsmax(Data), "monster/%s^n}",g_szMonName)     write_file(FilePath, Data, -1)         set_hudmessage(75, 200, 200, -1.0, 0.86, 0, 6.0, 2.0, 0.1, 0.5, -1)     show_hudmessage(id,"Data successfully written to %s!", FilePath) }

Last edited by Rirre; 05-29-2012 at 05:52.
Rirre is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-29-2012 , 09:39   Re: [FIX] Fix negative Angle
Reply With Quote #2

Code:
pev(id, pev_v_angle, fAngles); if(fAngles[1] < 0.0) {     fAngles[1] += 360.0; } format(Data, charsmax(Data), "{^norigin/%d %d %d^ndelay/10000^nangle/%f", iOrigin[0], iOrigin[1], iOrigin[2], fAngles[1])
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 05-29-2012 at 09:39.
Exolent[jNr] is offline
Rirre
Veteran Member
Join Date: Nov 2006
Old 05-29-2012 , 12:05   Re: [FIX] Fix negative Angle
Reply With Quote #3

Thanks, works great
Rirre is offline
Reply



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 16:03.


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