SA-MP Forums Archive
[HELP]Looping 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: [HELP]Looping problem (/showthread.php?tid=487080)



[HELP]Looping problem - Dusan01 - 11.01.2014

Hi guys, i m creating dinamic system and when i create pump id 0 and go near her and type /pump it works fine and when i create pump with id 1 and i go near her and type /pump its says to im not near pump so heres command:

Код:
CMD:pump(playerid, params[])
{
for(new i; i < MAX_PUMPI; i++)
		{
			if(!IsPlayerInRangeOfPoint(playerid, 5.0, PI[i][pPozx], PI[i][pPozy], PI[i][pPozz]))
			{
			SCM(playerid, BELA, "You are not near pump");
			return 1;
			}
			if(PlayerInfo[playerid][pKljucFirme] != PI[i][pFirme])
			{
			 SCM(playerid, BELA, BlaBlaBla!");
			 return 1;
			}
			ShowPlayerDialog(playerid, 29, DIALOG_STYLE_LIST, "Pumpa", "Ime Pumpe\nCijena litre\nTrenutno stanje goriva", "Izaberi", "Izadji");
	  }
return 1;
}
and here is this:

Код:
#define MAX_PUMPI 50
new PI[MAX_PUMPI][Pumpe];



Re: [HELP]Looping problem - Zamora - 11.01.2014

pawn Код:
CMD:pump(playerid, params[])
{
for(new i; i < MAX_PUMPI; i++)
        {
            if(!IsPlayerInRangeOfPoint(playerid, 5.0, PI[i][pPozx], PI[i][pPozy], PI[i][pPozz]))
            {
            SCM(playerid, BELA, "You are not near pump");
            return 1;
            }
            else if(PlayerInfo[playerid][pKljucFirme] != PI[i][pFirme])
            {
             SCM(playerid, BELA, BlaBlaBla!");
             return 1;
            }
else
{
            ShowPlayerDialog(playerid, 29, DIALOG_STYLE_LIST, "
Pumpa", "Ime Pumpe\nCijena litre\nTrenutno stanje goriva", "Izaberi", "Izadji");
}
      }
return 1;
}

Try this.


Re: [HELP]Looping problem - Dusan01 - 11.01.2014

Quote:
Originally Posted by Zamora
Посмотреть сообщение
pawn Код:
CMD:pump(playerid, params[])
{
for(new i; i < MAX_PUMPI; i++)
        {
            if(!IsPlayerInRangeOfPoint(playerid, 5.0, PI[i][pPozx], PI[i][pPozy], PI[i][pPozz]))
            {
            SCM(playerid, BELA, "You are not near pump");
            return 1;
            }
            else if(PlayerInfo[playerid][pKljucFirme] != PI[i][pFirme])
            {
             SCM(playerid, BELA, BlaBlaBla!");
             return 1;
            }
else
{
            ShowPlayerDialog(playerid, 29, DIALOG_STYLE_LIST, "
Pumpa", "Ime Pumpe\nCijena litre\nTrenutno stanje goriva", "Izaberi", "Izadji");
}
      }
return 1;
}
Try this.
Nah, i try but again just work for id 0