AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved mouse movement (https://forums.alliedmods.net/showthread.php?t=340573)

xwantcock 11-25-2022 13:19

mouse movement
 
Firstly Hello everyone and sorry for bad english. I'm really a beginner
i need help with this.

I want I can look around freely when I move the mouse(maybe this code "pev_v_angle"). I don't want the player's angle to change when I move the mouse. I mean crosshair move, not the angle of the player

Is it possible to do what I said above? if possible how to do it? give an example reference.

theqramboq 11-26-2022 04:58

Re: mouse movement
 
Code:

                new Float:flAngle[3];
                entity_get_vector(character[id], EV_VEC_v_angle, flAngle);

                flAngle[1] += 180;
                if( flAngle[1] > 360.0 )
                {
                flAngle[1] -= 360.0;
                }

                entity_set_vector(character[id], EV_VEC_v_angle, Float:{0.0,0.0,0.0});
                entity_set_vector(character[id], EV_VEC_angles, flAngle);
                entity_set_int(character[id], EV_INT_fixangle, 1);


xwantcock 11-26-2022 06:56

Re: mouse movement
 
I FIXED GUYS

Code:

public plugin_init()
{
        register_forward(FM_PlayerPostThink, "fw_PlayerPostThink", 1);
       
}


public fw_PlayerPostThink(id)
{
        if (!is_user_alive(character[id]))
                return
       
       
        if (g_unable2move[character[id]])
        {
        new Float:VecAngles2[3];
        entity_get_vector(character2[id],EV_VEC_angles,VecAngles2)               


        entity_set_vector(character[id],EV_VEC_angles,VecAngles2);
        }
}


MrPickles 11-28-2022 15:14

Re: mouse movement
 
Quote:

Originally Posted by xwantcock (Post 2793744)
I FIXED GUYS

Code:

public plugin_init()
{
        register_forward(FM_PlayerPostThink, "fw_PlayerPostThink", 1);
       
}


public fw_PlayerPostThink(id)
{
        if (!is_user_alive(character[id]))
                return
       
       
        if (g_unable2move[character[id]])
        {
        new Float:VecAngles2[3];
        entity_get_vector(character2[id],EV_VEC_angles,VecAngles2)               


        entity_set_vector(character[id],EV_VEC_angles,VecAngles2);
        }
}


its more efficient to use client_cmd( id, "+strafe" ); and to return normal client_cmd( id, "-strafe" );

theqramboq 11-29-2022 12:10

Re: mouse movement
 
Quote:

Originally Posted by MrPickles (Post 2793936)
its more efficient to use client_cmd( id, "+strafe" ); and to return normal client_cmd( id, "-strafe" );

but this code is blocking mouse movement. nothing like this was requested

kww 11-30-2022 11:43

Re: mouse movement
 
Who is character[id]?

theqramboq 11-30-2022 12:11

Re: mouse movement
 
this code is missing


All times are GMT -4. The time now is 08:53.

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