Anti B Hop - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti B Hop (
/showthread.php?tid=200956)
Anti B Hop -
Kardanas - 19.12.2010
Hello, any1 can give me a code of Anti B hop in game roles server. If people is runing and trying to jump he will stop.
Re: Anti B Hop -
Retardedwolf - 19.12.2010
Here
Re: Anti B Hop -
Face9000 - 19.12.2010
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if((newkeys & KEY_JUMP))
{
return 0;
}
return 1;
}
Re: Anti B Hop -
Kardanas - 19.12.2010
Quote:
Originally Posted by Logitech90
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if((newkeys & KEY_JUMP)) { return 0; } return 1; }
|
This code i need to write in my GM end or where? I got 1 ERROR
error 021: symbol already defined: "OnPlayerKeyStateChange"
Re: Anti B Hop -
Face9000 - 19.12.2010
If you have already OnPlayerKeyStateChange,then
pawn Код:
if((newkeys & KEY_JUMP))
{
return 0;
}
Only.
Re: Anti B Hop -
Retardedwolf - 19.12.2010
Returning 0
DOES not stop a player from bunny hopping. Please read the
wiki for more information.
Re: Anti B Hop -
Face9000 - 19.12.2010
This just stop when a player press the key for jump.
But you can alway try that FS.
Re: Anti B Hop -
Kardanas - 19.12.2010
Quote:
Originally Posted by Logitech90
If you have already OnPlayerKeyStateChange,then
pawn Код:
if((newkeys & KEY_JUMP)) { return 0; }
Only.
|
I have no error now, but i can still to bhop than i run.. :/
Re: Anti B Hop -
Retardedwolf - 19.12.2010
Quote:
Originally Posted by Logitech90
This just stop when a player press the key for jump.
But you can alway try that FS.
|
Oh god, Firstly, if that does work players can't jump any more in the gamemode which is a total failure.
Lastly,
Quote:
Originally Posted by wiki.sa-mp.com
1 - Allows this callback to be called in other scripts. It is always called first in gamemodes so retuning 0 there blocks filterscripts from seeing it.
|
Re: Anti B Hop -
Face9000 - 19.12.2010
Then it's my mistake sorry.
Try the FS that Retardedwolf linked u.