AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Origin of barrel's end (https://forums.alliedmods.net/showthread.php?t=240380)

ezio_auditore 05-14-2014 06:15

Origin of barrel's end
 
How can I get the origin of the end of a gun's end.

swapped 05-14-2014 06:36

Re: Origin of barrel's end
 
PHP Code:

get_user_originindexorigin[3], mode 


Code:

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). 


ezio_auditore 05-14-2014 06:46

Re: Origin of barrel's end
 
ok thanks..

.Dare Devil. 05-15-2014 16:51

Re: Origin of barrel's end
 
Quote:

Originally Posted by swapped (Post 2137544)
PHP Code:

get_user_originindexorigin[3], mode 


Code:

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). 


I dont trust that at all.
For me it was giving false origins.

Instead i use this:
PHP Code:

RegisterHam(Ham_TraceAttack"worldspawn""traceattack")
public 
traceattack(victimattackerFloat:damageFloat:direction[3], trdamage_type)
{
    static 
Float:origin[3]
    
get_tr2(trTR_vecEndPosorigin)


If you want to use your last bullet origin in somewhere else at ohter time then just do:
PHP Code:

new Float:lastbullet_origin[id][3]
public 
traceattack(victimattackerFloat:damageFloat:direction[3], trdamage_type)
{
    
get_tr2(trTR_vecEndPoslastbullet_origin[attacker])




All times are GMT -4. The time now is 09:44.

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