Raised This Month: $ Target: $400
 0% 

Solved how to swap key assignments


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 12-30-2018 , 04:44   how to swap key assignments
Reply With Quote #1

I just tried to switch key assignments. For example, if player presses 'w', which means forward, he should go back, if player presses back, he should go forward.

code below has no effect

edit: game - csgo

PHP Code:



public Action OnPlayerRunCmd(int clientintbuttonsintimpulsefloat vel[3], float angles[3], intweaponintsubtypeintcmdnuminttickcountintseedint mouse[2])
{
    if(
buttons IN_FORWARD || buttons IN_BACK || buttons IN_MOVELEFT || buttons IN_MOVERIGHT)
    {
        if(
ValidPlayer(clienttrue))
        {
            if(
buttons IN_FORWARD)
            {
                
buttons^=IN_FORWARD;
                
buttons|=IN_BACK;
                return 
Plugin_Changed;
            }
            if(
buttons IN_BACK)
            {
                
buttons^=IN_BACK;
                
buttons|=IN_FORWARD;
                return 
Plugin_Changed;
            }
        }
    }
}

bool ValidPlayer(int clientbool checkforaliveness); 

Last edited by impossible_cc; 12-30-2018 at 04:56. Reason: game - csgo
impossible_cc is offline
Cruze
Veteran Member
Join Date: May 2017
Old 12-30-2018 , 04:51   Re: how to swap key assignments
Reply With Quote #2

You can take help from here or here
__________________
Taking paid private requests! Contact me

Last edited by Cruze; 12-30-2018 at 04:53.
Cruze is offline
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 12-30-2018 , 04:56   Re: how to swap key assignments
Reply With Quote #3

Quote:
Originally Posted by Cruze View Post
You can take help from here or here
Thank you.
impossible_cc 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 23:59.


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