Raised This Month: $170 Target: $400
 42% 

buttons - IN_SPEED to IN_FORWARD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Qes
AlliedModders Donor
Join Date: Jul 2014
Old 06-11-2018 , 12:55   buttons - IN_SPEED to IN_FORWARD
Reply With Quote #1

Hello,
How I can change button IN_SPEED to IN_FORWARD?
When player use IN_SPEED I change it button to IN_FORWARD
Qes is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 06-11-2018 , 14:44   Re: buttons - IN_SPEED to IN_FORWARD
Reply With Quote #2

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;

__________________
free software
coding

Last edited by shanapu; 06-11-2018 at 14:45. Reason: typo
shanapu is offline
Facksy
Senior Member
Join Date: Apr 2017
Location: here
Old 06-11-2018 , 17:51   Re: buttons - IN_SPEED to IN_FORWARD
Reply With Quote #3

Quote:
Originally Posted by shanapu View Post
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 "&= ~ |="
__________________
HereMy Steam
Facksy is online now
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 06-11-2018 , 18:39   Re: buttons - IN_SPEED to IN_FORWARD
Reply With Quote #4

Quote:
Originally Posted by Facksy View Post
Can you explain me what do these symbols? The "&= ~ |="
https://forums.alliedmods.net/showthread.php?t=139916
__________________
ddhoward is offline
hmmmmm
Senior Member
Join Date: Mar 2017
Location: ...
Old 06-11-2018 , 21:01   Re: buttons - IN_SPEED to IN_FORWARD
Reply With Quote #5

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;
    }

hmmmmm is offline
Qes
AlliedModders Donor
Join Date: Jul 2014
Old 06-12-2018 , 10:05   Re: buttons - IN_SPEED to IN_FORWARD
Reply With Quote #6

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: /
Qes is offline
Reply


Thread Tools
Display Modes

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 14:45.


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