07.06.2017, 16:01
Hi guys, can someone please tell me how I can go about looping through an enum (faction vehicles) so that I can create a command to reset all unoccupied faction vehicles?
Then of course I allocate the values to my vehicles in OnGameModeInit..
Then I was creating the foreach loop like:
The above clearly isn't correct.
Can someone please provide a link to a tutorial they know of that is clear and easy to understand? I have been searching but the ones out there just don't seem to help me.
Also if you're going to provide code, I would much appreciate an explanation as to what the code does and why it has to be that way round (im here to learn)... if you simply can't be arsed to do this, I will try and learn the code from reading it (i can of course).
Thank you in advance!
pawn Код:
enum teamCars
{
//police
c01,
c02,
c03,
c04,
c05,
c06,
c07,
c08,
c09,
c010,
c011,
c012,
c013,
c014,
c015,
c016,
c017,
c018,
c019,
c020
}
new Cars[teamCars];
Then I was creating the foreach loop like:
pawn Код:
foreach(Cars[teamCars], i)
{
//code here
}
Can someone please provide a link to a tutorial they know of that is clear and easy to understand? I have been searching but the ones out there just don't seem to help me.
Also if you're going to provide code, I would much appreciate an explanation as to what the code does and why it has to be that way round (im here to learn)... if you simply can't be arsed to do this, I will try and learn the code from reading it (i can of course).
Thank you in advance!