Origin based on where the player looks
How do I move the origin by 100.0 depending on where the player looks? I cannot add 100 to X or Y origin, because it may be 100 to his back or side.
|
Re: Origin based on where the player looks
did you even search before posting?
https://forums.alliedmods.net/showthread.php?t=93773 |
Re: Origin based on where the player looks
Yes I do, that code is not what I'm looking for though. I could have explained better.
I mean on ground - if the player's origin is x = 1000, y = 1000 and he's turned to the X axis, I need to get x = 1100 and y = 1000 origin. I don't know how to calculate it. Z axis cannot be taken in account. |
Re: Origin based on where the player looks
what if player is looking straight between x and y axis? (at 45 degrees angle)
|
Re: Origin based on where the player looks
1 Attachment(s)
His origin + 100 depending on the angle he's aiming at.
|
Re: Origin based on where the player looks
use the code in the link i gave you, just dont change z origin?
Code:
something like this |
Re: Origin based on where the player looks
No, it doesn't work the way I need at all.
|
Re: Origin based on where the player looks
how do you need it then lol? it does what the picture shows
|
Re: Origin based on where the player looks
get_user_origin(id, origin, mode=3)
Notes: Modes: 0 - current position. 1 - position from eyes (weapon aiming). 2 - end position from player position. 3 - end position from eyes (hit point for weapon). 4 - position of last bullet hit (only CS). That what you're looking for? granted, it won't be 100 units, but you could trim it down by using mode 1 and 3. Though this will raise your position a bit because its from the eyes, not the ground/feet. |
Re: Origin based on where the player looks
PHP Code:
|
| All times are GMT -4. The time now is 08:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.