17.09.2013, 08:58
Hello there, i was thinking of creating a simple bunny hop system so i created it but, i dunno if it's good enough for a RP server (a Heavy one) or not... Here it is:
Please, if you have anything in your mind that could make this script even a little bit better, let me know, i would be thankful of you.
Code:
new BH[MAX_PLAYERS];
forward Bunny_Hop(playerid);
forward Slap(playerid);
public OnPlayerConnect(playerid)
{
BH[playerid] = 0;
}
public Slap(playerid)
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
SetPlayerPos(playerid, X, Y, Z+5);
BH[playerid] = 0;
SendClientMessage(playerid, -1, "Bunny-Hopping is prohibited in this server.");
return 1;
}
public Bunny_Hop(playerid)
{
BH[playerid] = 0;
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if ((newkeys & KEY_JUMP) && !(oldkeys & KEY_JUMP))
{
if(!IsPlayerInAnyVehicle(playerid))
{
SetTimer("Bunny_Hop", 2000, false);
BH[playerid] += 1;
if(BH[playerid] == 2) return Slap(playerid);
}
}
return 1;
}

