Raised This Month: $ Target: $400
 0% 

Finding near origins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 10-22-2009 , 08:23   Re: Finding near origins
Reply With Quote #1

What do you want to create at that origin?
Or what do you want to use that origin for?
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 10-22-2009 , 09:04   Re: Finding near origins
Reply With Quote #2

If you don't want to spawn a solid entity or something similiar:
PHP Code:
stock get_near_origin( const origin], distance )
{
     
origin] += random_num( -distancedistance );
     
origin] += random_num( -distancedistance );
     
origin] += random_num( -distancedistance );
     return 
origin;

SnoW is offline
Send a message via MSN to SnoW
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-22-2009 , 13:04   Re: Finding near origins
Reply With Quote #3

@SnoW
That won't work, since you cannot change the value of a constant variable.

Code:
GetNearOrigin( const Float:vCenter[ 3 ], const Float:fRadius, Float:vReturn[ 3 ] ) {     vReturn[ 0 ] = vCenter[ 0 ] + random_float( -fRadius, fRadius );     vReturn[ 1 ] = vCenter[ 1 ] + random_float( -fRadius, fRadius );     vReturn[ 2 ] = vCenter[ 1 ] + random_float( -fRadius, fRadius ); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 17:34.


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