Posts: 149
Threads: 5
Joined: Apr 2007
Reputation:
0
Hi there,
I've got a fuel script in which every car has its own fuel capacity (of 100 gallons) using Fuel[MAX_VEHICLES]. The problem is that my script also uses CreateVehicle meaning the number of vehicles in the server change all the time. I wanted to know what the best way to include these extra vehicles in my fuel script would be.
Many thanks.
Posts: 375
Threads: 117
Joined: Feb 2009
Reputation:
0
That MAX_VEHICLES means that the configuration will work for all vehicle on the server.
"IN MY OPINION"
Posts: 149
Threads: 5
Joined: Apr 2007
Reputation:
0
Ooooh right. So if I've got 130 vehicles in my server using AddStaticVehicle and have another 20 using CreateVehicle then MAX_VEHICLE tells the server that there are 150 in total? So I don't actually need to #define it to a preset number?
Thanks.
Posts: 375
Threads: 117
Joined: Feb 2009
Reputation:
0
Can you tell me what are your script, maybe let I take a look, mine's have Gas[MAX_VEHICLES]; And work perfectly :/
Posts: 331
Threads: 76
Joined: Aug 2008
Reputation:
0
I think its Gets all the vehicles that are on the server at the moment.
Posts: 788
Threads: 22
Joined: May 2006
Reputation:
0
MAX_VEHICLES is just a number (700), it doesn't do anything by itself and never changes, it's just a predefined value we use in our loops/arrays etc, it's not a variable.
Posts: 149
Threads: 5
Joined: Apr 2007
Reputation:
0
Ah that's what I was trying to find out. I thought it might change itself to the number of vehicles in your server. Thanks.
Posts: 1,293
Threads: 6
Joined: Jul 2008
Reputation:
0
All the MAX_ things and defines in the a_samp.inc file in your includes folder. It says there values there too. When the compiler comes across MAX_VEHICLES it just puts in 700 as Donny said. It's not special in any way, you could use the number 700 if you wanted..