AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   punchangle (for recoil) (https://forums.alliedmods.net/showthread.php?t=26330)

v3x 03-31-2006 08:08

punchangle (for recoil)
 
Is there a way to make it so the crosshair doesn't jump up and down when shooting? It's annoying :(

Code:
entity_set_vector(id , EV_VEC_punchangle , Float:{0.0,0.0,0.0});

I thought that by putting it in prethink would fix it, but it didn't.

Thanks.

Hawk552 03-31-2006 08:10

Look at this:

Code:
#include <amxmodx> #include <fakemeta> #include <engine> public plugin_init() {     register_plugin("No Recoil", "0.1", "Knekter");     register_cvar("mp_norecoil", "1");     register_forward(FM_TraceLine, "forward_traceline", 1); } public client_PreThink(id) {     if(!get_cvar_num("mp_norecoil"))         return PLUGIN_CONTINUE;     if(get_user_button(id) & IN_ATTACK)         entity_set_vector(id, EV_VEC_punchangle, Float:{0.0, 0.0, 0.0});     return PLUGIN_CONTINUE; } public forward_traceline(Float:v1[3], Float:v2[3], noMonsters, id) {     if(!get_cvar_num("mp_norecoil") || !is_user_connected(id) || !is_user_alive(id))         return FMRES_IGNORED;     new hit[3], Float:fHit[3];     get_user_origin(id, hit, 4);     IVecFVec(hit, fHit);     set_tr(TR_vecEndPos, fHit);     return FMRES_IGNORED; }

v3x 03-31-2006 08:13

Oh, doh. I forgot about that plugin. I think I even approved it myself :P

Thanks Hawk, I'll try that.


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

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