Raised This Month: $ Target: $400
 0% 

Out of curiosity ...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mugwump
Senior Member
Join Date: May 2004
Old 09-01-2004 , 19:16   Out of curiosity ...
Reply With Quote #1

Is it possible to block a player's ability to duck or jump? Don't recall seeing examples so am wondering ...

-Mug
Mugwump is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 09-01-2004 , 19:18  
Reply With Quote #2

Maybe if you take off their two binds +jump and +duck , then you stop them from ever binding a command like that.
Peli is offline
Send a message via MSN to Peli
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-01-2004 , 19:25  
Reply With Quote #3

I have tried doing this some time ago with the old engine module, and ended up with only being able to see whether they hold a button down and stuff like that.
Anyway, like you probably know, duck and jump are handled client-side and the server only has a bit set in the pEdict->v.button integer.
Most (if not all) of the button handling seems to be done in CBasePlayer:reThink. So if you could hook PreThink and remove the jump and duck bits from the EV_INT_button integer (for example by doing button=button & ~(IN_JUMP | IN_CROUCH); ), you would be probably done. I don't know whether I haven't tried this (I only remember setting buttons before the actual Think function but not PreThink, but it is a pretty long time ago) or why i wasn't able to block the buttons - but I think it should be possible somehow.

Hope I have helped
__________________
hello, i am pm
PM is offline
Votorx
Senior Member
Join Date: Jun 2004
Old 09-01-2004 , 19:27  
Reply With Quote #4

Lol either that or every time they try rebinding just unbind it again.
__________________
Currently Looking for a mod team.
Votorx is offline
Send a message via AIM to Votorx Send a message via MSN to Votorx Send a message via Yahoo to Votorx
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-01-2004 , 20:23  
Reply With Quote #5

What about running a server_frame, test to see if they are pressing it, and run -jump or -duck each time they do?
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 09-02-2004 , 04:29  
Reply With Quote #6

Yes. With the new Fakemeta module this could indeed be possible, doing it the way PM explained.

Pseudo-plugin (might work, might not, might create overhead):


Code:
#include <amxmodx> #include <fakemeta> #include <engine> public forward_playerprethink(id) {     entity_set_int(id, EV_INT_button, entity_get_int(id, EV_INT_button) & ~(IN_JUMP | IN_DUCK)) } public plugin_init() {     register_plugin("No crouching tiger, no jumping dragon", "0.1", "GWB")     register_forward(FM_PlayerPreThink, "forward_playerprethink") }
Johnny got his gun is offline
Mugwump
Senior Member
Join Date: May 2004
Old 09-02-2004 , 16:50  
Reply With Quote #7

Thanks for the suggestions, great help in this thread!

One question though, I'm rusty on my bitwise operations, what would the inverse command be to restore the jump and duck abilities? I'm drawing a blank *sigh *

Thanks again!
-Mug
Mugwump is offline
Johnny got his gun
Veteran Member
Join Date: Jan 2004
Location: Tokyo
Old 09-02-2004 , 17:04  
Reply With Quote #8

I tried this. It didn't work as expected. I could only partly block ducking, but it's in another entity member (ev_int_binduck), and somehow I could crouch if I was in midair while pressing duck button.
These things are probably set somewhere else...
Johnny got his gun is offline
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 09-02-2004 , 17:06  
Reply With Quote #9

its proly checking if ur on ground and ducking
Freecode is offline
kalel
Senior Member
Join Date: Aug 2004
Old 09-02-2004 , 17:46  
Reply With Quote #10

the easyst way to do this would to install a exec mod so u can bind and unbind keys

wich u can find here http://forums.alliedmods.net/showthread.php?p=3313

then do this

bind del "amx_execall unbind ctrl" and that will unbind every one's ctrl key

this is also go for runing this coommand wich I do to every one on my server

"amx_execall cl_cmdrate 9999;amx_execall rate 9999;fsp_max 9999;say @@g Every One's Computers Have Been Tweeked For Best Game Play Results;amx_execall net_graph 1"
kalel 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 17:28.


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