SA-MP Forums Archive
Question - 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: Question (/showthread.php?tid=132813)



Question - westre - 09.03.2010

Hey guys, I've got a question, for example:

Код:
#define MAX_AIRPORTS 2
new Float:Airfields[MAX_AIRPORTS][2] = {
	{1471.412, 1483.09}, 
	{1751.681, -2464.032}
};
This all works etc, but how do I pick them?
I mean like:
Код:
if(TheFirstAirfield == 1)
{
......
Sorry for explaining this a bit vague but I need help with this. Thanks.


Re: Question - MPKaboose - 09.03.2010

Код:
if ( Airfields[0][0] == 1 )
{
}
//or
if ( Airfields[1][0] == 1 )
{
}
the first number in the [ ] is the "row" its starts from 0! second in [ ] is the "element" like in the first line the first "element" 0 is 1471.412 the second 1 is 1483.09 here the counting also starts from 0! If you don't understand I will explain a bit more



Re: Question - [HiC]TheKiller - 09.03.2010

Airfelds[0][0] = 1471.412
Airfelds[0][1] = 1483.09
Airfeilds[1][0] = 1751.681
Airfeilds[1][1] = -2464.032


Re: Question - westre - 09.03.2010

Thanks guys.