[Ajuda] Бrea quadrada - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Бrea quadrada (
/showthread.php?tid=648425)
Бrea quadrada -
B4dSh33p - 21.01.2018
Alguйm me ajude nгo sei oque pode estб errado no meu cуdigo de algum jeito nгo consigo retornar 1.
PHP код:
new Valor = 0;
printf("%f %f %f",X,Y,Z);
if(X > 267.436309 && Y > -1610.369262 && X < 275.307769 && Y < -1621.699218 && Z < 50.445312 && Z > 46.000000)
{
Valor = 1;
}
return Valor;
//Print dos resultados que estou tendo. 270.324279 -1615.445800 46.020000
Re: Бrea quadrada -
Dayvison_ - 21.01.2018
PHP код:
main()
{
new
Float:X = 270.324279,
Float:Y = -1615.445800,
Float:Z = 46.020000
;
printf("0-%d", (X > 267.436309 && X < 275.307769));
printf("1-%d", (Y < -1610.369262 && Y > -1621.699218));
printf("2-%d", (Z > 46.000000 && Z < 50.445312));
printf("3-%d", (X > 267.436309));
printf("4-%d", (X < 275.307769));
printf("5-%d", (Y < -1610.369262));
printf("6-%d", (Y > -1621.699218));
printf("7-%d", (Z > 46.000000));
printf("8-%d", (Z < 50.445312));
if((X > 267.436309 && X < 275.307769) && (Y > -1610.369262 && Y < -1621.699218) && (Z > 46.000000 && Z < 50.445312))
{
print("true");
}
}
Os erros, estavam na verificaзгo de nъmeros negativos.
-10 > -15
Re: Бrea quadrada -
B4dSh33p - 21.01.2018
Obrigado cara, +REP.