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 client, int& buttons, int& impulse, float vel[3], float angles[3], int& weapon, int& subtype, int& cmdnum, int& tickcount, int& seed, int mouse[2])
{
if(buttons & IN_FORWARD || buttons & IN_BACK || buttons & IN_MOVELEFT || buttons & IN_MOVERIGHT)
{
if(ValidPlayer(client, true))
{
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 client, bool checkforaliveness);