Question
#1

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.
Reply
#2

Код:
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
Reply
#3

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

Thanks guys.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)