AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   buttons - IN_SPEED to IN_FORWARD (https://forums.alliedmods.net/showthread.php?t=308224)

Qes 06-11-2018 12:55

buttons - IN_SPEED to IN_FORWARD
 
Hello,
How I can change button IN_SPEED to IN_FORWARD?
When player use IN_SPEED I change it button to IN_FORWARD

shanapu 06-11-2018 14:44

Re: buttons - IN_SPEED to IN_FORWARD
 
something like
PHP Code:

public Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat vel[3], float angles[3], int &weapon
{

    if (
buttons IN_SPEED)
    {
        
buttons &= ~IN_SPEED;
        
buttons |= IN_FORWARD;
    }

    return 
Plugin_Changed;



Facksy 06-11-2018 17:51

Re: buttons - IN_SPEED to IN_FORWARD
 
Quote:

Originally Posted by shanapu (Post 2596424)
something like
PHP Code:

public Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat vel[3], float angles[3], int &weapon
{

    if (
buttons IN_SPEED)
    {
        
buttons &= ~IN_SPEED;
        
buttons |= IN_FORWARD;
    }

    return 
Plugin_Changed;



Can you explain me what do these symbols? The "&= ~ |="

ddhoward 06-11-2018 18:39

Re: buttons - IN_SPEED to IN_FORWARD
 
Quote:

Originally Posted by Facksy (Post 2596442)
Can you explain me what do these symbols? The "&= ~ |="

https://forums.alliedmods.net/showthread.php?t=139916

hmmmmm 06-11-2018 21:01

Re: buttons - IN_SPEED to IN_FORWARD
 
If what you're trying to do is make the player move forward when they have IN_SPEED, this won't work. Changing the buttons doesn't actually cause motion. You'll need to change the forward vel passed in to OnPlayerRunCmd.

Something like this:
PHP Code:

public Action OnPlayerRunCmd(int clientint &buttonsint &impulsefloat vel[3], float angles[3], int &weapon)  


    if (
buttons IN_SPEED
    {
        
vel[0] = 450.0;
    }



Qes 06-12-2018 10:05

Re: buttons - IN_SPEED to IN_FORWARD
 
My code checking button player.I want to add on IN_SPEED (Shift) higher speed, but IN_SPEED is silent steps and i want to block IN_SPEED or change button when player use IN_SPEED.

I once did something like that, but I lost this code and now I can not reproduce it: /


All times are GMT -4. The time now is 00:00.

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