Posts: 225
Threads: 19
Joined: Apr 2012
any way to do it in pawn?
Posts: 232
Threads: 4
Joined: Apr 2013
What is your array?
It depends what do you need exactly, like if it's a vehicle model id array and you wanted to locate Infernus (Model ID: 411) index in the array, this is our array and this is how we're doing it:
PHP код:
new aModels[] = {400, 521, 532, 452, 411, 529, 521};
for(new i = 0; i < sizeof aModels; i++)
{
if(aModels[i] == 411)
{
// Now variable "i" is our index
printf("The index is: %i", i); // (It's 4, according to our aModels array)
break;
}
}
Posts: 225
Threads: 19
Joined: Apr 2012
Quote:
Originally Posted by Aliassassin123456
What is your array?
It depends what do you need exactly, like if it's a vehicle model id array and you wanted to locate Infernus (Model ID: 411) index in the array, this is our array and this is how we're doing it:
PHP код:
new aModels[] = {400, 521, 532, 452, 411, 529, 521};
for(new i = 0; i < sizeof aModels; i++)
{
if(aModels[i] == 411)
{
// Now variable "i" is our index
printf("The index is: %i", i); // (It's 4, according to our aModels array)
break;
}
}
|
thanks but I was asking for something like this
http://zone.ni.com/reference/en-XX/h...tarrayindex_m/