Raised This Month: $75 Target: $400
 18% 

How can I check that?


Post New Thread Reply   
 
Thread Tools Display Modes
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 06-24-2019 , 06:41   Re: How can I check that?
Reply With Quote #11

182 / 15 is 12, it's integer division.
What you are currently doing is quite ugly.
__________________

Last edited by KliPPy; 06-24-2019 at 06:44.
KliPPy is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 06-24-2019 , 15:18   Re: How can I check that?
Reply With Quote #12

I know, but I can't see how I can use your example.
__________________
• BattleRoyale Mod
• Public PugMod
• Furien Mod

-

Currently working on Thanos vs. Avengers: 15%
EFFx is offline
Send a message via Skype™ to EFFx
KliPPy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 07-01-2019 , 06:05   Re: How can I check that?
Reply With Quote #13

What should the actual output of your code be? Then I may be able to tell you how to exactly use this thing.
__________________
KliPPy is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-01-2019 , 17:58   Re: How can I check that?
Reply With Quote #14

EFFx, why not do this:
PHP Code:
#define GetAngle2(%1,%2)    (%1 + ( %2 * 15 ))

//or

GetAngleiAngle iIndex )
{
    return 
iAngle + ( iIndex 15 );

__________________
Bugsy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-01-2019 , 23:03   Re: How can I check that?
Reply With Quote #15

I'm not really sure what you actually ended up with (the last post that said "this is how I'm doing it" doesn't actually show your solution). Anyways, I wrote a version for fun:

Code:
stock GetCompassString(Float:fAngle, count, szString[], len)
{
	static szCompassStrings[24][4] = {"N", "15", "30", "NE", "60", "75", "E", "105", "120", "SE", "150", "165", "S", "195", "210", "SW", "240", "255", "W", "285", "300", "NW", "330", "345"}
	
	new iCenterIndex = floatround(fAngle / 15.0) % sizeof szCompassStrings
	
	new iStart = iCenterIndex - count / 2
	new iStop = iStart + count
	new curlen = 0, iIndex
	
	for( new i = iStart; i < iStop; i++ )
	{
		iIndex = (i < 0 ? i + sizeof szCompassStrings : i) % sizeof szCompassStrings
		
		if( curlen <= len )
		{
			curlen += formatex(szString[curlen], len - curlen, " %s", szCompassStrings[iIndex])
		}
	}
	trim(szString)
}
__________________
fysiks is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 07-02-2019 , 09:38   Re: How can I check that?
Reply With Quote #16

Quote:
Originally Posted by KliPPy View Post
What should the actual output of your code be? Then I may be able to tell you how to exactly use this thing.
The main idea is making a 3D compass, I did it by using Bugsy's stock to get the closest direction for the angle I'm currently looking at LIKE THIS

@Bugsy,

What would be the iIndex?

@fysiks,

It works... thank you
__________________
• BattleRoyale Mod
• Public PugMod
• Furien Mod

-

Currently working on Thanos vs. Avengers: 15%

Last edited by EFFx; 07-02-2019 at 20:23.
EFFx is offline
Send a message via Skype™ to EFFx
Reply


Thread Tools
Display Modes

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 09:52.


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