06.01.2012, 00:08
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).
Please test and let me know if there's any problem.
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;
}