IsRangeOfPoint 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: IsRangeOfPoint problem (
/showthread.php?tid=398661)
IsRangeOfPoint problem -
Squirrel - 10.12.2012
I dont know but range aint working at all for me
Код:
if (strcmp(cmd, "/buy", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1566.8317, -1691.0072, 5.8906) && IsPlayerInRangeOfPoint(playerid, 5.0, 2497.3757, -1687.8939, 13.5221))
{
ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Weapons","1. Deagle (250$)\n2.MP5 (500$)\n3.m4 (1000$)\n4. AK-47 (1000$)\n5. SD Pistol (150$)\n6. 9mm (150$)\n7. Shotgun (300$)\n8. Micro SMG (500$)\n9. Sawnoff Shotgun (700$)\n10.Combat Shotgun (1000$)\n11. Tec-9 (500$)\n12.Country Rifle (1000$)\n13. Sniper Rifle (2000$)\n14. RPG (5000$)\n14. Flame Thrower (4000$)", "Buy", "Close");
}
return 1;
}
It doesnt do anything at all
Re: IsRangeOfPoint problem -
InfiniTy. - 10.12.2012
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1566.8317, -1691.0072, 5.8906) && IsPlayerInRangeOfPoint(playerid, 5.0, 2497.3757, -1687.8939, 13.5221))
Should be
pawn Код:
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1566.8317, -1691.0072, 5.8906) || IsPlayerInRangeOfPoint(playerid, 5.0, 2497.3757, -1687.8939, 13.5221))
&& means and .. you can't be in two places at the same time.. you need to use ||
|| means or ..
Re: IsRangeOfPoint problem -
you10 - 10.12.2012
They can't be in 2 places at once, try
pawn Код:
if (strcmp(cmd, "/buy", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0, 1566.8317, -1691.0072, 5.8906) || IsPlayerInRangeOfPoint(playerid, 5.0, 2497.3757, -1687.8939, 13.5221))
{
ShowPlayerDialog(playerid,6,DIALOG_STYLE_LIST,"Weapons","1. Deagle (250$)\n2.MP5 (500$)\n3.m4 (1000$)\n4. AK-47 (1000$)\n5. SD Pistol (150$)\n6. 9mm (150$)\n7. Shotgun (300$)\n8. Micro SMG (500$)\n9. Sawnoff Shotgun (700$)\n10.Combat Shotgun (1000$)\n11. Tec-9 (500$)\n12.Country Rifle (1000$)\n13. Sniper Rifle (2000$)\n14. RPG (5000$)\n14. Flame Thrower (4000$)", "Buy", "Close");
}
return 1;
}
Re: IsRangeOfPoint problem -
Squirrel - 10.12.2012
Oh I got it now
Thanks guys, +rep