SA-MP Forums Archive
MAX_VEHICLES - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MAX_VEHICLES (/showthread.php?tid=79118)



MAX_VEHICLES - lol2112 - 25.05.2009

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.


Re: MAX_VEHICLES - Hot - 25.05.2009

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

"IN MY OPINION"


Re: MAX_VEHICLES - lol2112 - 25.05.2009

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.


Re: MAX_VEHICLES - Hot - 25.05.2009

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


Re: MAX_VEHICLES - lol2112 - 25.05.2009

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.


Re: MAX_VEHICLES - Castle - 25.05.2009

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


Re: MAX_VEHICLES - Donny_k - 25.05.2009

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.


Re: MAX_VEHICLES - lol2112 - 25.05.2009

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.


Re: MAX_VEHICLES - Weirdosport - 25.05.2009

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..


Re: MAX_VEHICLES - lol2112 - 25.05.2009

That's great, thanks for making it clear