Check if falling problem - 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: Check if falling problem (
/showthread.php?tid=649853)
Check if falling problem -
C0oL3r - 16.02.2018
Код:
public CheckFalling(playerid)
{
new float:d, Float:Pos[3];
for(new i = 0; i < MAX_PLAYERS; i++)
{
GetPlayerPos(i, Pos[0], Pos[1], Pos[2]);
d = floatsqroot(Pos[0]-PosX[i]*Pos[0]-PosX[i]+Pos[1]-PosY[i]*Pos[1]-PosY[i]);
if(d < 10 && PosZ[i]-Pos[2] > 5)
{
isfalling[i] = 1;
}
else
{
isfalling[i] = 0;
}
}
}
i receive tag mismatch at lines
Код:
d = floatsqroot(Pos[0]-PosX[i]*Pos[0]-PosX[i]+Pos[1]-PosY[i]*Pos[1]-PosY[i]);
if(d < 10 && PosZ[i]-Pos[2] > 5)
Re: Check if falling problem -
PepsiCola23 - 16.02.2018
PHP код:
d = floatsqroot((Pos[0]-PosX[i]*Pos[0]-PosX[i])+(Pos[1]-PosY[i]*Pos[1]-PosY[i]));
if(d < 10 && (PosZ[i]-Pos[2]) > 5)
Re: Check if falling problem -
C0oL3r - 16.02.2018
still tag mismatch
Re: Check if falling problem -
PepsiCola23 - 16.02.2018
how did you define PosX,PosY and PosZ?
Re: Check if falling problem -
JesterlJoker - 16.02.2018
PHP код:
new Float:d, Float:Pos[3];
Your tag mismatched
You are using the float directive rather than the Float directive,
What's the difference. I don't know the pawn compiler makes a tag mismatch if you didn't use the same letter cases. Most of the time. You can also ignore that warning. That's just a warning which does not really have an effect, unless if the tag mismatch was about a input of different variables such as ints with floats.. You know what I mean
Re: Check if falling problem -
C0oL3r - 16.02.2018
Quote:
Originally Posted by JesterlJoker
PHP код:
new Float:d, Float:Pos[3];
Your tag mismatched
You are using the float directive rather than the Float directive,
What's the difference. I don't know the pawn compiler makes a tag mismatch if you didn't use the same letter cases. Most of the time. You can also ignore that warning. That's just a warning which does not really have an effect, unless if the tag mismatch was about a input of different variables such as ints with floats.. You know what I mean
|
Thanks!!! i didn't realise that i didn't put
Re: Check if falling problem -
C0oL3r - 16.02.2018
How can i return a zcmd command?
Re: Check if falling problem -
GTLS - 16.02.2018
Quote:
Originally Posted by C0oL3r
How can i return a zcmd command?
|
Код:
CMD:test(playerid, params[]) returns cmd_test1(playerid, params);
CMD:test1(playerid, params[])
{
//something here.
}
If thats what you asked?
Re: Check if falling problem -
C0oL3r - 16.02.2018
Yeah, thanks!
Re: Check if falling problem -
Hend - 17.02.2018
Код:
#define IsFallingAnimation(%1) (%1 >= 958 && %1 <= 979 || %1 == 1130 || %1 == 1195 || %1 == 1132)
stock IsPlayerFalling(playerid)
{
new index = GetPlayerAnimationIndex(playerid);
return IsFallingAnimation(index);
}