Raised This Month: $ Target: $400
 0% 

reverse keys


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-09-2007 , 03:00   reverse keys
Reply With Quote #1

ok i have this code in the forwarded prethink:
Code:
public fm_PreThink(id) {     if(gbReverseKeys[id])     {         static button, oldbuttons;         button = pev(id, pev_button);         oldbuttons = pev(id, pev_oldbuttons);         if(button & IN_MOVELEFT && !(oldbuttons & IN_MOVELEFT))         {             set_pev(id, pev_button, (button & ~IN_MOVELEFT) | IN_MOVERIGHT);         }         else if(button & IN_MOVERIGHT && !(oldbuttons & IN_MOVERIGHT))         {             set_pev(id, pev_button, (button & ~IN_MOVERIGHT) | IN_MOVELEFT);         }         if(button & IN_FORWARD && !(oldbuttons & IN_FORWARD))         {             set_pev(id, pev_button, (button & ~IN_FORWARD) | IN_BACK);         }         else if(button & IN_BACK && !(oldbuttons & IN_BACK))         {             set_pev(id, pev_button, (button & ~IN_BACK) | IN_FORWARD);         }     } }


except it just doesnt work.

any ideas?

EDIT: i also have same code, but with IN_JUMP, just to block it and not do anything else, but u can still jump.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-09-2007 , 05:17   Re: reverse keys
Reply With Quote #2

Try this (and the same for the others) :

Code:
set_pev( id, pev_button, ( button & ( ~IN_MOVELEFT | IN_MOVERIGHT ) ) )
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-09-2007 , 12:43   Re: reverse keys
Reply With Quote #3

any other ideas?

also this doesnt work:
Code:
new button = pev(id, pev_button); if(button & IN_JUMP) {    set_pev(id, pev_button, (button & ~IN_JUMP)); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-09-2007 , 13:42   Re: reverse keys
Reply With Quote #4

Code:
new button = pev(id, pev_button);
if(button & IN_JUMP)
{
 button = button & ~IN_JUMP;
 set_pev(id, pev_button, button);
}
This should work!
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-09-2007 , 13:43   Re: reverse keys
Reply With Quote #5

-edit- : alka was too fast for me

Try this :

Code:
new button = pev(id, pev_button); if(button & IN_JUMP) {     button &= ~IN_JUMP     set_pev(id, pev_button, button); }
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-09-2007 , 15:02   Re: reverse keys
Reply With Quote #6

doing it that way doesnt work either...

is there something im doing wrong? =\
__________________
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 16:14.


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