Weapon toss units
How can i get the distance from the player who dropped a deagle between the drop pont of the deagle? I think its simular to lj stats.
|
Re: Weapon toss units
This is how i did it.
PHP Code:
|
Re: Weapon toss units
And how can i do it with spray? From the ground to the middle of a spray. I tried to do something with impulse and decal, but no results.. <_<
|
Re: Weapon toss units
This might help: http://forums.alliedmods.net/showthread.php?p=58076
Basically, you hook the SVC_TEMPENTITY message, check for first param is it's TE_PLAYERDECAL (112), get the origin and calculate, easy. |
Re: Weapon toss units
Damnn.. 2 hard for me.. Can u make a sample? I think register_event("23", "newspray", "a", "1=112") is the main thing..
|
Re: Weapon toss units
Actally it's hooking the SVC_TEMPENTITY (wich is 23) message and first param as TE_PLAYERDECAL... wich is 112.
TE_PLAYERDECAL params from include/message_const.inc Code:
#define TE_PLAYERDECAL 112So... after knowing that I would do the following: PHP Code:
Note: not actually tested, but should work. |
Re: Weapon toss units
It says something about argument type mismatch (argument 1) @ register_event(SVC_TEMPENTITY, "player_spray", "a", "1=112")
|
Re: Weapon toss units
Yeah, SVC_TEMPENTITY is an int, not a string xD fixed and tested, works just fine.
|
Re: Weapon toss units
It shows 0.000 units all the time.. Works only if %d ...<_< I need %.3f :D
And yes.. i need to measure the distance not from player, but from ground. |
Re: Weapon toss units
Use get_distance_f then if you want float... the code I wrote works because I tested it... but detects distance from player to spray... you want from ground (walkable ground, not wall ?) to the entity ? I dunno, trace line or something... from the player's origin so that it doesn't collide with something else down the wall.
|
| All times are GMT -4. The time now is 07:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.