Array size
#1

I don't really know how to explain myself, I will try the best
I want to run a loop after all vehicles are created
If vehicle model == Rustler vehicle model (the shooting old plane)
Then it will add the vehicleid to an array containing the vehicleid & if the rustler has shot or not
Should I use an Iterator or a Variable for it, and if I need a variable, how exactly should I create it
New Rustlers[MAX_VEHICLES] or is there a shorter way ?
Reply
#2

Actually depends on how you do it. I'd go with an array and a variable used as a "count".
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Actually depends on how you do it. I'd go with an array and a variable used as a "count".
Something like this ?
PHP код:
    LoadVehicles();
    foreach(new 
Vehicle) if(GetVehicleModel(i) == 476Rustlers[i] = 1
(Rustlers[MAX_VEHICLES])
If so then how can I mark the vehicle as shot after shooting a missile ?
Reply
#4

Quote:
Originally Posted by NeXoR
Посмотреть сообщение
Something like this ?
PHP код:
    LoadVehicles();
    foreach(new 
Vehicle) if(GetVehicleModel(i) == 476Rustlers[i] = 1
(Rustlers[MAX_VEHICLES])
If so then how can I mark the vehicle as shot after shooting a missile ?
index mismatching is a problem over their.
you can do something like this
Код:
new j;
foreach(new i : Vehicle) 
{
 if(GetVehicleModel(i) == 476 && j != sizeof(Rustlers) )
 {
    Rustlers[j] = /*Process it*/;
    j++;
 }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)