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

about get_user_button


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arvy
Member
Join Date: Oct 2007
Old 04-13-2008 , 07:24   about get_user_button
Reply With Quote #1

Quote:
public client_PreThink(id)
{
if (get_user_button(id) & IN_FORWARD )
{
client_cmd(id, "bind w +back")
}
}
it worked, but i can't stop "+back" until putin the command "-back" in console

so how should i do ? thank you .
Arvy is offline
Old 04-13-2008, 07:43
atomen
This message has been deleted by atomen.
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-13-2008 , 07:47   Re: about get_user_button
Reply With Quote #2

How do you know players use 'w' key to go forward ?
Some uses uparrow, i personally use 'e' ...

Binding users keys is just silly.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
atomen
Veteran Member
Join Date: Oct 2006
Location: Stockholm, Sweden
Old 04-13-2008 , 07:48   Re: about get_user_button
Reply With Quote #3

Offtopic :

Do you play with e,s,d,f O.o ?
__________________
atomen is offline
Send a message via MSN to atomen
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-13-2008 , 07:51   Re: about get_user_button
Reply With Quote #4

Yes, so i have more avaible keys at the left.

@Arvy

You could do when IN_FORWARD :

client_cmd(id, "+back; -forward")

And inverse for IN_BACK
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 04-13-2008 , 07:56   Re: about get_user_button
Reply With Quote #5

Sending client_cmd() in client_PreThink() is not a good idea. Use set_entity_int() to remove the IN_FORWARD flag from EV_INT_button.
Lee is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-13-2008 , 08:09   Re: about get_user_button
Reply With Quote #6

Quote:
Originally Posted by Lee View Post
Sending client_cmd() in client_PreThink() is not a good idea. Use set_entity_int() to remove the IN_FORWARD flag from EV_INT_button.
This just doesn't work, sadly.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Arvy
Member
Join Date: Oct 2007
Old 04-13-2008 , 09:56   Re: about get_user_button
Reply With Quote #7

but Most people use "w" "+forward", i just want to punish the cheater !

Quote:
client_cmd(id, "+back; -forward")
i think it may work , thank you ! +Karma
Arvy is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 04-13-2008 , 10:51   Re: about get_user_button
Reply With Quote #8

I just assumed. Oh well.

What is the objective here? To stop a player dead or to invert his controls?
Lee is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-13-2008 , 14:24   Re: about get_user_button
Reply With Quote #9

Quote:
Originally Posted by Lee View Post
to invert his controls?
I was planing to write something like that, just gave up as the client_cmd is a poor way to do it.
Set his hp to 256 is quite a good alternative
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-13-2008 , 15:29   Re: about get_user_button
Reply With Quote #10

Quote:
Originally Posted by connorr View Post
I was planing to write something like that
! I wanna see cause I've failed at it -.-
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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:17.


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