GetPlayerCity - 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: GetPlayerCity (
/showthread.php?tid=613709)
GetPlayerCity -
zeth98 - 30.07.2016
I try to make this script to take the player city, but it say every time NO
what is wrong?
Код HTML:
stock GetCity(Float:X,Float:Y)
{
new str[50];
if (X <= 1700.8179 && X >= 2903.0476 && Y <= -2860.2761 && Y >= -701.8962) format(str,sizeof(str),"LS");
else if (X <= -2885.0598 && X >= -1405.0571 && Y <= -1021.6824 && Y >= 1436.9240)format(str,sizeof(str),"SF");
else if (X <= 130.7416 && X >= 1447.1925 && Y <= -2843.7100 && Y >= -799.4094) format(str,sizeof(str),"LV");
else format(str,sizeof(str),"NO");
return str;
}
I put
printf("%s",GetCity(2000,-1000));
printf("%s",GetCity(20,-1));
printf("%s",GetCity(1000,1000));
printf("%s",GetCity(-2000,-2000));
and still say No
What is wrong?
Re: GetPlayerCity -
zeth98 - 30.07.2016
any idea?
Re: GetPlayerCity -
Vince - 30.07.2016
You should probably check your math courses again because X can't be smaller than 1700 AND greater than 2900 at the same time.