SA-MP Forums Archive
error 010: invalid function or declaration - y_iterate - 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: error 010: invalid function or declaration - y_iterate (/showthread.php?tid=661631)



error 010: invalid function or declaration - y_iterate - Doddinger - 09.12.2018

Hello,

I want to check if the player is on specific vehicles with the help of y_iterate.
I read this tutorial already: https://sampforum.blast.hk/showthread.php?tid=570937
I don't really know what I'm doing wrong.

First I declared the array and the elements of the array (global):

Код:
new Iterator:airveh<19>;

Iter_Add(airveh, 417); //error 010: invalid function or declaration
Iter_Add(airveh, 425);
Iter_Add(airveh, 447);
Iter_Add(airveh, 460);
Iter_Add(airveh, 469);
Iter_Add(airveh, 476);
Iter_Add(airveh, 487);
Iter_Add(airveh, 488);
Iter_Add(airveh, 497);
Iter_Add(airveh, 511);
Iter_Add(airveh, 512);
Iter_Add(airveh, 513);
Iter_Add(airveh, 519);
Iter_Add(airveh, 520);
Iter_Add(airveh, 548);
Iter_Add(airveh, 553);
Iter_Add(airveh, 563);
Iter_Add(airveh, 577);
Iter_Add(airveh, 592);
Iter_Add(airveh, 593);
Then I wanted to iterate through the array.
Код:
new veh_e; (global)
forward AirVehicleCheck(const playerid);
public AirVehicleCheck(const playerid)
{
        new veh_t = GetPlayerVehicleID(playerid);
	foreach(new i : airveh)
	{
		if(i == veh_t)
		{
			veh_e = i;
		}
	}
        return 1;
}
Does anyone knows what I'm doing wrong?