Raised This Month: $32 Target: $400
 8% 

Way to block players mouse movement?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kam3n1tza
Member
Join Date: Jul 2011
Old 02-11-2015 , 17:16   Way to block players mouse movement?
Reply With Quote #1

How to block players mouse movement (left-right/up-down)?
For example:
Code:
#include <amxmodx>
#include <fakemeta>

public plugin_init()
{
    register_plugin("Block players mouse movement", "1.0", "blablabla")

    register_forward(FM_PlayerPreThink, "Fwd_PlayerPreThink")
}

public Fwd_PlayerPreThink(id)
{
    if(is_user_alive(id))
    {
        set_pev(id, pev_v_angle, Float:{0.0, 0.0, 0.0})
        set_pev(id, pev_fixangle, 1)
    }
}
With this code player can move his mouse left-right/up-down for a split second and she again returns to the center, but effect is like a vibration and it's ugly. I want fully immobilization.
Thanks.
kam3n1tza is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 02-11-2015 , 20:48   Re: Way to block players mouse movement?
Reply With Quote #2

I don't think it's possible
if it is, I'm also looking for a way to do this

the jittering is caused by the delay between client send mouse movement -> server process mouse movement -> server tell client to reset angles -> client receives command to reset angles

also to OP try my code, set_pev is fakemeta and is much slower, this still isn't perfect but it makes the player move much less than with set_pev
PHP Code:
        new Float:fAngles[3]
        
entity_get_vectoridEV_VEC_anglesfAngles )
        
fAngles[0]= 0.0 // pitch
            
fAngles[1]= 0.0 // yaw
            
fAngles[2]= 0.0 // roll
            
            
entity_set_vectoridEV_VEC_anglesfAngles )
            
entity_set_intidEV_INT_fixangle
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.

Last edited by aron9forever; 02-11-2015 at 20:49.
aron9forever is offline
kam3n1tza
Member
Join Date: Jul 2011
Old 02-12-2015 , 08:20   Re: Way to block players mouse movement?
Reply With Quote #3

Thank you now is better than before.
kam3n1tza 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 06:42.


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