Raised This Month: $ Target: $400
 0% 

Set origin within a range


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 07-20-2011 , 17:09   Set origin within a range
Reply With Quote #1

What can I use, to set the origin of the player within a range/radius of 100 on the ground.

PHP Code:
            new origin[3]
            
get_user_origin(tempidorigin)
            
            
set_user_origin(idorigin
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-20-2011 , 17:19   Re: Set origin within a range
Reply With Quote #2

You mean randomly in a 100 unit radius?
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
bibu
Veteran Member
Join Date: Sep 2010
Old 07-20-2011 , 17:20   Re: Set origin within a range
Reply With Quote #3

Just around yes, so it won't be in the exact same of the origin cause of stuck possibilities. The range could go up to 200 I think.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-20-2011 , 17:21   Re: Set origin within a range
Reply With Quote #4

Well, you could use the exact same origin and then have a plugin to prevent stuck
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
bibu
Veteran Member
Join Date: Sep 2010
Old 07-20-2011 , 17:22   Re: Set origin within a range
Reply With Quote #5

Well not just cause of stuck, will do that for sure. Just I want to manipulate the origin abit.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-20-2011 , 18:59   Re: Set origin within a range
Reply With Quote #6

Code:
new random_origin[3] random_origin[0] = random(100) random_origin[1] = origin[1] + random(sqroot(10000 - (random_origin[0] * random_origin[0]))) random_origin[0] += (random(2) ? origin[0] : -origin[0]) random_origin[2] = origin[2]

That will generate a random origin within a 100 radius, only taking into account a horizontal radius.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 07-21-2011 at 09:07.
Exolent[jNr] is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-21-2011 , 00:55   Re: Set origin within a range
Reply With Quote #7

Quote:
Error: Undefined symbol "sqrt".
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-21-2011 , 00:58   Re: Set origin within a range
Reply With Quote #8

Could you really not search and find the square root function yourself?

http://www.amxmodx.org/funcwiki.php?go=func&id=75
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-21-2011 , 09:07   Re: Set origin within a range
Reply With Quote #9

Quote:
Originally Posted by bibu View Post
Error: Undefined symbol "sqrt".
Fixed code.

Quote:
Originally Posted by nikhilgupta345 View Post
Could you really not search and find the square root function yourself?

http://www.amxmodx.org/funcwiki.php?go=func&id=75
Not the float one.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-27-2011 , 06:56   Re: Set origin within a range
Reply With Quote #10

Still it doesn't change the origin at all.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
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 00:57.


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