[FilterScript] HighJump - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (
https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] HighJump (
/showthread.php?tid=309013)
HighJump -
marinov - 06.01.2012
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.
Re: HighJump -
KeKe98 - 06.01.2012
Nice! I will test it
Re: HighJump -
[MM]18240[FMB] - 08.01.2012
I'll try it maybe a video. People here are stubborn mules who wont take the time to test something...
Re: HighJump -
Hugo1984 - 09.01.2012
Nice work
Re: HighJump -
iZN - 09.01.2012
Good script will be using it maybe.
Re: HighJump -
[MM]18240[FMB] - 16.01.2012
Umm, quick question. The JUMP_KEY is SHIFT for me, when I press it, it jumps regular. How may I go about fixing this?
Re: HighJump -
Sinner - 16.01.2012
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.
Re: HighJump - T0pAz - 16.01.2012
Use
Player Variable next time.
Re: HighJump -
marinov - 21.01.2012
Quote:
Originally Posted by Sinner
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.
Re: HighJump -
Kaperstone - 21.01.2012
Quote:
Originally Posted by marinov
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)