View Single Post
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 online now