GetVehiclePoolSize

From SA-MP Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 19:39, 28 February 2015
Vince (Talk | contribs)

← Previous diff
Revision as of 19:42, 28 February 2015
Vince (Talk | contribs)
(completely mistaken, where was I with my mind)
Next diff →
Line 11: Line 11:
RepairAllVehicles() RepairAllVehicles()
{ {
- for(new i = 1, j = GetVehiclePoolSize(); i <= j && j != 0; i++) // verify that j (the pool size) is not 0 to avoid a potential infinite loop in case there are no vehicles+ for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++) // vehicleids start at 1
{ {
RepairVehicle(i); RepairVehicle(i);

Revision as of 19:42, 28 February 2015


This function was added in SA-MP 0.3.7 RC2 and will not work in earlier versions!


Description:

Gets the highest vehicleid currently in use on the server.


Parameters:
This function has no parameters.


Return Values:

The highest vehicleid currently in use on the server.


Example Usage:

RepairAllVehicles()
{
    for(new i = 1, j = GetVehiclePoolSize(); i <= j; i++) // vehicleids start at 1
    {
        RepairVehicle(i);
    }
}

Related Functions

The following functions may be useful, as they are related to this function in one way or another.