SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 06/01/2012, 12:08 AM   #1
marinov
Gangsta
 
marinov's Avatar
 
Join Date: Oct 2010
Location: San Andreas
Posts: 591
Reputation: 8
Default HighJump

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.
__________________
http://mczombiecom.co.nr/
marinov is offline   Reply With Quote
Old 06/01/2012, 12:52 AM   #2
KeKe98
Little Clucker
 
KeKe98's Avatar
 
Join Date: Sep 2011
Location: Mars
Posts: 39
Reputation: 7
Default Re: HighJump

Nice! I will test it
__________________

tms-server.tk:7777
KeKe98 is offline   Reply With Quote
Old 08/01/2012, 11:22 PM   #3
[MM]18240[FMB]
Huge Clucker
 
[MM]18240[FMB]'s Avatar
 
Join Date: Jul 2011
Location: Space!
Posts: 355
Reputation: 47
Default Re: HighJump

I'll try it maybe a video. People here are stubborn mules who wont take the time to test something...
[MM]18240[FMB] is offline   Reply With Quote
Old 09/01/2012, 02:00 AM   #4
Hugo1984
Little Clucker
 
Join Date: Feb 2011
Posts: 22
Reputation: 8
Default Re: HighJump

Nice work
Hugo1984 is offline   Reply With Quote
Old 09/01/2012, 02:54 AM   #5
iZN
High-roller
 
Join Date: Jun 2010
Posts: 2,369
Reputation: 569
Default Re: HighJump

Good script will be using it maybe.
__________________
iZN is offline   Reply With Quote
Old 16/01/2012, 06:50 AM   #6
[MM]18240[FMB]
Huge Clucker
 
[MM]18240[FMB]'s Avatar
 
Join Date: Jul 2011
Location: Space!
Posts: 355
Reputation: 47
Default Re: HighJump

Umm, quick question. The JUMP_KEY is SHIFT for me, when I press it, it jumps regular. How may I go about fixing this?
__________________
Looking for a free Teamspeak Server to chill with your friends on? Join Teamshrimp Gaming's Teamspeak. We have free permanent channels, custom servergroups, and we're hiring moderators! Come check us out! ts.teamshrimp.com:9987
[MM]18240[FMB] is offline   Reply With Quote
Old 16/01/2012, 08:24 AM   #7
Sinner
Gangsta
 
Sinner's Avatar
 
Join Date: Aug 2010
Location: On This Mortal Coil
Posts: 770
Reputation: 292
Default Re: HighJump

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.
__________________
Please use the search feature before asking a question.
Sinner is offline   Reply With Quote
Old 16/01/2012, 08:56 AM   #8
T0pAz
Guest
 
Posts: n/a
Default Re: HighJump

Use Player Variable next time.
  Reply With Quote
Old 21/01/2012, 05:30 PM   #9
marinov
Gangsta
 
marinov's Avatar
 
Join Date: Oct 2010
Location: San Andreas
Posts: 591
Reputation: 8
Default Re: HighJump

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.
marinov is offline   Reply With Quote
Old 21/01/2012, 07:55 PM   #10
Kaperstone
Banned
 
Join Date: May 2011
Location: Russia
Posts: 3,004
Reputation: 824
Default Re: HighJump

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)
Kaperstone is offline   Reply With Quote
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



All times are GMT. The time now is 02:45 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.