View Full Version : Add Noise to trace_line/origin
solidsnake
09-18-2006, 09:06
Dears friends !
I'm trying to create a gun, but it is too precise !
There is a way to add noise on a target origin ?
Please not that i use punchangle for HUD, it work but not change trace_line/get_user_origin precision : hit always on the same point.
Thanks ! :mrgreen:
diamond-optic
09-18-2006, 09:12
umm maybe like add a random number to the target origin..
like targetOrigin[0] += random_num(-5,5)
etc...
solidsnake
09-18-2006, 09:50
I've already tried this, without success : because X,Y,Z must be updated with the current player view angle on the map :mrgreen:
^^
hmrsmpsn
09-18-2006, 10:10
if (playerorigin[0] - shotorigin[0] < 0)
or something like that i dunno ive useid though
You shouldn't really make it random, you have to code your own system. For example trajectory should depend on player's velocity, bullet number, shot delay and so on.
solidsnake
05-28-2007, 08:08
Ok VEN, but how does it work when a player isn't moving ?
Best regards.
I think you should look into HLSDK for examples.
vBulletin® v3.8.7, Copyright ©2000-2024, vBulletin Solutions, Inc.