Raised This Month: $ Target: $400
 0% 

Blocking all user input


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 09-13-2007 , 08:17   Blocking all user input
Reply With Quote #1

How much am I going to need to hook if I want to basically block all user input.

What it needs to block:
All movement ( jump, duck and walking/running )
Change weapons
Firing ( hopefully sorted - found a thread on the subject)

[I'll want to allow a few commands (say/name), but I can probably filter these myself ]

And I'm hoping to be able to fake all of this too.

The end result would be to have players controllable by another player.

I don't need code for how to do this, just the commands I'm looking at hooking - I should be able to pick up most of the rest.
Though naturally if there are threads about blocking/faking any of this it would be handy.
purple_pixie is offline
Lord_Destros
Veteran Member
Join Date: Jul 2004
Location: With stupid.
Old 09-14-2007 , 00:40   Re: Blocking all user input
Reply With Quote #2

http://forums.alliedmods.net/showthr...ighlight=block

Quote:
Originally Posted by hlsdk_const.inc
// pev(entity, pev_button) or pev(entity, pev_oldbuttons) values
#define IN_ATTACK (1<<0)
#define IN_JUMP (1<<1)
#define IN_DUCK (1<<2)
#define IN_FORWARD (1<<3)
#define IN_BACK (1<<4)
#define IN_USE (1<<5)
#define IN_CANCEL (1<<6)
#define IN_LEFT (1<<7)
#define IN_RIGHT (1<<
#define IN_MOVELEFT (1<<9)
#define IN_MOVERIGHT (1<<10)
#define IN_ATTACK2 (1<<11)
#define IN_RUN (1<<12)
#define IN_RELOAD (1<<13)
#define IN_ALT1 (1<<14)
#define IN_SCORE (1<<15) // Used by client.dll for when scoreboard is held down
__________________
Quote:
Originally Posted by Twilight Suzuka
Don't worry m'lord. The turtles day will come.
Lord_Destros is offline
Send a message via AIM to Lord_Destros
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 09-14-2007 , 04:02   Re: Blocking all user input
Reply With Quote #3

Yeah, I found that one.
Blocking buttons is all well and good, but they can still move (albeit slowly)

I might just have to play around a lot.

Thans, though.
purple_pixie is offline
potatis_invalido
BANNED
Join Date: Jul 2007
Location: 0 (world)
Old 09-14-2007 , 07:37   Re: Blocking all user input
Reply With Quote #4

Try to set the max speed of a player to 0.
potatis_invalido is offline
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 09-14-2007 , 08:04   Re: Blocking all user input
Reply With Quote #5

cl_forwardspeed?

Or is there a serverside player maxspeed?

And the real bitch is that I don't actually want to stop them moving.
I just want them to completely ignore what the user is pressing.
The player needs to move when told to ... but I can do that by popping up maxspeed when the controlling player tells them to move, I suppose.

Why do I feel this is going to be hard ... ah, well - what better way to learn than projects way outside your experience :-D
purple_pixie is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 09-14-2007 , 08:19   Re: Blocking all user input
Reply With Quote #6

If you block the buttons, it will not move "a little bit." It will not move at all. Search the forums for IN_FORWARD and such and you'll find loads of scripting help threads were we help people with that.

Also, check out jedi_force_grab. That plugin sets a user's velocity to where you are aiming, and no matter what that user does movement wise, he moves to that velocity. He will still look like he is running, animation wise, but that could be blocked too.

As far as firing, yeah, like you said that's easy you got that done.

Changing weapons is a bit more difficult because you cannot block commands like slot2, nextinv, lastinv, etc. As well as when you drop a weapon you pull another out.

What I would reccomend is to alter the pev_weapons variable and only give it the weapon he currently has out. Also block the drop command so he can't do what I just said. If there are still ways he can switch weapons after that (test it a lot), hook CurWeapon and switch him back.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 09-14-2007 , 08:30   Re: Blocking all user input
Reply With Quote #7

Spot the legend :-D

And I tried doing:
set_pev(id,pev_buttons,0)

Which I'm pretty sure would remove all buttons, in the player prethink ... where should it be done?

Anyways, thanks for the reply - I'll have another search around for the button constants, try to find these threads you speak of.
purple_pixie 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 22:56.


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