Foreach bug? - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Foreach bug? (
/showthread.php?tid=186578)
Foreach bug? -
armyoftwo - 29.10.2010
i have this code
Код:
foreach(House, h) {
foreach(Player, playerid) {
if(IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ])) {
// displaying text here
But when 2 players are standing in the position it's not showing the text for 2nd player but its showing for 1st player, anyone?
Re: Foreach bug? -
Mauzen - 29.10.2010
could be a break; at the end of your if{} (if it works in foreach, but i think so) If there is one, remove it.
Re: Foreach bug? -
armyoftwo - 29.10.2010
Quote:
Originally Posted by Mauzen
could be a break; at the end of your if{} (if it works in foreach, but i think so) If there is one, remove it.
|
Thanks!!! I didn't notice the return 1;!
Re: Foreach bug? -
armyoftwo - 30.10.2010
hmm when i removed return 1; it doesnt show anything anymore..