23.09.2013, 10:46
Haven't posted in this thread in a while..
The script below was just something simple I made. It's a 100% accurate bunnyhop detection script. Most scripts just detect KEY_JUMP being pressed, but my script actually checks if the player is indeed jumping.
The more you know: bunnyhopping is spamming the jump key to get somewhere faster.
The script below was just something simple I made. It's a 100% accurate bunnyhop detection script. Most scripts just detect KEY_JUMP being pressed, but my script actually checks if the player is indeed jumping.
The more you know: bunnyhopping is spamming the jump key to get somewhere faster.
pawn Код:
// Bunnyhop Detection
#include <a_samp>
new g_JumpCount[MAX_PLAYERS char];
new g_JumpTime[MAX_PLAYERS];
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && GetPlayerAnimationIndex(playerid) == 1198)
{
if (GetTickCount() - g_JumpTime[playerid] >= 500)
{
if (++g_JumpCount{playerid} > 4)
{
// Your code here!
g_JumpCount{playerid} = 0;
}
g_JumpTime[playerid] = GetTickCount() + 500;
}
}
return 1;
}