AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to mouse movement left and right (https://forums.alliedmods.net/showthread.php?t=298832)

gcz 06-23-2017 16:39

how to mouse movement left and right
 
lock up and down and move left and right ?


Code:

#include < amxmodx >
#include < engine >

#define VERSION "0.0.1"

static bool:g_bHasAngleLock[ 33 ];
static Float:g_flLockedAngles[ 33 ][ 3 ];

public plugin_init()
{
    register_plugin( "LOCK TEH ANGLEZ", VERSION,"Juice" );
    register_clcmd( "say /lock", "ClientCommand_Lock" );
}

public client_putinserver( id )   
{
    g_bHasAngleLock[ id ] = false;
    g_flLockedAngles[ id ][ 0 ] = g_flLockedAngles[ id ][ 1 ] = g_flLockedAngles[ id ][ 2 ] = 0.0;
}

public client_disconnect( id )
{   
    g_bHasAngleLock[ id ] = false;
    g_flLockedAngles[ id ][ 0 ] = g_flLockedAngles[ id ][ 1 ] = g_flLockedAngles[ id ][ 2 ] = 0.0;
}

public ClientCommand_Lock( id )
{
    g_bHasAngleLock[ id ] = !g_bHasAngleLock[ id ];
    entity_get_vector( id, EV_VEC_v_angle, g_flLockedAngles[ id ] );
}

public client_PreThink( id )
{
    if( is_user_alive( id ) && g_bHasAngleLock[ id ] )
    {
        entity_set_vector( id, EV_VEC_angles, g_flLockedAngles[ id ] );
        entity_set_int( id, EV_INT_fixangle, 1 );
    }
}


eyal282 06-25-2017 02:12

Re: how to mouse movement left and right
 
You are getting v_angle but set angles.

gcz 06-25-2017 15:09

Re: how to mouse movement left and right
 
:D i will try to fix this code , thank you

g_flLockedAngles[ id ][ 0 ] = 0.0; // x
entity_set_vector( id, EV_VEC_angles, g_flLockedAngles[ id ] ); // pev_angles


All times are GMT -4. The time now is 23:10.

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