07.06.2009, 15:11
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?
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
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;
}
}
}
Thanks,
Ethan

