03.04.2017, 09:11
Код:
stock VehiclePath(vehicleID) // Creating a function which will get the vehicle path dynamically based on the vehicle id of the system. { new strPath[64]; // Declaring the variable which will hold and return the vehicle path by vehicle id. format(strPath, sizeof(strPath), "/vehicle/%d.ini", vehicleID); // We are formatting the string so that it holds the file path based on the vehicle id. '%d' means it will be a whole number. return strPath; // Return the file path so that it can be manipulate later on. }
Код:
stock VehicleLoad(vehicleID, file[]) // This function will load the vehicle provided by the id when the server starts. { INI_ParseFile(file, "LoadVehicleData", .bExtra = true, .extra = vehicleID); // Parse the vehicle data from the INI file. VehicleCreate(VehicleInfo[vehicleID][vModel], VehicleInfo[vehicleID][vLoc], VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vRespawn], VehicleInfo[vehicleID][vOwner], VehicleInfo[vehicleID][vLocked]); // Creates the vehicle from the information we loaded and parsed. Pretty self-explanatory. }
Код:
VehicleInfo[vehicleID][vLoc],
Код:
Float:vLoc[4],