[FilterScript] HighJump
#1

Hey guys. I was REALLY bored, so I made this quick FS that might end up helping a lot of people. It's a FS that makes all the players jump higher, kinda like the superjump cheat on SP. On this FS you will not lose health with the fall of the jump (actually you will, but what ever you lost will be added again after landing).

pawn Code:
#include <a_samp>

new Float:FirstHealth[MAX_PLAYERS];
new Float:LastHealth[MAX_PLAYERS];
new IsJumping[MAX_PLAYERS];

forward JumpTimer(playerid);

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" High Jump by marinov");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    IsJumping[playerid] = 0;
    return 1;
}

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys == KEY_JUMP && oldkeys == KEY_JUMP)&&(IsJumping[playerid] == 0))
    {
        IsJumping[playerid] = 1;
        GetPlayerHealth(playerid, FirstHealth[playerid]);
        SetPlayerVelocity(playerid,0.0,0.0,0.5); //Forces the player to jump high
        SetTimerEx("JumpTimer", 5000, 0, "i", playerid);
    }
    return 1;
}

public JumpTimer(playerid)
{
    GetPlayerHealth(playerid, LastHealth[playerid]);
    new Float:Math;
    Math = LastHealth[playerid] - FirstHealth[playerid];
    if(IsJumping[playerid] == 1)
    {
        if(LastHealth[playerid] < FirstHealth[playerid])
        {
            new Float:Health;
            GetPlayerHealth(playerid, Health);
            SetPlayerHealth(playerid, Health + Math);
            IsJumping[playerid] = 0;
        }
    }
    return 1;
}
Please test and let me know if there's any problem.
Reply
#2

Nice! I will test it
Reply
#3

I'll try it maybe a video. People here are stubborn mules who wont take the time to test something...
Reply
#4

Nice work
Reply
#5

Good script will be using it maybe.
Reply
#6

Umm, quick question. The JUMP_KEY is SHIFT for me, when I press it, it jumps regular. How may I go about fixing this?
Reply
#7

What if you jump and you die before the timer sets you health back? An improvement would be to set a player's health to 999999 when he jumps and back to 100 when he lands.
Reply
#8

Use Player Variable next time.
Reply
#9

Quote:
Originally Posted by Sinner
View Post
What if you jump and you die before the timer sets you health back? An improvement would be to set a player's health to 999999 when he jumps and back to 100 when he lands.
No because what if he had a 50 hp ? this is not the most precise way to do it, but it's not bad for how easy it was and how good it works.
Reply
#10

Quote:
Originally Posted by marinov
View Post
No because what if he had a 50 hp ? this is not the most precise way to do it, but it's not bad for how easy it was and how good it works.
its not a problem,you already save his HP so you can set it 99999 then back to 50(or whatever he had before.
are you sure you made it? because if you did than you knew it

On Topic: nice



P.S. Y are you saving his last health? you only need his first health. (before he jumps)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)