03.04.2017, 09:17
Quote:
Код:
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], |
Quote:
(76 -- 77) : error 047: array sizes do not match, or destination array is too small (86) : error 029: invalid expression, assumed zero (86) : error 001: expected token: ";", but found "return" (86) : error 017: undefined symbol "i" (86) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 5 Errors. |
Line [76--77]
PHP код:
VehicleCreate(VehicleInfo[vehicleID][vModel],
VehicleInfo[vehicleID][vLoc], VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vRespawn],
PHP код:
for(new i = 0; i < 4; i++) format(strLoc, sizeof(strLoc), "Loc%d", i), INI_Float(strLoc, VehicleInfo[vehicleID][vLoc][i]);