Anti-Bunny up ? - 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: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Anti-Bunny up ? (
/showthread.php?tid=285080)
Anti-Bunny up ? -
ServerScripter - 22.09.2011
Hi , is there any way to detect if a player bunny up and freeze him for 4Sec ?
Thanx
Re: Anti-Bunny up ? -
SantarioLeone - 22.09.2011
Use the search button, theres quite a few you an use. Or implement into your own script if you give credits.
Re: Anti-Bunny up ? -
ServerScripter - 22.09.2011
Of course i will do , i'm only asking if the player jump , there are a timer if he jump again and again(so 3 jumps) he will be frozen for 4 Seconds
it is like Anti-spam system he Must wait 2 or 3 sec between Jumps .
Re: Anti-Bunny up ? -
SantarioLeone - 22.09.2011
http://pastebin.com/WftJvpke
http://forum.sa-mp.com/showthread.ph...Anti+bunny+hop
Re: Anti-Bunny up ? -
Babul - 22.09.2011
Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (newkeys & KEY_JUMP)
{
new Ticks=GetTickCount();
if(Ticks-GetPVarInt(playerid,"LastBunnyHopMS")<4000)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z+30);
GameTextForPlayer(playerid,"~p~~h~you wanna get high?",4000,4);
}
SetPVarInt(playerid,"LastBunnyHopMS",Ticks);
}
return 1;
}
tested, works, and its quite annoying lol
you want it to react on the 3rd jump in 4 seconds? this one actually reacts on the second jump in 4 secs...
nothing added to check if the player is on foot or in a vehicle. you need to add it.
Re: Anti-Bunny up ? -
ServerScripter - 22.09.2011
Thank you Babul your Script is Working Perfect for me ! thank you too SantarioLeone i will check your script
. +1Rep
Re : Anti-Bunny up ? -
Naruto_Emilio - 22.09.2011
Can be done with GetPlayerVelocity too it's better then GetPlayerPos...