Quote:
Originally Posted by Ibanezez
-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(client, IN_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, &impulse, Float:vel[3], Float:angles[3], &weapon)
{
for (new i = 0; i < MAX_BUTTONS; i++)
{
new button = (1 << i);
if ((buttons & button))
{
if (!(g_LastButtons[client] & button))
{
OnButtonPress(client, button);
}
}
else if ((g_LastButtons[client] & button))
{
OnButtonRelease(client, button);
}
}
g_LastButtons[client] = buttons;
return Plugin_Continue;
}
OnButtonPress(client, button)
{
if (button == IN_JUMP) SetEntityGravity(client, 0.5);
}
OnButtonRelease(client, button)
{
if (button == IN_JUMP) SetEntityGravity(client, 1.0);
}
__________________