Raised This Month: $ Target: $400
 0% 

Accurate bullet decals?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sekac
Senior Member
Join Date: Nov 2016
Old 05-10-2018 , 15:12   Accurate bullet decals?
Reply With Quote #1

I have tried editing this code to show the bullet decals where the bullet lands. Right now the bullet decals don't go where my crosshair is. I thought that decals displayed correctly server side, but I was wrong (I used cl_lw 0 to test that).

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>

public plugin_init() {
    
register_plugin("i aim good","0.11","Avalanche");
    
register_forward(FM_TraceLine,"fw_traceline");
}

public 
fw_traceline(Float:v1[3],Float:v2[3],noMonsters,id) {
    if(!
is_user_alive(id))
        return 
FMRES_IGNORED;
    
    
// get crosshair aim
    
new MyAim[3], Float:flMyAim[3];
    
get_user_origin(id,MyAim,3);
    
IVecFVec(MyAim,flMyAim);
    
    
// set crosshair aim
    
set_tr(TR_vecEndPos,flMyAim);
    
    
// get ent looking at
    
new entbody;
    
get_user_aiming(id,ent,body);
    
    
// if looking at something
    
if(is_valid_ent(ent)) {
        
set_tr(TR_flFraction,0.1); // 1.0 == no hit, < 1.0 == hit
        
set_tr(TR_pHit,ent); // entity hit
        
set_tr(TR_iHitgroup,body); // bodypart hit
    
}
    
    return 
FMRES_IGNORED;

sekac 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 04:38.


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