Raised This Month: $51 Target: $400
 12% 

Distance from drop point to dropped weapon point


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Unkolix
Veteran Member
Join Date: Sep 2012
Old 09-12-2014 , 10:18   Distance from drop point to dropped weapon point
Reply With Quote #1

Hello. I know that I can block weapon drop with this event:
PHP Code:
RegisterHam(Ham_CS_Item_CanDrop"weapon_deagle""StopDrop"
But I wonder is there any way to calculate the distance from player drop point, to the dropped weapon.

Any ways, suggestions, examples?
Unkolix is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 09-12-2014 , 10:26   Re: Distance from drop point to dropped weapon point
Reply With Quote #2

ofc
hook the weapon dropping and save the player's origin, then after a couple of seconds search for the wep entity and get it's origins.
then it's basic math
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Unkolix
Veteran Member
Join Date: Sep 2012
Old 09-12-2014 , 10:41   Re: Distance from drop point to dropped weapon point
Reply With Quote #3

Quote:
Originally Posted by aron9forever View Post
ofc
hook the weapon dropping and save the player's origin, then after a couple of seconds search for the wep entity and get it's origins.
then it's basic math
Thanks. Won't it bug with other near by dropped weapons? (F.e. Deagle)
Unkolix is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 09-12-2014 , 10:47   Re: Distance from drop point to dropped weapon point
Reply With Quote #4

Quote:
Originally Posted by Unkolix View Post
Thanks. Won't it bug with other near by dropped weapons? (F.e. Deagle)
you need to register everything properly to be sure that the entity you get the origin of is the one dropped by the player
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-12-2014 , 13:47   Re: Distance from drop point to dropped weapon point
Reply With Quote #5

Quote:
Originally Posted by Unkolix View Post
Thanks. Won't it bug with other near by dropped weapons? (F.e. Deagle)
Set to it a custom info( in pev_iuser1 or whatever ) and check this when you search for your entity, so you can know if this is the weapon that you want.
__________________

Last edited by HamletEagle; 09-12-2014 at 13:48.
HamletEagle is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 09-12-2014 , 17:22   Re: Distance from drop point to dropped weapon point
Reply With Quote #6

You probably can use TraceToss. Not sure though.

https://forums.alliedmods.net/showpo...&postcount=138
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu 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 15:57.


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