Raised This Month: $12 Target: $400
 3% 

Solved mouse movement


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xwantcock
Junior Member
Join Date: Nov 2022
Old 11-25-2022 , 13:19   mouse movement
Reply With Quote #1

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.

Last edited by xwantcock; 11-26-2022 at 06:57.
xwantcock is offline
theqramboq
Junior Member
Join Date: Apr 2021
Old 11-26-2022 , 04:58   Re: mouse movement
Reply With Quote #2

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);
theqramboq is offline
xwantcock
Junior Member
Join Date: Nov 2022
Old 11-26-2022 , 06:56   Re: mouse movement
Reply With Quote #3

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);
	}
}
xwantcock is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-28-2022 , 15:14   Re: mouse movement
Reply With Quote #4

Quote:
Originally Posted by xwantcock View Post
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" );
MrPickles is offline
theqramboq
Junior Member
Join Date: Apr 2021
Old 11-29-2022 , 12:10   Re: mouse movement
Reply With Quote #5

Quote:
Originally Posted by MrPickles View Post
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
theqramboq is offline
kww
Senior Member
Join Date: Feb 2021
Location: Russia
Old 11-30-2022 , 11:43   Re: mouse movement
Reply With Quote #6

Who is character[id]?
__________________
Now working on: Side Weapons (Very lazy, tbh)
Avatar source: https://bit.ly/3BAk19g
Discord: kww#9951
kww is offline
theqramboq
Junior Member
Join Date: Apr 2021
Old 11-30-2022 , 12:11   Re: mouse movement
Reply With Quote #7

this code is missing
theqramboq is offline
Reply


Thread Tools
Display Modes

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 12:30.


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