06.01.2015, 13:31
pawn Код:
stock VehicleLoad(vehicleID, file[])//loading the vehicle provided by the id when the server starts.
{
INI_ParseFile(file, "LoadVehicleData", .bExtra = true, .extra = vehicleID);
VehicleCreate(VehicleInfo[vehicleID][vModel],
VehicleInfo[vehicleID][vLoc], VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vRespawn],
VehicleInfo[vehicleID][vOwner], VehicleInfo[vehicleID][vLocked]);
}
stock VehicleSave(vehicleID)
{
new INI:dFile = INI_Open(VehiclePath(vehicleID));
new strLoc[8];
INI_WriteInt(dFile, "model", VehicleInfo[vehicleID][vModel]);
for(new i = 0; i < 4; i++) { format(strLoc, sizeof(strLoc), "Loc%d", i); INI_Float(dFile, strLoc, VehicleInfo[vehicleID][vLoc][i]); }
INI_WriteInt(dFile, "color1", VehicleInfo[vehicleID][vColor1]);
INI_WriteInt(dFile, "color2", VehicleInfo[vehicleID][vColor2]);
INI_WriteInt(dFile, "respawn", VehicleInfo[vehicleID][vRespawn]);
INI_WriteString(dFile, "owner", VehicleInfo[vehicleID][vOwner]);
INI_WriteInt(dFile, "locked", VehicleInfo[vehicleID][vLocked] ? 1 : 0);
INI_Close(dFile);
}
Код:
(228) : error 047: array sizes do not match, or destination array is too small (238) : error 035: argument type mismatch (argument 1) (238) : error 017: undefined symbol "value"
pawn Код:
VehicleCreate(VehicleInfo[vehicleID][vModel],VehicleInfo[vehicleID][vLoc], VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vRespawn],VehicleInfo[vehicleID][vOwner], VehicleInfo[vehicleID][vLocked]);
pawn Код:
for(new i = 0; i < 4; i++) { format(strLoc, sizeof(strLoc), "Loc%d", i); INI_Float(dFile, strLoc, VehicleInfo[vehicleID][vLoc][i]); }