MAX_VEHICLES
#1

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

That MAX_VEHICLES means that the configuration will work for all vehicle on the server.

"IN MY OPINION"
Reply
#3

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

Can you tell me what are your script, maybe let I take a look, mine's have Gas[MAX_VEHICLES]; And work perfectly :/
Reply
#5

Well it's quite a big script. My fuel script is all based around

Код:
new Fuel[MAX_VEHICLES];
Then I have a save script, which remembers the last vehicle you were in before you left and puts you back in it when you rejoin using CreateVehicle and PutPlayerInVehicle.
What I want to do is add my fuel script to these created vehicles so all I need to know is whether MAX_VEHICLES includes ANY vehicle in the server including ones created while the script is running.
Reply
#6

I think its Gets all the vehicles that are on the server at the moment.
Reply
#7

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

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

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

That's great, thanks for making it clear
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)