Raised This Month: $ Target: $400
 0% 

Lower gravity for client when holding spacebar?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 11-08-2014 , 17:04   Re: Lower gravity for client when holding spacebar?
Reply With Quote #5

Quote:
Originally Posted by Ibanezez View Post
-snip-
You would need to include the rest of the code in there. And also, you aren't checking to see if the button they pressed is actually the jump button. Your code in your edited post is completely nonsensical.


PHP Code:
        {
            
OnButtonRelease(clientIN_JUMP);
            { 
what is this even


PHP Code:
#include <sdktools>
#define MAX_BUTTONS 26 //i believe that with the addition of +attack3, tf2 has 26 buttons now
new g_LastButtons[MAXPLAYERS+1];

public 
OnClientDisconnect_Post(client)
{
    
g_LastButtons[client] = 0;
}

public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
    for (new 
0MAX_BUTTONSi++)
    {
        new 
button = (<< i);
        
        if ((
buttons button))
        {
            if (!(
g_LastButtons[client] & button))
            {
                
OnButtonPress(clientbutton);
            }
        }
        else if ((
g_LastButtons[client] & button))
        {
            
OnButtonRelease(clientbutton);
        }
    }
    
    
g_LastButtons[client] = buttons;
    
    return 
Plugin_Continue;
}

OnButtonPress(clientbutton)
{
    if (
button == IN_JUMPSetEntityGravity(client0.5);
}

OnButtonRelease(clientbutton)
{
    if (
button == IN_JUMPSetEntityGravity(client1.0);

__________________

Last edited by ddhoward; 11-08-2014 at 17:21. Reason: two ='s for equivalency checks, 1 for assignment, duh
ddhoward is offline
 



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 05:03.


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