Is Player Falling - 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: Is Player Falling (
/showthread.php?tid=80966)
Is Player Falling -
StrickenKid - 07.06.2009
someone sent me this a while ago and ive finally got time to test it and it totally doesn't work

it thinks your always falling...
can someone fix it please?
Код:
public FallingChecker()
{
new Float:x,Float:y,Float:z,Float:d;
for(new i = 0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerPos(i,x,y,z);
d = floatsqroot((x-LastX[i] * x-LastX[i]) + (y-LastY[i] * y-LastY[i]));
if(d < 10 && (LastZ[i] - z) > 5)
{
IsPlayerFalling[i] = 1;
}
else
{
IsPlayerFalling[i] = 0;
}
LastX[i] = x;
LastY[i] = y;
LastZ[i] = z;
}
}
}
or maybe theirs a totally different way to script it... it need to detect the last x y and z and if the z is greater... the player is falling.
Thanks,
Ethan
Re: Is Player Falling -
Weirdosport - 07.06.2009
I can only suggest you put in some debug stuff (SendClientMessage) there to see what the values are at a given point during it.
Re: Is Player Falling -
KeyWay - 07.06.2009
hmm what is that?
Like if accidently or there is bug that sometimes on spawn you fall from sky, and that fixes that?
Sounds intresting and i could need that, since rarely i fall from sky, but i should spawn from my house....
Re: Is Player Falling -
StrickenKid - 07.06.2009
its more for if you jump out of a plane, my anticheat is very sensitive and if you jump outa plane it will think your airbreaking.